You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Thejas M Nair (JIRA)" <ji...@apache.org> on 2013/10/16 00:13:42 UTC
[jira] [Commented] (HIVE-3455) ANSI CORR(X,Y) is incorrect
[ https://issues.apache.org/jira/browse/HIVE-3455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13795726#comment-13795726 ]
Thejas M Nair commented on HIVE-3455:
-------------------------------------
Clearing fix version. in hive the fix version is set after a patch is committed.
> ANSI CORR(X,Y) is incorrect
> ---------------------------
>
> Key: HIVE-3455
> URL: https://issues.apache.org/jira/browse/HIVE-3455
> Project: Hive
> Issue Type: Bug
> Components: UDF
> Affects Versions: 0.7.1, 0.8.0, 0.8.1, 0.9.0, 0.9.1, 0.10.0, 0.11.0, 0.12.0
> Reporter: Maxim Bolotin
> Labels: patch
> Attachments: HIVE3455.corrTest.tar.gz, my.patch
>
>
> A simple test with 2 collinear vectors returns a wrong result.
> The problem is the merge of variances, file:
> http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFCorrelation.java?revision=1157222&view=markup
> lines:
> 347: myagg.xvar += xvarB + (xavgA - xavgB) * (xavgA - xavgB) * myagg.count;
> 348: myagg.yvar += yvarB + (yavgA - yavgB) * (yavgA - yavgB) * myagg.count;
> the correct merge should be like this:
> 347: myagg.xvar += xvarB + (xavgA - xavgB) * (xavgA - xavgB) / myagg.count * nA * nB;
> 348: myagg.yvar += yvarB + (yavgA - yavgB) * (yavgA - yavgB) / myagg.count * nA * nB;
--
This message was sent by Atlassian JIRA
(v6.1#6144)