Documentation of 'org.apache.commons.math3.stat.correlation.StorelessCovariance' Java class
StorelessCovariance
org.apache.commons.math3.stat.correlation

Class StorelessCovariance



  • public class StorelessCovariance
    extends Covariance
    Covariance implementation that does not require input data to be stored in memory. The size of the covariance matrix is specified in the constructor. Specific elements of the matrix are incrementally updated with calls to incrementRow() or increment Covariance().

    This class is based on a paper written by Philippe Pébay: Formulas for Robust, One-Pass Parallel Computation of Covariances and Arbitrary-Order Statistical Moments, 2008, Technical Report SAND2008-6212, Sandia National Laboratories.

    Note: the underlying covariance matrix is symmetric, thus only the upper triangular part of the matrix is stored and updated each increment.

    Since:
    3.0
    • Constructor Summary

      Constructors 
      Constructor and Description
      StorelessCovariance(int dim)
      Create a bias corrected covariance matrix with a given dimension.
      StorelessCovariance(int dim, boolean biasCorrected)
      Create a covariance matrix with a given number of rows and columns and the indicated bias correction.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void append(StorelessCovariance sc)
      Appends sc to this, effectively aggregating the computations in sc with this.
      double getCovariance(int xIndex, int yIndex)
      Get the covariance for an individual element of the covariance matrix.
      RealMatrix getCovarianceMatrix()
      Returns the covariance matrix
      double[][] getData()
      Return the covariance matrix as two-dimensional array.
      int getN()
      This Covariance method is not supported by a StorelessCovariance, since the number of bivariate observations does not have to be the same for different pairs of covariates - i.e., N as defined in Covariance.getN() is undefined.
      void increment(double[] data)
      Increment the covariance matrix with one row of data.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StorelessCovariance

        public StorelessCovariance(int dim)
        Create a bias corrected covariance matrix with a given dimension.
        Parameters:
        dim - the dimension of the square covariance matrix
      • StorelessCovariance

        public StorelessCovariance(int dim,
                                   boolean biasCorrected)
        Create a covariance matrix with a given number of rows and columns and the indicated bias correction.
        Parameters:
        dim - the dimension of the covariance matrix
        biasCorrected - if true the covariance estimate is corrected for bias, i.e. n-1 in the denominator, otherwise there is no bias correction, i.e. n in the denominator.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.