|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjwo.utils.VarianceCalculator
public class VarianceCalculator
Class for efficient calculation of variance and standard deviation and mean of a list of numbers. Uses the one-pass method described in Hoemmen (2007) www.cs.berkeley.edu/~mhoemmen/cs194/Tutorials/variance.pdf
| Constructor Summary | |
|---|---|
VarianceCalculator()
Initialises the calculator. |
|
| Method Summary | |
|---|---|
void |
add(double x)
Adds a value to the values to be described. |
double |
getMean()
Reports the mean of the numbers that have been added to the calculator. |
double |
getNumValues()
Reports the number of values that have been added to the calculator. |
double |
getSampleStdev()
Reports the sample standard deviation (applying Bessel's correction) of the numbers that have been added to the calculator. |
double |
getSampleVariance()
Reports the sample variance (applying Bessel's correction) of the numbers that have been added to the calculator. |
double |
getStdev()
Reports the population standard deviation of the numbers that have been added to the calculator. |
double |
getVariance()
Reports the population variance of the numbers that have been added to the calculator. |
void |
reset()
Resets the calculator. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public VarianceCalculator()
| Method Detail |
|---|
public void add(double x)
x - Value to add.public void reset()
public double getNumValues()
public double getMean()
public double getVariance()
public double getSampleVariance()
public double getStdev()
public double getSampleStdev()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||