Description Usage Arguments Value References Examples
nlshrink_cov
calls tau_estimate
to estimate
the population eigenvalues. Note that the eigenvalues of the estimated
population covariance matrix are not the same as the non-linear shrinkage
estimates of the population eigenvalues. Theoretical and implementation
details in references.
1 | nlshrink_cov(X, k = 0, method = "nlminb", control = list())
|
X |
A data matrix. |
k |
(Optional) Non-negative integer less than |
method |
(Optional) The optimization routine called in
|
control |
(Optional) A list of control parameters. Must correspond to
the selected optimization method. See |
A numeric positive semi-definite matrix of dimension ncol(X)
.
Ledoit, O. and Wolf, M. (2015). Spectrum estimation: a unified framework for covariance matrix estimation and PCA in large dimensions. Journal of Multivariate Analysis, 139(2)
Ledoit, O. and Wolf, M. (2016). Numerical Implementation of the QuEST function. arXiv:1601.05870 [stat.CO]
1 2 3 4 5 6 7 8 9 10 11 | # generate matrix of uniform random variates
X <- matrix(sapply(1:20, function(b) runif(50, max=b)), nrow = 50, ncol = 20)
Sigma <- diag((1:20)^2/12) # true population covariance matrix
nlshrink_X <- nlshrink_cov(X, k=0) # compute non-linear shrinkage estimate
linshrink_X <- linshrink_cov(X, k=0) # compute linear shrinkage estimate
S <- cov(X) # sample covariance matrix
# compare accuracy of estimators (sum of squared elementwise Euclidean distance)
sum((S-Sigma)^2)
sum((nlshrink_X - Sigma)^2)
sum((linshrink_X - Sigma)^2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.