com.threerings.util
Class RunningStats

java.lang.Object
  extended by com.threerings.util.RunningStats

public class RunningStats
extends Object

Calculates live values for the mean, variance and standard deviation of a set of samples. Not thread safe!


Constructor Summary
RunningStats()
           
 
Method Summary
 void addSample(double sample)
          Adds a new sample.
 double getMax()
          Returns the maximum sample added or Double.NEGATIVE_INFINITY if no samples have been added.
 double getMean()
           
 double getMin()
          Returns the minimum sample added or Double.POSITIVE_INFINITY if no samples have been added.
 int getNumSamples()
           
 double getStandardDeviation()
           
 double getVariance()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RunningStats

public RunningStats()
Method Detail

addSample

public void addSample(double sample)
Adds a new sample.


getMin

public double getMin()
Returns the minimum sample added or Double.POSITIVE_INFINITY if no samples have been added.


getMax

public double getMax()
Returns the maximum sample added or Double.NEGATIVE_INFINITY if no samples have been added.


getVariance

public double getVariance()

getNumSamples

public int getNumSamples()

getMean

public double getMean()

getStandardDeviation

public double getStandardDeviation()


Copyright © 2012. All Rights Reserved.