public class SynchronizedMultivariateSummaryStatistics extends MultivariateSummaryStatistics
MultivariateSummaryStatistics that
is safe to use in a multithreaded environment. Multiple threads can safely
operate on a single instance without causing runtime exceptions due to race
conditions. In effect, this implementation makes modification and access
methods atomic operations for a single instance. That is to say, as one
thread is computing a statistic from the instance, no other thread can modify
the instance nor compute another statistic.| Constructor and Description |
|---|
SynchronizedMultivariateSummaryStatistics(int k,
boolean isCovarianceBiasCorrected)
Construct a SynchronizedMultivariateSummaryStatistics instance
|
| 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 matrix of the values that have been added.
|
int |
getDimension()
Returns the dimension of the data
|
StorelessUnivariateStatistic[] |
getGeoMeanImpl()
Returns the currently configured geometric mean implementation
|
double[] |
getGeometricMean()
Returns an array whose ith entry is the geometric mean of the
ith entries of the arrays that have been added using
MultivariateSummaryStatistics.addValue(double[]) |
double[] |
getMax()
Returns an array whose ith entry is the maximum of the
ith entries of the arrays that have been added using
MultivariateSummaryStatistics.addValue(double[]) |
StorelessUnivariateStatistic[] |
getMaxImpl()
Returns the currently configured maximum implementation
|
double[] |
getMean()
Returns an array whose ith entry is the mean of the
ith entries of the arrays that have been added using
MultivariateSummaryStatistics.addValue(double[]) |
StorelessUnivariateStatistic[] |
getMeanImpl()
Returns the currently configured mean implementation
|
double[] |
getMin()
Returns an array whose ith entry is the minimum of the
ith entries of the arrays that have been added using
MultivariateSummaryStatistics.addValue(double[]) |
StorelessUnivariateStatistic[] |
getMinImpl()
Returns the currently configured minimum implementation
|
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
MultivariateSummaryStatistics.addValue(double[]) |
double[] |
getSum()
Returns an array whose ith entry is the sum of the
ith entries of the arrays that have been added using
MultivariateSummaryStatistics.addValue(double[]) |
StorelessUnivariateStatistic[] |
getSumImpl()
Returns the currently configured Sum implementation
|
double[] |
getSumLog()
Returns an array whose ith entry is the sum of logs of the
ith entries of the arrays that have been added using
MultivariateSummaryStatistics.addValue(double[]) |
StorelessUnivariateStatistic[] |
getSumLogImpl()
Returns the currently configured sum of logs implementation
|
double[] |
getSumSq()
Returns an array whose ith entry is the sum of squares of the
ith entries of the arrays that have been added using
MultivariateSummaryStatistics.addValue(double[]) |
StorelessUnivariateStatistic[] |
getSumsqImpl()
Returns the currently configured sum of squares implementation
|
int |
hashCode()
Returns hash code based on values of statistics
|
void |
setGeoMeanImpl(StorelessUnivariateStatistic[] geoMeanImpl)
Sets the implementation for the geometric mean.
|
void |
setMaxImpl(StorelessUnivariateStatistic[] maxImpl)
Sets the implementation for the maximum.
|
void |
setMeanImpl(StorelessUnivariateStatistic[] meanImpl)
Sets the implementation for the mean.
|
void |
setMinImpl(StorelessUnivariateStatistic[] minImpl)
Sets the implementation for the minimum.
|
void |
setSumImpl(StorelessUnivariateStatistic[] sumImpl)
Sets the implementation for the Sum.
|
void |
setSumLogImpl(StorelessUnivariateStatistic[] sumLogImpl)
Sets the implementation for the sum of logs.
|
void |
setSumsqImpl(StorelessUnivariateStatistic[] sumsqImpl)
Sets the implementation for the sum of squares.
|
String |
toString()
Generates a text report displaying
summary statistics from values that
have been added.
|
public SynchronizedMultivariateSummaryStatistics(int k,
boolean isCovarianceBiasCorrected)
k - dimension of the dataisCovarianceBiasCorrected - if true, the unbiased sample
covariance is computed, otherwise the biased population covariance
is computedpublic void addValue(double[] value)
throws DimensionMismatchException
addValue in class MultivariateSummaryStatisticsvalue - the n-tuple to addDimensionMismatchException - if the length of the array
does not match the one used at constructionpublic int getDimension()
getDimension in interface StatisticalMultivariateSummarygetDimension in class MultivariateSummaryStatisticspublic long getN()
getN in interface StatisticalMultivariateSummarygetN in class MultivariateSummaryStatisticspublic double[] getSum()
MultivariateSummaryStatistics.addValue(double[])getSum in interface StatisticalMultivariateSummarygetSum in class MultivariateSummaryStatisticspublic double[] getSumSq()
MultivariateSummaryStatistics.addValue(double[])getSumSq in interface StatisticalMultivariateSummarygetSumSq in class MultivariateSummaryStatisticspublic double[] getSumLog()
MultivariateSummaryStatistics.addValue(double[])getSumLog in interface StatisticalMultivariateSummarygetSumLog in class MultivariateSummaryStatisticspublic double[] getMean()
MultivariateSummaryStatistics.addValue(double[])getMean in interface StatisticalMultivariateSummarygetMean in class MultivariateSummaryStatisticspublic double[] getStandardDeviation()
MultivariateSummaryStatistics.addValue(double[])getStandardDeviation in interface StatisticalMultivariateSummarygetStandardDeviation in class MultivariateSummaryStatisticspublic RealMatrix getCovariance()
getCovariance in interface StatisticalMultivariateSummarygetCovariance in class MultivariateSummaryStatisticspublic double[] getMax()
MultivariateSummaryStatistics.addValue(double[])getMax in interface StatisticalMultivariateSummarygetMax in class MultivariateSummaryStatisticspublic double[] getMin()
MultivariateSummaryStatistics.addValue(double[])getMin in interface StatisticalMultivariateSummarygetMin in class MultivariateSummaryStatisticspublic double[] getGeometricMean()
MultivariateSummaryStatistics.addValue(double[])getGeometricMean in interface StatisticalMultivariateSummarygetGeometricMean in class MultivariateSummaryStatisticspublic String toString()
toString in class MultivariateSummaryStatisticspublic void clear()
clear in class MultivariateSummaryStatisticspublic boolean equals(Object object)
object is a MultivariateSummaryStatistics
instance and all statistics have the same values as this.equals in class MultivariateSummaryStatisticsobject - the object to test equality against.public int hashCode()
hashCode in class MultivariateSummaryStatisticspublic StorelessUnivariateStatistic[] getSumImpl()
getSumImpl in class MultivariateSummaryStatisticspublic void setSumImpl(StorelessUnivariateStatistic[] sumImpl) throws DimensionMismatchException, MathIllegalStateException
Sets the implementation for the Sum.
This method must be activated before any data has been added - i.e.,
before addValue has been used to add data;
otherwise an IllegalStateException will be thrown.
setSumImpl in class MultivariateSummaryStatisticssumImpl - the StorelessUnivariateStatistic instance to use
for computing the SumDimensionMismatchException - if the array dimension
does not match the one used at constructionMathIllegalStateException - if data has already been added
(i.e if n > 0)public StorelessUnivariateStatistic[] getSumsqImpl()
getSumsqImpl in class MultivariateSummaryStatisticspublic void setSumsqImpl(StorelessUnivariateStatistic[] sumsqImpl) throws DimensionMismatchException, MathIllegalStateException
Sets the implementation for the sum of squares.
This method must be activated before any data has been added - i.e.,
before addValue has been used to add data;
otherwise an IllegalStateException will be thrown.
setSumsqImpl in class MultivariateSummaryStatisticssumsqImpl - the StorelessUnivariateStatistic instance to use
for computing the sum of squaresDimensionMismatchException - if the array dimension
does not match the one used at constructionMathIllegalStateException - if data has already been added
(i.e if n > 0)public StorelessUnivariateStatistic[] getMinImpl()
getMinImpl in class MultivariateSummaryStatisticspublic void setMinImpl(StorelessUnivariateStatistic[] minImpl) throws DimensionMismatchException, MathIllegalStateException
Sets the implementation for the minimum.
This method must be activated before any data has been added - i.e.,
before addValue has been used to add data;
otherwise an IllegalStateException will be thrown.
setMinImpl in class MultivariateSummaryStatisticsminImpl - the StorelessUnivariateStatistic instance to use
for computing the minimumDimensionMismatchException - if the array dimension
does not match the one used at constructionMathIllegalStateException - if data has already been added
(i.e if n > 0)public StorelessUnivariateStatistic[] getMaxImpl()
getMaxImpl in class MultivariateSummaryStatisticspublic void setMaxImpl(StorelessUnivariateStatistic[] maxImpl) throws DimensionMismatchException, MathIllegalStateException
Sets the implementation for the maximum.
This method must be activated before any data has been added - i.e.,
before addValue has been used to add data;
otherwise an IllegalStateException will be thrown.
setMaxImpl in class MultivariateSummaryStatisticsmaxImpl - the StorelessUnivariateStatistic instance to use
for computing the maximumDimensionMismatchException - if the array dimension
does not match the one used at constructionMathIllegalStateException - if data has already been added
(i.e if n > 0)public StorelessUnivariateStatistic[] getSumLogImpl()
getSumLogImpl in class MultivariateSummaryStatisticspublic void setSumLogImpl(StorelessUnivariateStatistic[] sumLogImpl) throws DimensionMismatchException, MathIllegalStateException
Sets the implementation for the sum of logs.
This method must be activated before any data has been added - i.e.,
before addValue has been used to add data;
otherwise an IllegalStateException will be thrown.
setSumLogImpl in class MultivariateSummaryStatisticssumLogImpl - the StorelessUnivariateStatistic instance to use
for computing the log sumDimensionMismatchException - if the array dimension
does not match the one used at constructionMathIllegalStateException - if data has already been added
(i.e if n > 0)public StorelessUnivariateStatistic[] getGeoMeanImpl()
getGeoMeanImpl in class MultivariateSummaryStatisticspublic void setGeoMeanImpl(StorelessUnivariateStatistic[] geoMeanImpl) throws DimensionMismatchException, MathIllegalStateException
Sets the implementation for the geometric mean.
This method must be activated before any data has been added - i.e.,
before addValue has been used to add data;
otherwise an IllegalStateException will be thrown.
setGeoMeanImpl in class MultivariateSummaryStatisticsgeoMeanImpl - the StorelessUnivariateStatistic instance to use
for computing the geometric meanDimensionMismatchException - if the array dimension
does not match the one used at constructionMathIllegalStateException - if data has already been added
(i.e if n > 0)public StorelessUnivariateStatistic[] getMeanImpl()
getMeanImpl in class MultivariateSummaryStatisticspublic void setMeanImpl(StorelessUnivariateStatistic[] meanImpl) throws DimensionMismatchException, MathIllegalStateException
Sets the implementation for the mean.
This method must be activated before any data has been added - i.e.,
before addValue has been used to add data;
otherwise an IllegalStateException will be thrown.
setMeanImpl in class MultivariateSummaryStatisticsmeanImpl - the StorelessUnivariateStatistic instance to use
for computing the meanDimensionMismatchException - if the array dimension
does not match the one used at constructionMathIllegalStateException - if data has already been added
(i.e if n > 0)Copyright © 2003–2016 The Apache Software Foundation. All rights reserved.