public class PearsonCorrelation extends Object
CovarianceMatrix
which uses
slightly more memory (by using arrays) but essentially does the same.Modifier and Type | Field and Description |
---|---|
private double |
meanX
Current mean for X
|
private double |
meanY
Current mean for Y
|
private double |
sumWe
Weight sum
|
private double |
sumXX
Sum for XX
|
private double |
sumXY
Sum for XY
|
private double |
sumYY
Sum for YY
|
Constructor and Description |
---|
PearsonCorrelation()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
getCorrelation()
Get the pearson correlation value.
|
double |
getCount()
Get the number of points the average is based on.
|
double |
getMeanX()
Return mean of X
|
double |
getMeanY()
Return mean of Y
|
double |
getNaiveCovariance()
Get the covariance of X and Y (not taking sampling into account)
|
double |
getNaiveStddevX()
Return standard deviation using the non-sample variance
Note: usually, you should be using
getSampleStddevX() instead! |
double |
getNaiveStddevY()
Return standard deviation using the non-sample variance
Note: usually, you should be using
getSampleStddevY() instead! |
double |
getNaiveVarianceX()
Return the naive variance (not taking sampling into account)
Note: usually, you should be using
getSampleVarianceX() instead! |
double |
getNaiveVarianceY()
Return the naive variance (not taking sampling into account)
Note: usually, you should be using
getSampleVarianceY() instead! |
double |
getSampleCovariance()
Get the covariance of X and Y (with sampling correction)
|
double |
getSampleStddevX()
Return standard deviation
|
double |
getSampleStddevY()
Return standard deviation
|
double |
getSampleVarianceX()
Return sample variance.
|
double |
getSampleVarianceY()
Return sample variance.
|
void |
put(double x,
double y)
Put a single value into the correlation statistic.
|
void |
put(double x,
double y,
double w)
Put a single value into the correlation statistic.
|
void |
reset()
Reset the value.
|
private double sumXX
private double sumYY
private double sumXY
private double meanX
private double meanY
private double sumWe
public void put(double x, double y, double w)
x
- Value in Xy
- Value in Yw
- Weightpublic void put(double x, double y)
x
- Value in Xy
- Value in Ypublic double getCorrelation()
public double getCount()
public double getMeanX()
public double getMeanY()
public double getNaiveCovariance()
public double getSampleCovariance()
public double getNaiveVarianceX()
getSampleVarianceX()
instead!public double getSampleVarianceX()
public double getNaiveStddevX()
getSampleStddevX()
instead!public double getSampleStddevX()
public double getNaiveVarianceY()
getSampleVarianceY()
instead!public double getSampleVarianceY()
public double getNaiveStddevY()
getSampleStddevY()
instead!public double getSampleStddevY()
public void reset()