Description Usage Arguments Value References Examples
Implements a Bayesian Gaussian conjugate (GC) single target linear shrinkage covariance estimator as in Gray et al. (2018) and Hannart and Naveau (2014). It is most useful when the observed data is high-dimensional (more variables than observations) and allows a user-specified target matrix.
1 2 3 4 5 6 7 8 9 10 |
X |
|
target |
|
var |
|
cor |
|
alpha |
|
plots |
|
weighted |
|
ext.data |
|
list
–
matrix
– the estimated covariance matrix.
numeric
– the value of alpha that maximises the
log-marginal likelihood.
matrix
– the target matrix used for shrinkage.
numeric
– the values of the log marginal
likelihood for each (target, alpha) pair.
Gray, H., Leday, G.G., Vallejos, C.A. and Richardson, S., 2018. Shrinkage estimation of large covariance matrices using multiple shrinkage targets. arXiv preprint.
Hannart, A. and Naveau, P., 2014. Estimating high dimensional covariance matrices: A new look at the Gaussian conjugate framework. Journal of Multivariate Analysis, 131, pp.149-162. doi.
1 2 3 4 5 6 7 8 | set.seed(102)
X <- matrix(rnorm(50), 10, 5) # p=10, n=5, identity covariance
X <- t(scale(t(X), center=TRUE, scale=FALSE)) # mean 0
t1 <- gcShrink(X, var=1, cor=1) # apply shrinkage and view likelihood for T1
t2 <- gcShrink(X, var=2, cor=2) # apply shrinkage and view likelihood for T2
norm(t1$sigmahat-diag(10), type="F") # calculate loss
norm(t2$sigmahat-diag(10), type="F") # calculate loss
# one target clearly better but how to choose this a priori?
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.