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

public abstract Class AbstractStorelessUnivariateStatistic

extends AbstractUnivariateStatistic
implements StorelessUnivariateStatistic
Class Inheritance
All Implemented Interfaces
org.apache.commons.math3.stat.descriptive.StorelessUnivariateStatistic, org.apache.commons.math3.stat.descriptive.UnivariateStatistic, org.apache.commons.math3.util.MathArrays.Function
Known Direct Subclasses
org.apache.commons.math3.stat.descriptive.moment.FirstMoment, org.apache.commons.math3.stat.descriptive.moment.GeometricMean, org.apache.commons.math3.stat.descriptive.moment.Kurtosis, org.apache.commons.math3.stat.descriptive.moment.Mean, org.apache.commons.math3.stat.descriptive.moment.Skewness, org.apache.commons.math3.stat.descriptive.moment.StandardDeviation, org.apache.commons.math3.stat.descriptive.moment.Variance, org.apache.commons.math3.stat.descriptive.rank.Max, org.apache.commons.math3.stat.descriptive.rank.Min, org.apache.commons.math3.stat.descriptive.rank.PSquarePercentile, org.apache.commons.math3.stat.descriptive.summary.Product, org.apache.commons.math3.stat.descriptive.summary.Sum, org.apache.commons.math3.stat.descriptive.summary.SumOfLogs, org.apache.commons.math3.stat.descriptive.summary.SumOfSquares
Imports
org.apache.commons.math3.exception.util.LocalizedFormats, org.apache.commons.math3.exception.MathIllegalArgumentException, .NullArgumentException, org.apache.commons.math3.util.MathUtils, .Precision

Abstract implementation of the StorelessUnivariateStatistic interface.

Provides default evaluate() and incrementAll(double[]) implementations.

Note that these implementations are not synchronized.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract void
clear()

Redeclares org.apache.commons.math3.stat.descriptive.StorelessUnivariateStatistic.clear.

Clears the internal state of the Statistic

public abstract StorelessUnivariateStatistic
public boolean

Returns:

true if object returns the same value as this
equals
(Object
object to test equality against.
object
)

Overrides java.lang.Object.equals.

Returns true iff object is an AbstractStorelessUnivariateStatistic returning the same values as this for getResult() and getN()

public double

Returns:

the value of the statistic applied to the input array
evaluate
(final double[]
input array
values
)

Overrides org.apache.commons.math3.stat.descriptive.AbstractUnivariateStatistic.evaluate.

Implements org.apache.commons.math3.stat.descriptive.UnivariateStatistic.evaluate.

This default implementation calls clear, then invokes increment in a loop over the the input array, and then uses getResult to compute the return value.

public double

Returns:

the value of the statistic applied to the included array entries
evaluate
(final double[]
the input array
values
,
final int
the index of the first element to include
begin
,
final int
the number of elements to include
length
)

Implements abstract org.apache.commons.math3.stat.descriptive.AbstractUnivariateStatistic.evaluate.

Implements org.apache.commons.math3.stat.descriptive.UnivariateStatistic.evaluate.

This default implementation calls clear, then invokes increment in a loop over the specified portion of the input array, and then uses getResult to compute the return value.

public abstract double
public int

Returns:

hash code
hashCode
()

Overrides java.lang.Object.hashCode.

Returns hash code based on getResult() and getN()

public abstract void
increment(final double
the new value.
d
)

Redeclares org.apache.commons.math3.stat.descriptive.StorelessUnivariateStatistic.increment.

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

public void
incrementAll(double[]
values to add
values
)

Implements org.apache.commons.math3.stat.descriptive.StorelessUnivariateStatistic.incrementAll.

This default implementation just calls increment in a loop over the input array.

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

Implements org.apache.commons.math3.stat.descriptive.StorelessUnivariateStatistic.incrementAll.

This default implementation just calls increment in a loop over the specified portion of the input array.

Inherited from org.apache.commons.math3.stat.descriptive.AbstractUnivariateStatistic:
evaluategetDatagetDataRefsetDatasetDatatesttesttesttest

Constructor Detail

AbstractStorelessUnivariateStatisticback to summary
public AbstractStorelessUnivariateStatistic()

Method Detail

clearback to summary
public abstract void clear()

Redeclares org.apache.commons.math3.stat.descriptive.StorelessUnivariateStatistic.clear.

Doc from org.apache.commons.math3.stat.descriptive.StorelessUnivariateStatistic.clear.

Clears the internal state of the Statistic

