lshr.cov {dpcid} | R Documentation |
Linear shrinkage estimates of covariance and inverse covariance matrix
Description
Linear shrinkage estimates of covariance and inverse covariance matrix.
Usage
lshr.cov(X,scaling=FALSE)
Arguments
X |
An observed dataset from a specific condition. |
scaling |
a logical flag for scaling variable to have unit variance. Default is FALSE. |
Details
shr_covp returns the optimal linear shrinkage parameter, the linear shrinkage estimates of the covariance and the precision matrix.
Value
shr_cov |
Linear shrinkage estimate of the covariance matrix. |
shr_inv |
Linear shrinkage estimate of the inverse covariance matrix. |
References
Ledoit, O. and M.~Wolf, M. (2004). A well-conditioned estimator for large-dimensional covariance matrices, Journal of Multivariate Analysis, 88, 365–411.
Yu, D., Lee, S. H., Lim, J., Xiao, G., Craddock, R. C., and Biswal, B. B. (2018). Fused Lasso Regression for Identifying Differential Correlations in Brain Connectome Graphs. Statistical Analysis and Data Mining, 11, 203–226.
Examples
library(MASS)
## True precision matrix
omega <- matrix(0,5,5)
omega[1,2] <- omega[1,3] <- omega[1,4] <- 1
omega[2,3] <- omega[3,4] <- 1.5
omega <- t(omega) + omega
diag(omega) <- 3
Sig = solve(omega)
X = mvrnorm(50,rep(0,5),Sig)
lshr.cov(X)