org.apache.commons.math.stat.univariate.moment
Class SecondMoment
java.lang.Object
org.apache.commons.math.stat.univariate.AbstractUnivariateStatistic
org.apache.commons.math.stat.univariate.AbstractStorelessUnivariateStatistic
org.apache.commons.math.stat.univariate.moment.FirstMoment
org.apache.commons.math.stat.univariate.moment.SecondMoment
- All Implemented Interfaces:
- Serializable, StorelessUnivariateStatistic, UnivariateStatistic
- Direct Known Subclasses:
- ThirdMoment
- public class SecondMoment
- extends FirstMoment
- implements Serializable
The SecondMoment is calculated using the following
recursive strategy
. Both incremental and evaluation strategies currently use this approach.
- Version:
- $Revision: 1.12 $ $Date: 2003/11/19 03:28:24 $
- See Also:
- Serialized Form
Field Summary |
protected double |
m2
second moment of values that have been added |
protected double |
n1
temporary internal state made availabel for higher order moments |
Fields inherited from class org.apache.commons.math.stat.univariate.moment.FirstMoment |
dev, m1, n, n0, v |
Method Summary |
void |
clear()
Clears all the internal state of the Statistic |
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.FirstMoment |
getN |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
m2
protected double m2
- second moment of values that have been added
n1
protected double n1
- temporary internal state made availabel for higher order moments
SecondMoment
public SecondMoment()
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 FirstMoment
- See Also:
StorelessUnivariateStatistic.increment(double)
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 FirstMoment
- See Also:
StorelessUnivariateStatistic.clear()
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 FirstMoment
- See Also:
StorelessUnivariateStatistic.getResult()
Copyright © 2003-2004 Apache Software Foundation. All Rights Reserved.