
@Reference(authors="B. P. Welford", title="Note on a method for calculating corrected sums of squares and products", booktitle="Technometrics 4(3)") public class MeanVariance extends Mean
 B. P. Welford
 Note on a method for calculating corrected sums of squares and products
 in: Technometrics 4(3)
 
 D.H.D. West
 Updating Mean and Variance Estimates: An Improved Method
 In: Communications of the ACM, Volume 22 Issue 9
 
| Modifier and Type | Field and Description | 
|---|---|
| protected double | nvarnVariance | 
| Constructor and Description | 
|---|
| MeanVariance()Empty constructor | 
| MeanVariance(MeanVariance other)Constructor from other instance | 
| Modifier and Type | Method and Description | 
|---|---|
| double | denormalizeValue(double val)Return the unnormalized value (centered at the mean, distance normalized by
 standard deviation) | 
| double | getCount()Get the number of points the average is based on. | 
| double | getMean()Return mean | 
| double | getNaiveStddev()Return standard deviation using the non-sample variance
 
 Note: usually, you should be using  getSampleStddev()instead! | 
| double | getNaiveVariance()Return the naive variance (not taking sampling into account)
 
 Note: usually, you should be using  getSampleVariance()instead! | 
| double | getSampleStddev()Return standard deviation | 
| double | getSampleVariance()Return sample variance. | 
| static MeanVariance[] | newArray(int dimensionality)Create and initialize a new array of MeanVariance | 
| double | normalizeValue(double val)Return the normalized value (centered at the mean, distance normalized by
 standard deviation) | 
| void | put(double val)Add a single value with weight 1.0 | 
| void | put(double val,
   double weight)Add data with a given weight. | 
| void | put(Mean other)Join the data of another MeanVariance instance. | 
| void | reset()Reset the value. | 
| String | toString() | 
public MeanVariance()
public MeanVariance(MeanVariance other)
other - other instance to copy data from.public void put(double val)
public void put(double val,
       double weight)
public void put(Mean other)
public double getCount()
public double getNaiveVariance()
getSampleVariance() instead!public double getSampleVariance()
public double getNaiveStddev()
getSampleStddev() instead!public double getSampleStddev()
public double normalizeValue(double val)
val - original valuepublic double denormalizeValue(double val)
val - normalized valuepublic static MeanVariance[] newArray(int dimensionality)
dimensionality - Dimensionality