You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2023/01/19 04:57:41 UTC

[GitHub] [pinot] jasperjiaguo commented on issue #9277: [Feature] Support for Correlation Function

jasperjiaguo commented on issue #9277:
URL: https://github.com/apache/pinot/issues/9277#issuecomment-1396440724

   NaN could be due to Math.sqrt(negative_number) or 0.0/0.0 
   We have recently discovered this impl of covariance/correlation has numerical stability issue when E[x^2] ~ E[x]^2 >> 0 (see [1](https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Covariance) [2](https://github.com/trinodb/trino/blob/1866a23e3b0377144c1820de892c0de2762351a8/core/trino-main/src/main/java/io/trino/operator/aggregation/state/CorrelationState.java) [3](https://github.com/trinodb/trino/blob/1866a23e3b0377144c1820de892c0de2762351a8/core/trino-main/src/main/java/io/trino/operator/aggregation/state/CovarianceState.java)). Could we also use similar implementations?  I'm not sure if the online algorithm is already available as a library, but feel free to use if apache common has it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org