The OpenD Programming Language

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.

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.

Alias This

cor

Members

Functions

put
void put(double elem1, double elem2)
put
void put(typeof(this) rhs)

Combine two PearsonCor's.

Properties

N
double N [@property getter]
cor
double cor [@property getter]
cov
double cov [@property getter]
mean1
double mean1 [@property getter]
mean2
double mean2 [@property getter]
stdev1
double stdev1 [@property getter]
stdev2
double stdev2 [@property getter]
var1
double var1 [@property getter]
var2
double var2 [@property getter]

Bugs

Alias this disabled due to compiler bugs.

References: Computing Higher-Order Moments Online. http://people.xiph.org/~tterribe/notes/homs.html

Meta