Top Description Methods
org.apache.commons.math3.stat.descriptive

public Interface StorelessUnivariateStatistic

extends UnivariateStatistic
Known Direct Implementers
org.apache.commons.math3.stat.descriptive.rank.PSquarePercentile, org.apache.commons.math3.stat.descriptive.AbstractStorelessUnivariateStatistic
Imports
org.apache.commons.math3.exception.MathIllegalArgumentException

Extends the definition of UnivariateStatistic with increment and incrementAll(double[]) methods for adding values and updating internal state.

This interface is designed to be used for calculating statistics that can be computed in one pass through the data without storing the full array of sample values.

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Clears the internal state of the Statistic

public StorelessUnivariateStatistic

Returns:

a copy of the statistic
copy
()

Redeclares org.apache.commons.math3.stat.descriptive.UnivariateStatistic.copy.

Returns a copy of the statistic with the same internal state.

public long

Returns:

the number of values.
getN
()

Returns the number of values that have been added.

public double

Returns:

value of the statistic, Double.NaN if it has been cleared or just instantiated.
getResult
()

Returns the current value of the Statistic.

public void
increment(double
the new value.
d
)

Updates the internal state of the statistic to reflect the addition of the new value.

public void
incrementAll(double[]
array holding the new values to add
values
)

Updates the internal state of the statistic to reflect addition of all values in the values array.

public void
incrementAll(double[]
array holding the new values to add
values
,
int
the array index of the first value to add
start
,
int
the number of elements to add
length
)

Updates the internal state of the statistic to reflect addition of the values in the designated portion of the values array.

Inherited from org.apache.commons.math3.stat.descriptive.UnivariateStatistic:
evaluateevaluate

Method Detail

clearback to summary
public void clear()

Clears the internal state of the Statistic

copyback to summary
public StorelessUnivariateStatistic copy()

Redeclares org.apache.commons.math3.stat.descriptive.UnivariateStatistic.copy.

Returns a copy of the statistic with the same internal state.

Returns:StorelessUnivariateStatistic

a copy of the statistic

getNback to summary
public long getN()

Returns the number of values that have been added.

Returns:long

the number of values.

getResultback to summary
public double getResult()

Returns the current value of the Statistic.

Returns:double

value of the statistic, Double.NaN if it has been cleared or just instantiated.

incrementback to summary
public void increment(double d)

Updates the internal state of the statistic to reflect the addition of the new value.

Parameters
d:double

the new value.

incrementAllback to summary
public void incrementAll(double[] values) throws MathIllegalArgumentException

Updates the internal state of the statistic to reflect addition of all values in the values array. Does not clear the statistic first -- i.e., the values are added incrementally to the dataset.

Parameters
values:double[]

array holding the new values to add

Exceptions
MathIllegalArgumentException:
if the array is null
incrementAllback to summary
public void incrementAll(double[] values, int start, int length) throws MathIllegalArgumentException

Updates the internal state of the statistic to reflect addition of the values in the designated portion of the values array. Does not clear the statistic first -- i.e., the values are added incrementally to the dataset.

Parameters
values:double[]

array holding the new values to add

start:int

the array index of the first value to add

length:int

the number of elements to add

Exceptions
MathIllegalArgumentException:
if the array is null or the index