Struct PearsonCor

Allows computation of mean, stdev, variance, covariance, Pearson correlation online. Getters for stdev, var, cov, cor cost floating point division ops. Getters for means cost a single branch to check for N == 0. This struct uses O(1) space.

struct PearsonCor ;

PearsonCor.cor is alias this'd, so if this struct is used as a float, it will be converted to a simple correlation coefficient automatically.

Properties

NameTypeDescription
cor[get] double
cov[get] double
mean1[get] double
mean2[get] double
N[get] double
stdev1[get] double
stdev2[get] double
var1[get] double
var2[get] double

Methods

NameDescription
put
put Combine two PearsonCor's.

Bugs

Alias this disabled due to compiler bugs.

References

Computing Higher-Order Moments Online.

http

//people.xiph.org/~tterribe/notes/homs.html