Learn R Programming

CovTools (version 0.2.1)

CovEst: Estimating Covariance Matrix

Description

It compiles several popular methods of inferring covariance structure from observed data. Several principles or assumed structures and corresponding estimation techniques are included, such as sparse covariance estimation (Bickel08, Cai11), soft thresholding (Donoho95), near positive definiteness (Qi06), and so on.

Usage

CovEst(X, method = c("Bickel08", "Cai11", "Donoho95", "Fan13", "Qi06"),
  param = 1)

Arguments

X

an (n-by-p) matrix where each row is an observation from the first dataset.

method

a name of estimation method.

param

a parameter value >= 0.

Value

a named list containing:

S

a (p-by-p) covariance matrix estimate.

References

[Bickel08] Bickel, P. and Levina, E. (2008) Covariance Regularization by Thresholding. The Annals of Statistics, Vol.36(6):2577-2604.

[Cai11] Cai, T. and Liu, W. (2011) Adaptive Thresholding for Sparse Covariance Matrix Estimation. Journal of the American Statistical Association, Vol.106:672-684.

[Donoho95] Donoho, D. et al. (1995) Wavelet Shrinkage: Asymptopia? Journal of the Royal Statistical Society Series B, Vol.57(2):301-369.

[Fan13] Fan. J. et al. (2013) Large covariance estimation by thresholding principal orthogonal complements. Journal of the Royal Statistical Society Series B, Vol.75(4):603-680.

[Qi06] Qi, H. and Sun, D. (2006) A Quadratically Convergent Newton Method for Computing the Nearest Correlation Matrix. SIAM J.Matrix Anal.& Appl., Vol.28(2):360-385.

Examples

Run this code
# NOT RUN {
## generate data from multivariate normal with Identity covariance.
data = mvtnorm::rmvnorm(100, sigma=diag(10))

## run estimation
out1 = CovEst(data, method="Bickel08")
out2 = CovEst(data, method="Cai11")
out3 = CovEst(data, method="Donoho95")
out4 = CovEst(data, method="Fan13")
out5 = CovEst(data, method="Qi06")

## Visualize
par(mfrow=c(2,3))
image(pracma::flipud(diag(10)),main="Original Covariance")
image(pracma::flipud(out1$S), main="Bickel08")
image(pracma::flipud(out2$S), main="Cai11")
image(pracma::flipud(out3$S), main="Donoho95")
image(pracma::flipud(out4$S), main="Fan13")
image(pracma::flipud(out5$S), main="Qi06")

# }

Run the code above in your browser using DataLab