Learn R Programming

CovTools (version 0.2.1)

CovEst.auto: Estimating Covariance Matrix with automatic tuning

Description

In this variant of CovEst, we implemented automatic parameter tuning scheme applying 2-fold cross validation repeatedly and choosing the minimal one with the least discrepancy.

Usage

CovEst.auto(X, method = c("Bickel08", "Cai11", "Donoho95", "Fan13", "Qi06"),
  opt = list(nCV = 10, nsearch = 10), parallel = FALSE)

Arguments

X

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

method

a name of estimation method.

opt

a list of options containing following fields:

nCV

the number for repetitions for 2-fold random cross validation.

nsearch

the number of trials on range of regularization parameters.

parallel

a logical; TRUE to use half of available cores, FALSE to do every computation sequentially.

Value

a named list containing:

S

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

CV

a dataframe containing vector of tested threshold values(thr) and corresponding cross validation scores(CVscore).

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.

See Also

CovEst

Examples

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

## run automatic estimation
sopt = list(nCV=2,nsearch=3) # common option
out1 = CovEst.auto(data, method="Bickel08", opt=sopt)
out2 = CovEst.auto(data, method="Cai11",    opt=sopt)

## Visualize
par(mfrow=c(1,3))
image(pracma::flipud(diag(5)),main="Original Covariance")
image(pracma::flipud(out1$S), main="Bickel08")
image(pracma::flipud(out2$S), main="Cai11")

# }

Run the code above in your browser using DataLab