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
Version:
$Id: StorelessCovariance.java 1519851 2013-09-03 21:16:35Z tn$
• ### 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.