|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.math.stat.descriptive.MultivariateSummaryStatistics
org.apache.commons.math.stat.descriptive.SynchronizedMultivariateSummaryStatistics
public class SynchronizedMultivariateSummaryStatistics
Implementation of
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 Summary | |
|---|---|
SynchronizedMultivariateSummaryStatistics(int k,
boolean isCovarianceBiasCorrected)
Construct a SynchronizedMultivariateSummaryStatistics instance |
|
| Method Summary | |
|---|---|
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 SummaryStatistics
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
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 computed| Method Detail |
|---|
public void addValue(double[] value)
throws DimensionMismatchException
addValue in class MultivariateSummaryStatisticsvalue - the n-tuple to add
DimensionMismatchException - 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 SummaryStatistics
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 MultivariateSummaryStatistics
public void setSumImpl(StorelessUnivariateStatistic[] sumImpl)
throws DimensionMismatchException
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 Sum
DimensionMismatchException - if the array dimension
does not match the one used at constructionpublic StorelessUnivariateStatistic[] getSumsqImpl()
getSumsqImpl in class MultivariateSummaryStatistics
public void setSumsqImpl(StorelessUnivariateStatistic[] sumsqImpl)
throws DimensionMismatchException
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 squares
DimensionMismatchException - if the array dimension
does not match the one used at constructionpublic StorelessUnivariateStatistic[] getMinImpl()
getMinImpl in class MultivariateSummaryStatistics
public void setMinImpl(StorelessUnivariateStatistic[] minImpl)
throws DimensionMismatchException
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 minimum
DimensionMismatchException - if the array dimension
does not match the one used at constructionpublic StorelessUnivariateStatistic[] getMaxImpl()
getMaxImpl in class MultivariateSummaryStatistics
public void setMaxImpl(StorelessUnivariateStatistic[] maxImpl)
throws DimensionMismatchException
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 maximum
DimensionMismatchException - if the array dimension
does not match the one used at constructionpublic StorelessUnivariateStatistic[] getSumLogImpl()
getSumLogImpl in class MultivariateSummaryStatistics
public void setSumLogImpl(StorelessUnivariateStatistic[] sumLogImpl)
throws DimensionMismatchException
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 sum
DimensionMismatchException - if the array dimension
does not match the one used at constructionpublic StorelessUnivariateStatistic[] getGeoMeanImpl()
getGeoMeanImpl in class MultivariateSummaryStatistics
public void setGeoMeanImpl(StorelessUnivariateStatistic[] geoMeanImpl)
throws DimensionMismatchException
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 mean
DimensionMismatchException - if the array dimension
does not match the one used at constructionpublic StorelessUnivariateStatistic[] getMeanImpl()
getMeanImpl in class MultivariateSummaryStatistics
public void setMeanImpl(StorelessUnivariateStatistic[] meanImpl)
throws DimensionMismatchException
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 mean
DimensionMismatchException - if the array dimension
does not match the one used at construction
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||