org.apache.commons.math.stat
Class DescriptiveStatisticsImpl

java.lang.Object
  extended byorg.apache.commons.math.stat.DescriptiveStatistics
      extended byorg.apache.commons.math.stat.AbstractStorelessDescriptiveStatistics
          extended byorg.apache.commons.math.stat.AbstractDescriptiveStatistics
              extended byorg.apache.commons.math.stat.DescriptiveStatisticsImpl
All Implemented Interfaces:
Serializable

public class DescriptiveStatisticsImpl
extends AbstractDescriptiveStatistics
implements Serializable

Version:
$Revision: 1.2 $ $Date: 2003/11/19 03:28:23 $
See Also:
Serialized Form

Field Summary
protected  ContractableDoubleArray eDA
          A contractable double array is used.
 
Fields inherited from class org.apache.commons.math.stat.AbstractDescriptiveStatistics
percentile
 
Fields inherited from class org.apache.commons.math.stat.AbstractStorelessDescriptiveStatistics
geoMean, kurtosis, max, mean, min, moment, n, skewness, sum, sumLog, sumsq, variance, windowSize
 
Fields inherited from class org.apache.commons.math.stat.DescriptiveStatistics
INFINITE_WINDOW, LEPTOKURTIC, MESOKURTIC, PLATYKURTIC
 
Constructor Summary
DescriptiveStatisticsImpl()
          Construct a DescriptiveStatisticsImpl
 
Method Summary
 void addValue(double v)
          If windowSize is set to Infinite, statistics are calculated using the following recursive strategy .
 double apply(UnivariateStatistic stat)
          Apply the given statistic to this univariate collection.
 void clear()
          Resets all statistics and storage
 double getElement(int index)
          Returns the element at the specified index
 int getN()
          Returns the number of available values
 double[] getValues()
          Returns the current set of values in an array of double primitives.
 void setWindowSize(int windowSize)
          WindowSize controls the number of values which contribute to the values returned by Univariate.
 
Methods inherited from class org.apache.commons.math.stat.AbstractDescriptiveStatistics
getPercentile, getSortedValues
 
Methods inherited from class org.apache.commons.math.stat.AbstractStorelessDescriptiveStatistics
getGeometricMean, getKurtosis, getKurtosisClass, getMax, getMean, getMin, getSkewness, getStandardDeviation, getSum, getSumsq, getVariance, getWindowSize, toString
 
Methods inherited from class org.apache.commons.math.stat.DescriptiveStatistics
newInstance, newInstance, newInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

eDA

protected ContractableDoubleArray eDA
A contractable double array is used. memory is reclaimed when the storage of the array becomes too empty.

Constructor Detail

DescriptiveStatisticsImpl

public DescriptiveStatisticsImpl()
Construct a DescriptiveStatisticsImpl

Method Detail

getValues

public double[] getValues()
Description copied from class: DescriptiveStatistics
Returns the current set of values in an array of double primitives. The order of addition is preserved. The returned array is a fresh copy of the underlying data -- i.e., it is not a reference to the stored data.

Specified by:
getValues in class AbstractDescriptiveStatistics
See Also:
DescriptiveStatistics.getValues()

getElement

public double getElement(int index)
Description copied from class: DescriptiveStatistics
Returns the element at the specified index

Specified by:
getElement in class AbstractDescriptiveStatistics
See Also:
DescriptiveStatistics.getElement(int)

getN

public int getN()
Description copied from class: DescriptiveStatistics
Returns the number of available values

Overrides:
getN in class AbstractStorelessDescriptiveStatistics
See Also:
org.apache.commons.math.stat.Univariate#getN()

addValue

public void addValue(double v)
Description copied from class: AbstractStorelessDescriptiveStatistics
If windowSize is set to Infinite, statistics are calculated using the following recursive strategy .

Specified by:
addValue in class AbstractDescriptiveStatistics
See Also:
org.apache.commons.math.stat.Univariate#addValue(double)

clear

public void clear()
Description copied from class: DescriptiveStatistics
Resets all statistics and storage

Overrides:
clear in class AbstractStorelessDescriptiveStatistics
See Also:
org.apache.commons.math.stat.Univariate#clear()

setWindowSize

public void setWindowSize(int windowSize)
Description copied from class: DescriptiveStatistics
WindowSize controls the number of values which contribute to the values returned by Univariate. For example, if windowSize is set to 3 and the values {1,2,3,4,5} have been added in that order then the available values are {3,4,5} and all reported statistics will be based on these values

Overrides:
setWindowSize in class AbstractStorelessDescriptiveStatistics
See Also:
org.apache.commons.math.stat.Univariate#setWindowSize(int)

apply

public double apply(UnivariateStatistic stat)
Apply the given statistic to this univariate collection.

Specified by:
apply in class AbstractStorelessDescriptiveStatistics
Parameters:
stat - the statistic to apply
Returns:
the computed value of the statistic.


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