Title: | Stein's Covariance Estimator |
---|---|
Description: | Estimates a covariance matrix using Stein's isotonized covariance estimator, or a related estimator suggested by Haff. |
Authors: | Brett Naul <[email protected]> |
Maintainer: | Brett Naul <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.1.0 |
Built: | 2025-03-10 05:04:38 UTC |
Source: | https://github.com/cran/stcov |
Stein/Haff's covariance estimator
haff_cov(S, n)
haff_cov(S, n)
S |
Sample covariance matrix |
n |
Number of observations |
Estimated covariance matrix
Haff, L. R. "The Variational Form of Certain Bayes Estimators." The Annals of Statistics 19, no. 3 (1991): 1163-1190.
Lin, S.P. and Perlman, M.D.. "A Monte Carlo comparison of four estimators of a covariance matrix." Multivariate Analysis 6 (1985): 411-429.
Stein, C. "Estimation of a covariance matrix". Rietz Lecture (1975).
p <- 5 n <- 10 S <- rWishart(1, n, diag(p))[,,1] haff_cov(S, n)
p <- 5 n <- 10 S <- rWishart(1, n, diag(p))[,,1] haff_cov(S, n)
Stein/Haff's ordered eigenvalue estimates
haff_eig(l, n)
haff_eig(l, n)
l |
Sample eigenvalues |
n |
Number of observations |
Estimated eigenvalues
p <- 5 n <- 10 S <- rWishart(1, n, diag(p))[,,1] l <- eigen(S)$val haff_eig(l, n)
p <- 5 n <- 10 S <- rWishart(1, n, diag(p))[,,1] l <- eigen(S)$val haff_eig(l, n)
Stein's isotonized covariance estimator
iso_cov(S, n)
iso_cov(S, n)
S |
Sample covariance matrix |
n |
Number of observations |
Estimated covariance matrix
p <- 5 n <- 10 S <- rWishart(1, n, diag(p))[,,1] iso_cov(S, n)
p <- 5 n <- 10 S <- rWishart(1, n, diag(p))[,,1] iso_cov(S, n)
Stein's isotonized eigenvalue estimates
iso_eig(l, n)
iso_eig(l, n)
l |
Sample eigenvalues |
n |
Number of observations |
Estimated eigenvalues
p <- 5 n <- 10 S <- rWishart(1, n, diag(p))[,,1] l <- eigen(S)$val iso_eig(l, n)
p <- 5 n <- 10 S <- rWishart(1, n, diag(p))[,,1] l <- eigen(S)$val iso_eig(l, n)
Stein's raw (unisotonized) eigenvalue estimates
stein_eig(l, n)
stein_eig(l, n)
l |
Sample eigenvalues |
n |
Number of observations |
Estimated eigenvalues
p <- 5 n <- 10 S <- rWishart(1, n, diag(p))[,,1] l <- eigen(S)$val stein_eig(l, n)
p <- 5 n <- 10 S <- rWishart(1, n, diag(p))[,,1] l <- eigen(S)$val stein_eig(l, n)