Computes summary statistics for a stream of n-tuples added using the {@link #addValue(double[]) addValue} method. The data values are not storedin memory, so this class can be used to compute statistics for very large n-tuple streams.
The {@link StorelessUnivariateStatistic} instances used to maintainsummary state and compute statistics are configurable via setters. For example, the default implementation for the mean can be overridden by calling {@link #setMeanImpl(StorelessUnivariateStatistic[])}. Actual parameters to these methods must implement the {@link StorelessUnivariateStatistic} interface and configuration must becompleted before addValue
is called. No configuration is necessary to use the default, commons-math provided implementations.
To compute statistics for a stream of n-tuples, construct a MultivariateStatistics instance with dimension n and then use {@link #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. Use {@link SynchronizedMultivariateSummaryStatistics} if concurrent access from multiplethreads is required.
@since 1.2