Class MultivariateSummaryStatistics

  • All Implemented Interfaces:
    StatisticalMultivariateSummary
    Direct Known Subclasses:
    SynchronizedMultivariateSummaryStatistics

    public class MultivariateSummaryStatistics
    extends Object
    implements StatisticalMultivariateSummary

    Computes summary statistics for a stream of n-tuples added using the 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.

    The StorelessUnivariateStatistic instances used to maintain summary state and compute statistics are configurable via setters. For example, the default implementation for the mean can be overridden by calling setMeanImpl(StorelessUnivariateStatistic[]). Actual parameters to these methods must implement the StorelessUnivariateStatistic interface and configuration must be completed 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 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 SynchronizedMultivariateSummaryStatistics if concurrent access from multiple threads is required.

    Since:
    1.2