VectorialMean (Apache Commons Math 3.6.1 API)

org.apache.commons.math3.stat.descriptive.moment

## Class VectorialMean

- java.lang.Object
- - org.apache.commons.math3.stat.descriptive.moment.VectorialMean

- All Implemented Interfaces:
    Serializable

      public class VectorialMean
      extends Object
      implements Serializable

  Returns the arithmetic mean of the available vectors.
  Since:
    1.2
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `VectorialMean(int dimension)` Constructs a VectorialMean.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `long` | `getN()` Get the number of vectors in the sample.
    `double[]` | `getResult()` Get the mean vector.
    `int` | `hashCode()`
    `void` | `increment(double[] v)` Add a new vector to the sample.

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

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

- - ### Constructor Detail

    - #### VectorialMean

          public VectorialMean(int dimension)

      Constructs a VectorialMean.
      Parameters:
        `dimension` - vectors dimension

  - ### Method Detail

    - #### increment

          public void increment(double[] v)
                         throws DimensionMismatchException

      Add a new vector to the sample.
      Parameters:
        `v` - vector to add
      Throws:
        `DimensionMismatchException` - if the vector does not have the right dimension

    - #### getResult

          public double[] getResult()

      Get the mean vector.
      Returns:
        mean vector

    - #### getN

          public long getN()

      Get the number of vectors in the sample.
      Returns:
        number of vectors in the sample

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

Copyright © 2003–2016 The Apache Software Foundation. All rights reserved.