org.apache.commons.math.stat
Class AbstractDescriptiveStatistics

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

public abstract class AbstractDescriptiveStatistics
extends AbstractStorelessDescriptiveStatistics

Provides univariate measures for an array of doubles.

Version:
$Revision: 1.1 $ $Date: 2003/11/15 16:01:37 $
See Also:
Serialized Form

Field Summary
protected  Percentile percentile
          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
AbstractDescriptiveStatistics()
          Create an AbstractDescriptiveStatistics
AbstractDescriptiveStatistics(int window)
          Create an AbstractDescriptiveStatistics with a specific Window
 
Method Summary
abstract  void addValue(double value)
          If windowSize is set to Infinite, statistics are calculated using the following recursive strategy .
abstract  double getElement(int index)
          Returns the element at the specified index
 double getPercentile(double p)
          Returns an estimate for the pth percentile of the stored values.
 double[] getSortedValues()
          Returns the current set of values in an array of double primitives, sorted in ascending order.
abstract  double[] getValues()
          Returns the current set of values in an array of double primitives.
 
Methods inherited from class org.apache.commons.math.stat.AbstractStorelessDescriptiveStatistics
apply, clear, getGeometricMean, getKurtosis, getKurtosisClass, getMax, getMean, getMin, getN, getSkewness, getStandardDeviation, getSum, getSumsq, getVariance, getWindowSize, setWindowSize, 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

percentile

protected Percentile percentile
Percentile

Constructor Detail

AbstractDescriptiveStatistics

public AbstractDescriptiveStatistics()
Create an AbstractDescriptiveStatistics


AbstractDescriptiveStatistics

public AbstractDescriptiveStatistics(int window)
Create an AbstractDescriptiveStatistics with a specific Window

Parameters:
window - WindowSIze for stat calculation
Method Detail

getPercentile

public double getPercentile(double p)
Description copied from class: DescriptiveStatistics
Returns an estimate for the pth percentile of the stored values. This estimate follows the interpolation-adjusted defintion presented here

Preconditions:

Specified by:
getPercentile in class DescriptiveStatistics
Parameters:
p - the requested percentile (scaled from 0 - 100)
Returns:
An estimate for the pth percentile of the stored data values
See Also:
DescriptiveStatistics.getPercentile(double)

getSortedValues

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

Specified by:
getSortedValues in class DescriptiveStatistics
Returns:
returns the current set of numbers sorted in ascending order
See Also:
DescriptiveStatistics.getSortedValues()

addValue

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

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

getValues

public abstract 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 DescriptiveStatistics
Returns:
returns the current set of numbers in the order in which they were added to this set
See Also:
DescriptiveStatistics.getValues()

getElement

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

Specified by:
getElement in class DescriptiveStatistics
Parameters:
index - The Index of the element
Returns:
return the element at the specified index
See Also:
DescriptiveStatistics.getElement(int)


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