edu.northwestern.at.utils.math.statistics

## Class Accumulator

- java.lang.Object
- - edu.northwestern.at.utils.math.statistics.Accumulator

-     public class Accumulator
      extends java.lang.Object

  Accumulate basic statistical information for a set of doubles.

  Accumulates the following quantities.

  - Count
  - Maximum
  - Minimum
  - Mean
  - Sum of squares

  Returns these values as well as the variance and standard deviation.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected long` | `count` Count of elements.
    `protected double` | `maximum` Maximum of elements.
    `protected double` | `mean` Mean of elements.
    `protected double` | `minimum` Minimum of elements.
    `protected double` | `sumOfSquares` Sum of squares of elements.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Accumulator()` Create an empty accumulator.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addValue(double value)` Add a value to the accumulation.
    `void` | `addValues(java.util.Collection<java.lang.Double> values)` Add collection of values to the accumulation.
    `void` | `addValues(double[] values)` Add array of values to the accumulation.
    `long` | `getCount()` Return count.
    `double` | `getMaximum()` Return maximum.
    `double` | `getMean()` Return mean.
    `double` | `getMinimum()` Return minimum.
    `double` | `getStandardDeviation()` Return standard deviation.
    `double` | `getSumOfSquares()` Return sum of squares.
    `double` | `getVariance()` Return variance.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### count

          protected long count

      Count of elements.

    - #### mean

          protected double mean

      Mean of elements.

    - #### sumOfSquares

          protected double sumOfSquares

      Sum of squares of elements.

    - #### minimum

          protected double minimum

      Minimum of elements.

    - #### maximum

          protected double maximum

      Maximum of elements.

  - ### Constructor Detail

    - #### Accumulator

          public Accumulator()

      Create an empty accumulator.

  - ### Method Detail

    - #### addValue

          public void addValue(double value)

      Add a value to the accumulation.
      Parameters:
        `value` - The value to add.

    - #### addValues

          public void addValues(java.util.Collection<java.lang.Double> values)

      Add collection of values to the accumulation.
      Parameters:
        `values` - The collection of values to add.

    - #### addValues

          public void addValues(double[] values)

      Add array of values to the accumulation.
      Parameters:
        `values` - The collection of values to add.

    - #### getCount

          public long getCount()

      Return count.
      Returns:
        Count of elements as a long.

    - #### getMaximum

          public double getMaximum()

      Return maximum.
      Returns:
        Maximum of elements.

    - #### getMinimum

          public double getMinimum()

      Return minimum.
      Returns:
        Minimum of elements.

    - #### getMean

          public double getMean()

      Return mean.
      Returns:
        Mean of elements.

    - #### getVariance

          public double getVariance()

      Return variance.
      Returns:
        Variance of elements.

        The variance is the sum of squares divided by the number of values.

    - #### getStandardDeviation

          public double getStandardDeviation()

      Return standard deviation.
      Returns:
        Standard deviation of elements.

        The standard deviation is the square root of the variance.

    - #### getSumOfSquares

          public double getSumOfSquares()

      Return sum of squares.
      Returns:
        Sum of squares of elements.