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 independent
StorelessUnivariateStatistic
instance
for each component of a vector.- See Also:
-
Constructor Summary
ConstructorDescriptionVectorialStorelessStatistic
(int dimension, StorelessUnivariateStatistic univariateStatistic) Create a new VectorialStorelessStatistic with the given dimension and statistic implementation. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears the internal state of the statistic.boolean
int
Returns the dimension of the statistic.long
getN()
Returns the number of values that have been added.double[]
Returns the current value of the Statistic.int
hashCode()
void
increment
(double[] d) Updates the internal state of the statistic to reflect the addition of the new value.
-
Constructor Details
-
VectorialStorelessStatistic
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 Details
-
increment
public void increment(double[] d) Updates the internal state of the statistic to reflect the addition of the new value.- Specified by:
increment
in interfaceStorelessMultivariateStatistic
- Parameters:
d
- the new value
-
getResult
public double[] getResult()Returns the current value of the Statistic.- Specified by:
getResult
in interfaceStorelessMultivariateStatistic
- Returns:
- value of the statistic,
Double.NaN
if it has been cleared or just instantiated.
-
getN
public long getN()Returns the number of values that have been added.- Specified by:
getN
in interfaceStorelessMultivariateStatistic
- Returns:
- the number of values.
-
clear
public void clear()Clears the internal state of the statistic.- Specified by:
clear
in interfaceStorelessMultivariateStatistic
-
getDimension
public int getDimension()Returns the dimension of the statistic.- Specified by:
getDimension
in interfaceStorelessMultivariateStatistic
- Returns:
- the dimension of the statistic
-
hashCode
public int hashCode() -
equals
-