|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math.stat.descriptive.DescriptiveStatistics
public abstract class DescriptiveStatistics
Abstract factory class for univariate statistical summaries.
Field Summary | |
---|---|
static int |
INFINITE_WINDOW
This constant signals that a Univariate implementation takes into account the contributions of an infinite number of elements. |
private static long |
serialVersionUID
Serialization UID |
Constructor Summary | |
---|---|
DescriptiveStatistics()
|
Method Summary | |
---|---|
abstract void |
addValue(double v)
Adds the value to the set of numbers |
abstract double |
apply(UnivariateStatistic stat)
Apply the given statistic to the data associated with this set of statistics. |
abstract void |
clear()
Resets all statistics and storage |
abstract double |
getElement(int index)
Returns the element at the specified index |
double |
getGeometricMean()
Returns the geometric mean of the available values |
double |
getKurtosis()
Returns the Kurtosis of the available values. |
double |
getMax()
Returns the maximum of the available values |
double |
getMean()
Returns the arithmetic mean of the available values |
double |
getMin()
Returns the minimum of the available values |
abstract long |
getN()
Returns the number of available values |
double |
getPercentile(double p)
Returns an estimate for the pth percentile of the stored values. |
double |
getSkewness()
Returns the skewness of the available values. |
double[] |
getSortedValues()
Returns the current set of values in an array of double primitives, sorted in ascending order. |
double |
getStandardDeviation()
Returns the standard deviation of the available values. |
double |
getSum()
Returns the sum of the values that have been added to Univariate. |
double |
getSumsq()
Returns the sum of the squares of the available values. |
abstract double[] |
getValues()
Returns the current set of values in an array of double primitives. |
double |
getVariance()
Returns the variance of the available values. |
abstract int |
getWindowSize()
Univariate has the ability to return only measures for the last N elements added to the set of values. |
static DescriptiveStatistics |
newInstance()
Create an instance of a DescriptiveStatistics |
static DescriptiveStatistics |
newInstance(java.lang.Class cls)
Create an instance of a DescriptiveStatistics |
abstract void |
setWindowSize(int windowSize)
WindowSize controls the number of values which contribute to the values returned by Univariate. |
java.lang.String |
toString()
Generates a text report displaying univariate statistics from values that have been added. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
public static final int INFINITE_WINDOW
Constructor Detail |
---|
public DescriptiveStatistics()
Method Detail |
---|
public static DescriptiveStatistics newInstance(java.lang.Class cls) throws java.lang.InstantiationException, java.lang.IllegalAccessException
DescriptiveStatistics
cls
- the type of DescriptiveStatistics
object to
create.
java.lang.InstantiationException
- is thrown if the object can not be
created.
java.lang.IllegalAccessException
- is thrown if the type's default
constructor is not accessible.public static DescriptiveStatistics newInstance()
DescriptiveStatistics
public abstract void addValue(double v)
v
- the value to be addedpublic double getMean()
getMean
in interface StatisticalSummary
public double getGeometricMean()
public double getVariance()
getVariance
in interface StatisticalSummary
public double getStandardDeviation()
getStandardDeviation
in interface StatisticalSummary
public double getSkewness()
public double getKurtosis()
public double getMax()
getMax
in interface StatisticalSummary
public double getMin()
getMin
in interface StatisticalSummary
public abstract long getN()
getN
in interface StatisticalSummary
public double getSum()
getSum
in interface StatisticalSummary
public double getSumsq()
public abstract void clear()
public abstract int getWindowSize()
public abstract void setWindowSize(int windowSize)
windowSize
- sets the size of the window.public abstract double[] getValues()
public double[] getSortedValues()
public abstract double getElement(int index)
index
- The Index of the element
public double getPercentile(double p)
The implementation provided here follows the first estimation procedure presented here.
Preconditions:
0 < p < 100
(otherwise an
IllegalArgumentException
is thrown)Double.NaN
otherwise)
p
- the requested percentile (scaled from 0 - 100)
public java.lang.String toString()
toString
in class java.lang.Object
public abstract double apply(UnivariateStatistic stat)
stat
- the statistic to apply
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |