Class VectorialStorelessStatistic
- java.lang.Object
-
- org.hipparchus.stat.descriptive.vector.VectorialStorelessStatistic
-
- All Implemented Interfaces:
Serializable,StorelessMultivariateStatistic
public class VectorialStorelessStatistic extends Object implements StorelessMultivariateStatistic, Serializable
Uses an independentStorelessUnivariateStatisticinstance for each component of a vector.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description VectorialStorelessStatistic(int dimension, StorelessUnivariateStatistic univariateStatistic)Create a new VectorialStorelessStatistic with the given dimension and statistic implementation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears the internal state of the statistic.booleanequals(Object obj)intgetDimension()Returns the dimension of the statistic.longgetN()Returns the number of values that have been added.double[]getResult()Returns the current value of the Statistic.inthashCode()voidincrement(double[] d)Updates the internal state of the statistic to reflect the addition of the new value.
-
-
-
Constructor Detail
-
VectorialStorelessStatistic
public VectorialStorelessStatistic(int dimension, StorelessUnivariateStatistic univariateStatistic)Create a new VectorialStorelessStatistic with the given dimension and statistic implementation. A copy of the provided statistic will be created for each component of the vector.- Parameters:
dimension- the vector dimensionunivariateStatistic- the prototype statistic- Throws:
MathIllegalArgumentException- if dimension < 1
-
-
Method Detail
-
increment
public void increment(double[] d)
Updates the internal state of the statistic to reflect the addition of the new value.- Specified by:
incrementin interfaceStorelessMultivariateStatistic- Parameters:
d- the new value
-
getResult
public double[] getResult()
Returns the current value of the Statistic.- Specified by:
getResultin interfaceStorelessMultivariateStatistic- Returns:
- value of the statistic,
Double.NaNif it has been cleared or just instantiated.
-
getN
public long getN()
Returns the number of values that have been added.- Specified by:
getNin interfaceStorelessMultivariateStatistic- Returns:
- the number of values.
-
clear
public void clear()
Clears the internal state of the statistic.- Specified by:
clearin interfaceStorelessMultivariateStatistic
-
getDimension
public int getDimension()
Returns the dimension of the statistic.- Specified by:
getDimensionin interfaceStorelessMultivariateStatistic- Returns:
- the dimension of the statistic
-
-