linshrink_cov {nlshrink} | R Documentation |
Linear-shrinkage estimator of population covariance matrix.
Description
The linear shrinkage estimator of the population covariance matrix is computed by shrinking the sample covariance matrix towards the identity matrix based on a shrinkage factor. Note that the eigenvalues of the population covariance matrix estimate are not the same as the linear shrinkage estimates of population eigenvalues. Details in referenced publication.
Usage
linshrink_cov(X, k = 0)
Arguments
X |
A data matrix. |
k |
(Optional) Non-negative integer less than |
Value
Population covariance matrix estimate. A square positive
semi-definite matrix of dimension ncol(X)
.
References
Ledoit, O. and Wolf, M. (2004). A well-conditioned estimator for large-dimensional covariance matrices. Journal of Multivariate Analysis, 88(2)
Examples
linshrink_cov(X = matrix(rnorm(1e4, mean = 5), nrow = 100, ncol = 100)) # 1 class; will be centered
linshrink_cov(X = matrix(rnorm(1e4), nrow = 100, ncol = 100), k = 1) # 1 class; no centering