org.apache.commons.math.stat.univariate.moment
Class StandardDeviation

java.lang.Object
  extended byorg.apache.commons.math.stat.univariate.AbstractUnivariateStatistic
      extended byorg.apache.commons.math.stat.univariate.AbstractStorelessUnivariateStatistic
          extended byorg.apache.commons.math.stat.univariate.moment.Variance
              extended byorg.apache.commons.math.stat.univariate.moment.StandardDeviation
All Implemented Interfaces:
Serializable, StorelessUnivariateStatistic, UnivariateStatistic

public class StandardDeviation
extends Variance
implements Serializable

Version:
$Revision: 1.12 $ $Date: 2003/11/19 03:28:24 $
See Also:
Serialized Form

Field Summary
protected  double std
           
 
Fields inherited from class org.apache.commons.math.stat.univariate.moment.Variance
incMoment, mean, moment, n, variance
 
Constructor Summary
StandardDeviation()
          Constructs a StandardDeviation
StandardDeviation(SecondMoment m2)
          Constructs a StandardDeviation with an external moment
 
Method Summary
 void clear()
          Clears all the internal state of the Statistic
 double evaluate(double[] values, int begin, int length)
          Returns the Standard Deviation on an array of values.
 double getResult()
          Returns the current state of the statistic after the last increment.
 void increment(double d)
          Increments the internal state of the Storagless Implementation.
 
Methods inherited from class org.apache.commons.math.stat.univariate.moment.Variance
getN
 
Methods inherited from class org.apache.commons.math.stat.univariate.AbstractUnivariateStatistic
evaluate, test
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.commons.math.stat.univariate.UnivariateStatistic
evaluate
 

Field Detail

std

protected double std
Constructor Detail

StandardDeviation

public StandardDeviation()
Constructs a StandardDeviation


StandardDeviation

public StandardDeviation(SecondMoment m2)
Constructs a StandardDeviation with an external moment

Parameters:
m2 - the external moment
Method Detail

increment

public void increment(double d)
Description copied from interface: StorelessUnivariateStatistic
Increments the internal state of the Storagless Implementation.

Specified by:
increment in interface StorelessUnivariateStatistic
Overrides:
increment in class Variance
See Also:
StorelessUnivariateStatistic.increment(double)

getResult

public double getResult()
Description copied from interface: StorelessUnivariateStatistic
Returns the current state of the statistic after the last increment.

Specified by:
getResult in interface StorelessUnivariateStatistic
Overrides:
getResult in class Variance
See Also:
StorelessUnivariateStatistic.getResult()

clear

public void clear()
Description copied from interface: StorelessUnivariateStatistic
Clears all the internal state of the Statistic

Specified by:
clear in interface StorelessUnivariateStatistic
Overrides:
clear in class Variance
See Also:
StorelessUnivariateStatistic.clear()

evaluate

public double evaluate(double[] values,
                       int begin,
                       int length)
Returns the Standard Deviation on an array of values.

Specified by:
evaluate in interface UnivariateStatistic
Overrides:
evaluate in class Variance
Parameters:
values - Is a double[] containing the values
begin - processing at this point in the array
length - processing at this point in the array
Returns:
the result, Double.NaN if no values for an empty array or 0.0 for a single value set.
See Also:
UnivariateStatistic.evaluate(double[], int, int)


Copyright © 2003-2004 Apache Software Foundation. All Rights Reserved.