Class StorelessCovariance

java.lang.Object
org.hipparchus.stat.correlation.Covariance
org.hipparchus.stat.correlation.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.

  • Constructor Details

    • 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.
  • Method Details