org.apache.commons.math.stat.descriptive.moment
Class VectorialMean

java.lang.Object
  extended by org.apache.commons.math.stat.descriptive.moment.VectorialMean
All Implemented Interfaces:
java.io.Serializable

public class VectorialMean
extends java.lang.Object
implements java.io.Serializable

Returns the arithmetic mean of the available vectors.

Since:
1.2
Version:
$Revision: 619928 $ $Date: 2008-02-08 09:19:17 -0700 (Fri, 08 Feb 2008) $
See Also:
Serialized Form

Constructor Summary
VectorialMean(int dimension)
          Constructs a VectorialMean.
 
Method Summary
 long getN()
          Get the number of vectors in the sample.
 double[] getResult()
          Get the mean vector.
 void increment(double[] v)
          Add a new vector to the sample.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, 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


Copyright © 2003-2008 The Apache Software Foundation. All Rights Reserved.