Class VectorialCovariance
- java.lang.Object
-
- org.hipparchus.stat.descriptive.vector.VectorialCovariance
-
- All Implemented Interfaces:
Serializable
public class VectorialCovariance extends Object implements Serializable
Returns the covariance matrix of the available vectors.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description VectorialCovariance(int dimension, boolean isBiasCorrected)Constructs a VectorialCovariance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears the internal state of the Statisticbooleanequals(Object obj)longgetN()Get the number of vectors in the sample.org.hipparchus.linear.RealMatrixgetResult()Get the covariance matrix.inthashCode()voidincrement(double[] v)Add a new vector to the sample.
-
-
-
Constructor Detail
-
VectorialCovariance
public VectorialCovariance(int dimension, boolean isBiasCorrected)Constructs a VectorialCovariance.- Parameters:
dimension- vectors dimensionisBiasCorrected- if true, computed the unbiased sample covariance, otherwise computes the biased population covariance
-
-
Method Detail
-
increment
public void increment(double[] v) throws org.hipparchus.exception.MathIllegalArgumentExceptionAdd a new vector to the sample.- Parameters:
v- vector to add- Throws:
org.hipparchus.exception.MathIllegalArgumentException- if the vector does not have the right dimension
-
getResult
public org.hipparchus.linear.RealMatrix getResult()
Get the covariance matrix.- Returns:
- covariance matrix
-
getN
public long getN()
Get the number of vectors in the sample.- Returns:
- number of vectors in the sample
-
clear
public void clear()
Clears the internal state of the Statistic
-
-