com.metsci.glimpse.util.math.stat
Class StatCollectorNDim

java.lang.Object
  extended by com.metsci.glimpse.util.math.stat.StatCollectorNDim

public class StatCollectorNDim
extends java.lang.Object

Author:
moskowitz

Constructor Summary
StatCollectorNDim(int dim)
           
 
Method Summary
 void addElement(double[] x)
           
 void addElement(double[] x, double weight)
           
 double getCount()
           
 double[][] getCovariance()
           
 double[] getMean()
           
 int getNumSamples()
           
 double[][] getTwoDimAxes()
          This routine will return the principal axes for the distribution in the two dimensional case.
 double[][] getTwoDimAxesLenient()
          This routine will return the principal axes for the distribution in the two dimensional case.
 double[] getTwoDimUnitCovarianceEllipse()
          For the two dimensional case, this routine will return the parameters defining the unit covariance ellipse for a Bivariate Gaussian distribution centered about the mean with sigmaX, sigmaY, and correlation estimated by this stat collector.
 double[] getTwoDimUnitCovarianceEllipseLenient()
          This routine will return the parameters defining the unit covariance ellipse for a Bivariate Gaussian distribution centered about the mean with sigmaX, sigmaY, and correlation estimated by this stat collector.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatCollectorNDim

public StatCollectorNDim(int dim)
Method Detail

addElement

public void addElement(double[] x)

addElement

public void addElement(double[] x,
                       double weight)

getCount

public double getCount()

getNumSamples

public int getNumSamples()

getMean

public double[] getMean()

getCovariance

public double[][] getCovariance()

getTwoDimUnitCovarianceEllipse

public double[] getTwoDimUnitCovarianceEllipse()
For the two dimensional case, this routine will return the parameters defining the unit covariance ellipse for a Bivariate Gaussian distribution centered about the mean with sigmaX, sigmaY, and correlation estimated by this stat collector. The unit covariance ellipse is a constant probability contour enclosing a 1-sigma area. Note that the ellipse is based on an assumption that the distribution is approximately a Bivariate Gaussian. If this is not the case then its use may be inappropriate.

Returns:
array of size 3: {semi-major axis length, semi-minor axis length, orientation} of 1-sigma covariance ellipse

getTwoDimUnitCovarianceEllipseLenient

public double[] getTwoDimUnitCovarianceEllipseLenient()
This routine will return the parameters defining the unit covariance ellipse for a Bivariate Gaussian distribution centered about the mean with sigmaX, sigmaY, and correlation estimated by this stat collector. This 'lenient' version does not check for exactly a two dimensional case but simply uses the first two dimensions.

Returns:
array of size 3: {semi-major axis length, semi-minor axis length, orientation} of 1-sigma covariance ellipse

getTwoDimAxes

public double[][] getTwoDimAxes()
This routine will return the principal axes for the distribution in the two dimensional case. Obviously, it would be useful to have a method for the general case, but that is not currently implemented. It will require a general eigenvector routine. Note that the three dimensional case will also not be too difficult.


getTwoDimAxesLenient

public double[][] getTwoDimAxesLenient()
This routine will return the principal axes for the distribution in the two dimensional case. This 'lenient' version does not check for exactly a two dimensional case but simply uses the first two dimensions.


main

public static void main(java.lang.String[] args)


Copyright © 2012 Metron, Inc.. All Rights Reserved.