copyback to summary
public abstract StorelessUnivariateStatistic copy()

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

Implements abstract org.apache.commons.math3.stat.descriptive.AbstractUnivariateStatistic.copy.

Doc from org.apache.commons.math3.stat.descriptive.StorelessUnivariateStatistic.copy.

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

Returns:StorelessUnivariateStatistic

a copy of the statistic

Annotations
@Override
equalsback to summary
public boolean equals(Object object)

Overrides java.lang.Object.equals.

Returns true iff object is an AbstractStorelessUnivariateStatistic returning the same values as this for getResult() and getN()

Parameters
object:Object

object to test equality against.

Returns:boolean

true if object returns the same value as this

Annotations
@Override
evaluateback to summary
public double evaluate(final double[] values) throws MathIllegalArgumentException

Overrides org.apache.commons.math3.stat.descriptive.AbstractUnivariateStatistic.evaluate.

Implements org.apache.commons.math3.stat.descriptive.UnivariateStatistic.evaluate.

This default implementation calls clear, then invokes increment in a loop over the the input array, and then uses getResult to compute the return value.

Note that this implementation changes the internal state of the statistic. Its side effects are the same as invoking clear and then incrementAll(double[]).

Implementations may override this method with a more efficient and possibly more accurate implementation that works directly with the input array.

If the array is null, a MathIllegalArgumentException is thrown.

Parameters
values:double[]

input array

Returns:double

the value of the statistic applied to the input array

Annotations
@Override
Exceptions
MathIllegalArgumentException:
if values is null
See Also
org.apache.commons.math3.stat.descriptive.UnivariateStatistic#evaluate(double[])
evaluateback to summary
public double evaluate(final double[] values, final int begin, final int length) throws MathIllegalArgumentException

Implements abstract org.apache.commons.math3.stat.descriptive.AbstractUnivariateStatistic.evaluate.

Implements org.apache.commons.math3.stat.descriptive.UnivariateStatistic.evaluate.

This default implementation calls clear, then invokes increment in a loop over the specified portion of the input array, and then uses getResult to compute the return value.

Note that this implementation changes the internal state of the statistic. Its side effects are the same as invoking clear and then incrementAll(double[], int, int).

Implementations may override this method with a more efficient and possibly more accurate implementation that works directly with the input array.

If the array is null or the index parameters are not valid, an MathIllegalArgumentException is thrown.

Parameters
values:double[]

the input array

begin:int

the index of the first element to include

length:int

the number of elements to include

Returns:double

the value of the statistic applied to the included array entries

Annotations
@Override
Exceptions
MathIllegalArgumentException:
if the array is null or the indices are not valid
See Also
org.apache.commons.math3.stat.descriptive.UnivariateStatistic#evaluate(double[], int, int)
getResultback to summary
public abstract double getResult()

Redeclares org.apache.commons.math3.stat.descriptive.StorelessUnivariateStatistic.getResult.

Doc from org.apache.commons.math3.stat.descriptive.StorelessUnivariateStatistic.getResult.

Returns the current value of the Statistic.

Returns:double

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

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns hash code based on getResult() and getN()

Returns:int

hash code

Annotations
@Override
incrementback to summary
public abstract void increment(final double d)

Redeclares org.apache.commons.math3.stat.descriptive.StorelessUnivariateStatistic.increment.

Doc from org.apache.commons.math3.stat.descriptive.StorelessUnivariateStatistic.increment.

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

Implements org.apache.commons.math3.stat.descriptive.StorelessUnivariateStatistic.incrementAll.

This default implementation just calls increment in a loop over the input array.

Throws IllegalArgumentException if the input values array is null.

Parameters
values:double[]

values to add

Exceptions
MathIllegalArgumentException:
if values is null
See Also
org.apache.commons.math3.stat.descriptive.StorelessUnivariateStatistic#incrementAll(double[])
incrementAllback to summary
public void incrementAll(double[] values, int begin, int length) throws MathIllegalArgumentException

Implements org.apache.commons.math3.stat.descriptive.StorelessUnivariateStatistic.incrementAll.

This default implementation just calls increment in a loop over the specified portion of the input array.

Throws IllegalArgumentException if the input values array is null.

Parameters
values:double[]

array holding values to add

begin:int

index of the first array element to add

length:int

number of array elements to add

Exceptions
MathIllegalArgumentException:
if values is null
See Also
org.apache.commons.math3.stat.descriptive.StorelessUnivariateStatistic#incrementAll(double[], int, int)