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

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.FirstMoment
All Implemented Interfaces:
Serializable, StorelessUnivariateStatistic, UnivariateStatistic
Direct Known Subclasses:
SecondMoment

public class FirstMoment
extends AbstractStorelessUnivariateStatistic
implements Serializable

FirstMoment.java The FirstMoment (arithmentic mean) is calculated using the following recursive strategy . Both incremental and evaluation strategies currently use this approach.

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

Field Summary
protected  double dev
          temporary internal state made available for higher order moments
protected  double m1
          first moment of values that have been added
protected  int n
          count of values that have been added
protected  double n0
          temporary internal state made available for higher order moments
protected  double v
          temporary internal state made available for higher order moments
 
Constructor Summary
FirstMoment()
           
 
Method Summary
 void clear()
          Clears all the internal state of the Statistic
 double getN()
          Returns the current state of the statistic after the last increment.
 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.AbstractStorelessUnivariateStatistic
evaluate
 
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

n

protected int n
count of values that have been added


m1

protected double m1
first moment of values that have been added


dev

protected double dev
temporary internal state made available for higher order moments


v

protected double v
temporary internal state made available for higher order moments


n0

protected double n0
temporary internal state made available for higher order moments

Constructor Detail

FirstMoment

public FirstMoment()
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
Specified by:
increment in class AbstractStorelessUnivariateStatistic
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
Specified by:
clear in class AbstractStorelessUnivariateStatistic
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
Specified by:
getResult in class AbstractStorelessUnivariateStatistic
See Also:
StorelessUnivariateStatistic.getResult()

getN

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

Specified by:
getN in interface StorelessUnivariateStatistic
Returns:
value of the statistic, Double.NaN if it has been cleared or just instantiated.
See Also:
StorelessUnivariateStatistic.getN()


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