Description Usage Arguments Details Value References
For a sample matrix, x
, we compute the sample covariance matrix as the
maximum likelihood estimator (MLE) of the population covariance matrix and
shrink it towards its diagonal.
1 | cov_shrink_diag(x, gamma = 1)
|
x |
data matrix with |
gamma |
the shrinkage parameter. Must be between 0 and 1, inclusively. By default, the shrinkage parameter is 1, which simply yields the MLE. |
Let \widehat{Σ} be the MLE of the covariance matrix Σ. Then, we shrink the MLE towards its diagonal by computing
\widehat{Σ}(γ) = γ \widehat{Σ} + (1 - γ) \widehat{Σ} \circ I_p,
where \circ denotes the Hadamard product and γ \in [0,1].
For γ < 1, the resulting shrunken covariance matrix estimator is positive definite, and for γ = 1, we simply have the MLE, which can potentially be positive semidefinite (singular).
The estimator given here is based on Section 18.3.1 of the Hastie et al. (2008) text.
shrunken sample covariance matrix of size p \times p
Hastie, T., Tibshirani, R., and Friedman, J. (2008), "The Elements of Statistical Learning: Data Mining, Inference, and Prediction," 2nd edition. http://web.stanford.edu/~hastie/ElemStatLearn/
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.