edu.uci.ics.jung.statistics
Class StatisticalMoments

java.lang.Object
  extended by edu.uci.ics.jung.statistics.StatisticalMoments

public class StatisticalMoments
extends Object

A data structure representing the central moments of a distribution including:


Data values that are observed are passed into this data structure via the accumulate(...) method and the corresponding central moments are updated on each call

Author:
Didier H. Besset (modified by Scott White)

Field Summary
protected  double[] moments
          Vector containing the points.
 
Constructor Summary
StatisticalMoments()
          Default constructor methods: declare space for 5 moments.
StatisticalMoments(int n)
          General constructor methods.
 
Method Summary
 void accumulate(double x)
          statistical moment accumulation up to order 4.
 double average()
           
 long count()
          Returns the number of accumulated counts.
 double errorOnAverage()
          Returns the error on average.
 double kurtosis()
          The kurtosis measures the sharpness of the distribution near the maximum.
 void reset()
          Reset all counters.
 double skewness()
           
 double standardDeviation()
          Returns the standard deviation.
 double unnormalizedVariance()
           
 double variance()
          Note: the variance includes the Bessel correction factor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

moments

protected double[] moments
Vector containing the points.

Constructor Detail

StatisticalMoments

public StatisticalMoments()
Default constructor methods: declare space for 5 moments.


StatisticalMoments

public StatisticalMoments(int n)
General constructor methods.

Parameters:
n - number of moments to accumulate.
Method Detail

accumulate

public void accumulate(double x)
statistical moment accumulation up to order 4.

Parameters:
x - double value to accumulate

average

public double average()
Returns:
double average.

count

public long count()
Returns the number of accumulated counts.

Returns:
number of counts.

errorOnAverage

public double errorOnAverage()
Returns the error on average. May throw divide by zero exception.

Returns:
error on average.

kurtosis

public double kurtosis()
                throws ArithmeticException
The kurtosis measures the sharpness of the distribution near the maximum. Note: The kurtosis of the Normal distribution is 0 by definition.

Returns:
double kurtosis or NaN.
Throws:
ArithmeticException

reset

public void reset()
Reset all counters.


skewness

public double skewness()
                throws ArithmeticException
Returns:
double skewness.
Throws:
ArithmeticException

standardDeviation

public double standardDeviation()
Returns the standard deviation. May throw divide by zero exception.

Returns:
double standard deviation.

unnormalizedVariance

public double unnormalizedVariance()
Returns:
double

variance

public double variance()
                throws ArithmeticException
Note: the variance includes the Bessel correction factor.

Returns:
double variance.
Throws:
ArithmeticException