View source: R/Matrix_shrink.R
CovShrinkBGP14 | R Documentation |
The optimal linear shrinkage estimator of the covariance matrix that minimizes the Frobenius norm:
\hat{Σ}_{OLSE} = \hat{α} S + \hat{β} Σ_0,
where \hat{α} and \hat{β} are optimal shrinkage intensities
given in Eq. (4.3) and (4.4) of \insertCiteBGP2014;textualHDShOP. S
is the sample covariance matrix (SCM, see Sigma_sample_estimator
) and Σ_0 is a positive definite
symmetric matrix used as the target matrix (TM), for example, \frac{1}{p} I.
CovShrinkBGP14(n, TM, SCM)
n |
sample size. |
TM |
the target matrix for the shrinkage estimator. |
SCM |
sample covariance matrix. |
a list containing an object of class matrix (S) and the estimated shrinkage intensities \hat{α} and \hat{β}.
# 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/p SCM <- Sigma_sample_estimator(X) Sigma_shr <- CovShrinkBGP14(n=n, TM=TM, SCM=SCM) 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.