Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.commons.math.stat.descriptive
Interface StorelessUnivariateStatistic

All Superinterfaces:
  UnivariateStatistic

All Known Implementing Classes:
  AbstractStorelessUnivariateStatistic, FirstMoment, FourthMoment, GeometricMean, Kurtosis, Max, Mean, Min, Product, SecondMoment, Skewness, StandardDeviation, Sum, SumOfLogs, SumOfSquares, ThirdMoment, Variance

    public interface StorelessUnivariateStatistic

extends UnivariateStatistic

Extends the definition of `UnivariateStatistic` with `increment(double)` and `incrementAll(double[])` methods for adding values and updating internal state.

This interface is designed to be used for calculating statistics that can be computed in one pass through the data without storing the full array of sample values.

Version:
  $Revision: 811685 $ $Date: 2009-09-05 13:36:48 -0400 (Sat, 05 Sep 2009) $

Method Summary
`void` | `clear()` Clears the internal state of the Statistic
`StorelessUnivariateStatistic` | `copy()` Returns a copy of the statistic with the same internal state.
`long` | `getN()` Returns the number of values that have been added.
`double` | `getResult()` Returns the current value of the Statistic.
`void` | `increment(double d)` Updates the internal state of the statistic to reflect the addition of the new value.
`void` | `incrementAll(double[] values)` Updates the internal state of the statistic to reflect addition of all values in the values array.
`void` | `incrementAll(double[] values, int start, int length)` Updates the internal state of the statistic to reflect addition of the values in the designated portion of the values array.

Methods inherited from interface org.apache.commons.math.stat.descriptive.UnivariateStatistic
`evaluate, evaluate`

Method Detail

### increment

    void increment(double d)

  Updates the internal state of the statistic to reflect the addition of the new value.

  Parameters:
    `d` - the new value.

### incrementAll

    void incrementAll(double[] values)

  Updates the internal state of the statistic to reflect addition of all values in the values array. Does not clear the statistic first -- i.e., the values are added incrementally to the dataset.

  Parameters:
    `values` - array holding the new values to add
  Throws:
    `java.lang.IllegalArgumentException` - if the array is null

### incrementAll

    void incrementAll(double[] values,
                      int start,
                      int length)

  Updates the internal state of the statistic to reflect addition of the values in the designated portion of the values array. Does not clear the statistic first -- i.e., the values are added incrementally to the dataset.

  Parameters:
    `values` - array holding the new values to add
    `start` - the array index of the first value to add
    `length` - the number of elements to add
  Throws:
    `java.lang.IllegalArgumentException` - if the array is null or the index

### getResult

    double getResult()

  Returns the current value of the Statistic.

  Returns:
    value of the statistic, `Double.NaN` if it has been cleared or just instantiated.

### getN

    long getN()

  Returns the number of values that have been added.

  Returns:
    the number of values.

### clear

    void clear()

  Clears the internal state of the Statistic

### copy

    StorelessUnivariateStatistic copy()

  Returns a copy of the statistic with the same internal state.

  Specified by:
    `copy` in interface `UnivariateStatistic`
  Returns:
    a copy of the statistic

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 2003-2011 Apache Software Foundation