us.ihmc.utilities.math
Class OnePassMeanAndStandardDeviation
java.lang.Object
us.ihmc.utilities.math.OnePassMeanAndStandardDeviation
public class OnePassMeanAndStandardDeviation
- extends java.lang.Object
- Author:
- Nicolas Gerig
One pass efficient way of calculating variances and standard deviation efficiently
Based On:
http://www.cs.berkeley.edu/~mhoemmen/cs194/Tutorials/variance.pdf
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OnePassMeanAndStandardDeviation
public OnePassMeanAndStandardDeviation()
compute
public void compute(double value)
- Updates information needed for average and variances for one-pass
- Parameters:
value
-
getNumberOfTotalMeasurements
public int getNumberOfTotalMeasurements()
- Returns:
- n, the number of measurements used for average and standard deviation so far
getAverage
public double getAverage()
- Returns:
- mu, the average of all measurements so far
getVariance
public double getVariance()
- Returns:
- sigmaSquare, the (population) variance, based on all measurements so far
getStandardDeviation
public double getStandardDeviation()
- Returns:
- sigma, the standard deviation, based on all measurements so far
getSampleVariance
public double getSampleVariance()
- Returns:
- sSquare, the sample variance, based on all measurements so far