You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Ajo Fod (JIRA)" <ji...@apache.org> on 2013/05/21 19:01:21 UTC
[jira] [Comment Edited] (MATH-978) StorelessCovariance to be
map/reducable
[ https://issues.apache.org/jira/browse/MATH-978?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13663124#comment-13663124 ]
Ajo Fod edited comment on MATH-978 at 5/21/13 5:00 PM:
-------------------------------------------------------
Code for StorelessBivariateCovariance:
<pre>
/**
* Appends another covariance calculation to this.
*/
public void append(StorelessBivariateCovariance cov) {
double oldN = n;
n += cov.n;
final double deltaX = cov.meanX - meanX;
final double deltaY = cov.meanY - meanY;
meanX += deltaX * cov.n / n;
meanY += deltaY * cov.n / n;
covarianceNumerator+= cov.covarianceNumerator + oldN*cov.n/n*deltaX*deltaY;
}
</pre>
was (Author: ajo.fod):
Code for StorelessBivariateCovariance:
/**
* Appends another covariance calculation to this.
*/
public void append(StorelessBivariateCovariance cov) {
double oldN = n;
n += cov.n;
final double deltaX = cov.meanX - meanX;
final double deltaY = cov.meanY - meanY;
meanX += deltaX * cov.n / n;
meanY += deltaY * cov.n / n;
covarianceNumerator+= cov.covarianceNumerator + oldN*cov.n/n*deltaX*deltaY;
}
> StorelessCovariance to be map/reducable
> ---------------------------------------
>
> Key: MATH-978
> URL: https://issues.apache.org/jira/browse/MATH-978
> Project: Commons Math
> Issue Type: New Feature
> Reporter: Ajo Fod
> Original Estimate: 2h
> Remaining Estimate: 2h
>
> Current version of StorelessCovariance and StorelessBivariateCovariance don't allow adding another StorelessCovariance to an existing one. With this feature it is possible to run maps on different data sets and then do a final reduce to get the overall covariance.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira