> On June 11, 2014, 7:31 a.m., Mehant Baid wrote: > > exec/java-exec/src/main/codegen/templates/CorrelationTypeFunctions.java, > > line 107 > > <https://reviews.apache.org/r/21941/diff/1/?file=595305#file595305line107> > > > > which method/ formula are you using to compute the correlation > > coefficient? Do you think if it might suffer from catastrophic cancellation > > problem?
This appears to use Welford's method and should be numerically quite stable. It will be difficult to do better in a single pass. - Ted ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/21941/#review45346 ----------------------------------------------------------- On May 27, 2014, 8:24 p.m., Yash Sharma wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/21941/ > ----------------------------------------------------------- > > (Updated May 27, 2014, 8:24 p.m.) > > > Review request for drill, Aditya Kishore, Mehant Baid, and Timothy Chen. > > > Repository: drill-git > > > Description > ------- > > Added implementation for Correlation coefficient calculation function. > > > Diffs > ----- > > exec/java-exec/src/main/codegen/config.fmpp 5c0d03b > exec/java-exec/src/main/codegen/data/CorrelationTypes.tdd PRE-CREATION > exec/java-exec/src/main/codegen/templates/CorrelationTypeFunctions.java > PRE-CREATION > > exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestAggregateFunction.java > ffb372d > exec/java-exec/src/test/resources/functions/test_covariance.json > PRE-CREATION > > Diff: https://reviews.apache.org/r/21941/diff/ > > > Testing > ------- > > Yes. > $mvn test -Dtest=TestAggregateFunction#testCovarianceCorrelation > > > Thanks, > > Yash Sharma > >
