public class MultivariateSummaryStatistics extends Object implements StatisticalMultivariateSummary, Serializable
addValue
method. The data values are not stored
in memory, so this class can be used to compute statistics for very large
n-tuple streams.
To compute statistics for a stream of n-tuples, construct a
MultivariateSummaryStatistics
instance with dimension n and then use
addValue(double[])
to add n-tuples. The getXxx
methods where Xxx is a statistic return an array of double
values, where for i = 0,...,n-1
the ith array element
is the value of the given statistic for data range consisting of the ith
element of each of the input n-tuples. For example, if addValue
is
called with actual parameters {0, 1, 2}, then {3, 4, 5} and finally {6, 7, 8},
getSum
will return a three-element array with values {0+3+6, 1+4+7, 2+5+8}
Note: This class is not thread-safe.
Constructor and Description |
---|
MultivariateSummaryStatistics(int dimension)
Construct a MultivariateSummaryStatistics instance for the given
dimension.
|
MultivariateSummaryStatistics(int dimension,
boolean covarianceBiasCorrection)
Construct a MultivariateSummaryStatistics instance for the given
dimension.
|
Modifier and Type | Method and Description |
---|---|
void |
addValue(double[] value)
Add an n-tuple to the data
|
void |
clear()
Resets all statistics and storage.
|
boolean |
equals(Object object)
Returns true iff
object is a MultivariateSummaryStatistics
instance and all statistics have the same values as this. |
RealMatrix |
getCovariance()
Returns the covariance of the available values.
|
int |
getDimension()
Returns the dimension of the data
|
double[] |
getGeometricMean()
Returns an array whose ith entry is the
geometric mean of the ith entries of the arrays
that correspond to each multivariate sample
|
double[] |
getMax()
Returns an array whose ith entry is the
maximum of the ith entries of the arrays
that correspond to each multivariate sample
|
double[] |
getMean()
Returns an array whose ith entry is the
mean of the ith entries of the arrays
that correspond to each multivariate sample
|
double[] |
getMin()
Returns an array whose ith entry is the
minimum of the ith entries of the arrays
that correspond to each multivariate sample
|
long |
getN()
Returns the number of available values
|
double[] |
getStandardDeviation()
Returns an array whose ith entry is the standard deviation of the
ith entries of the arrays that have been added using
addValue(double[]) |
double[] |
getSum()
Returns an array whose ith entry is the
sum of the ith entries of the arrays
that correspond to each multivariate sample
|
double[] |
getSumLog()
Returns an array whose ith entry is the
sum of logs of the ith entries of the arrays
that correspond to each multivariate sample
|
double[] |
getSumSq()
Returns an array whose ith entry is the
sum of squares of the ith entries of the arrays
that correspond to each multivariate sample
|
int |
hashCode()
Returns hash code based on values of statistics
|
String |
toString()
Generates a text report displaying
summary statistics from values that
have been added.
|
public MultivariateSummaryStatistics(int dimension)
The returned instance is not thread-safe.
dimension
- dimension of the datapublic MultivariateSummaryStatistics(int dimension, boolean covarianceBiasCorrection)
The returned instance is not thread-safe.
dimension
- dimension of the datacovarianceBiasCorrection
- if true, the returned instance will compute
the unbiased sample covariance, otherwise the population covariancepublic void addValue(double[] value) throws MathIllegalArgumentException
value
- the n-tuple to addMathIllegalArgumentException
- if the array is null or the length
of the array does not match the one used at constructionpublic void clear()
public int getDimension()
getDimension
in interface StatisticalMultivariateSummary
public long getN()
getN
in interface StatisticalMultivariateSummary
public double[] getSum()
getSum
in interface StatisticalMultivariateSummary
public double[] getSumSq()
getSumSq
in interface StatisticalMultivariateSummary
public double[] getSumLog()
getSumLog
in interface StatisticalMultivariateSummary
public double[] getMean()
getMean
in interface StatisticalMultivariateSummary
public RealMatrix getCovariance()
getCovariance
in interface StatisticalMultivariateSummary
public double[] getMax()
getMax
in interface StatisticalMultivariateSummary
public double[] getMin()
getMin
in interface StatisticalMultivariateSummary
public double[] getGeometricMean()
getGeometricMean
in interface StatisticalMultivariateSummary
public double[] getStandardDeviation()
addValue(double[])
getStandardDeviation
in interface StatisticalMultivariateSummary
public String toString()
public boolean equals(Object object)
object
is a MultivariateSummaryStatistics
instance and all statistics have the same values as this.Copyright © 2016–2019 Hipparchus.org. All rights reserved.