View source: R/Matrix_shrink.R
InvCovShrinkBGP16 | R Documentation |
The optimal linear shrinkage estimator of the inverse covariance (precision) matrix that minimizes the Frobenius norm is given by:
\hat{\Pi}_{OLSE} = \hat{\alpha} \hat{\Pi} + \hat{\beta} \Pi_0,
where \hat{\alpha}
and \hat{\beta}
are optimal shrinkage
intensities given in Eq. (4.4) and (4.5) of \insertCiteBGP2016;textualHDShOP.
\hat{\Pi}
is the inverse of the sample covariance matrix (iSCM) and
\Pi_0
is a positive definite symmetric matrix used as the target
matrix (TM), for example, I.
InvCovShrinkBGP16(n, p, TM, iSCM)
n |
the number of observations |
p |
the number of variables (rows of the covariance matrix) |
TM |
the target matrix for the shrinkage estimator |
iSCM |
the inverse of the sample covariance matrix |
a list containing an object of class matrix (S) and the estimated
shrinkage intensities \hat{\alpha}
and \hat{\beta}
.
# Parameter setting
n <- 3e2
c <- 0.7
p <- c*n
mu <- rep(0, p)
Sigma <- RandCovMtrx(p=p)
# Generating observations
X <- t(MASS::mvrnorm(n=n, mu=mu, Sigma=Sigma))
# Estimation
TM <- matrix(0, nrow=p, ncol=p)
diag(TM) <- 1
iSCM <- solve(Sigma_sample_estimator(X))
Sigma_shr <- InvCovShrinkBGP16(n=n, p=p, TM=TM, iSCM=iSCM)
Sigma_shr$S[1:6, 1:6]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.