invertCovMatrix: Inverts the covariance matrix for noisy data

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/invertCovMatrix.R

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

1
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

1
2
3
4
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 Jan. 13, 2021, 8 a.m.