invertCovMatrix: Inverts the covariance matrix for noisy data

View source: R/invertCovMatrix.R

invertCovMatrixR Documentation

Inverts the covariance matrix for noisy data

Description

The covariance matrix of noisy data is inverted. Special care is taken in treating spurious small modes of the matrix, which are likely to arise from too much noise in the data.

Usage

invertCovMatrix(cf, boot.l = 1, boot.samples = FALSE, cov_fn = cov)

Arguments

cf

The data for which the covariance matrix is to be computed. It is expected to be an array or matrix with dimension RxN, where R is the number of observations and N the number of observables.

cf can be either real data or bootstrap data. In the latter case boot.samples=TRUE must be set for proper normalisation of the inverse matrix.

boot.l

If set to a value larger than 1 the data will be blocked with blocklength boot.l before the covariance matrix is computed.

boot.samples

If set to TRUE the data is treated a pseudo data from a bootstrap procedure.

cov_fn

Function that computes the covariance matrix from the given samples.

Details

The inverse covariance matrix is estimated. If the number of observations is too small the procedure described in the reference is used to remove spuriously small eigenvalues of the covariance matrix.

We always keep the sqrt(R) largest eigenvalues exactly and replace the remaining smallest ones by their mean.

Value

Returns the inverse covariance matrix as an object of class matrix.

Author(s)

Carsten Urbach, curbach@gmx.de

References

C.Michael, A.McKerrell, Phys.Rev. D51 (1995) 3745-3750, hep-lat/9412087

See Also

cov, matrix

Examples

X <- array(rnorm(4000), dim=c(1000, 4))
invertCovMatrix(cf=X, boot.samples=TRUE)
M <- invertCovMatrix(cf=X, boot.samples=TRUE) 
M


hadron documentation built on Sept. 9, 2022, 5:06 p.m.