The functions estimate.lambda and estimate.lambda.var
shrinkage intensities used for correlations and variances used
in cor.shrink and var.shrink, respectively.
optional: weights for each data point - if not specified uniform weights are assumed
(w = rep(1/n, n) with n = nrow(x)).
verbose
report shrinkage intensities (default: TRUE)
Details
var.shrink computes the empirical variance of each considered random variable,
and shrinks them towards their median. The corresponding
shrinkage intensity lambda.var is estimated using
where median(s) denotes the median of the empirical variances (see Opgen-Rhein and Strimmer 2007).
Similarly, cor.shrink computes a shrinkage estimate of the correlation matrix by
shrinking the empirical correlations towards the identity matrix.
In this case the shrinkage intensity lambda equals
Ahdesm"aki suggested (2012) a computationally highly efficient algorithm to compute
the shrinkage intensity estimate for the correlation matrix (see the R code for the implementation).
Value
estimate.lambda and estimate.lambda.var returns a number between 0 and 1.
Author(s)
Juliane Sch"afer,
Rainer Opgen-Rhein, Miika Ahdesm"aki
and Korbinian Strimmer (http://strimmerlab.org).
References
Opgen-Rhein, R., and K. Strimmer. 2007. Accurate ranking of
differentially expressed genes by a distribution-free shrinkage
approach. Statist. Appl. Genet. Mol. Biol. 6:9.
(http://www.bepress.com/sagmb/vol6/iss1/art9/)
Sch"afer, J., and K. Strimmer. 2005. A shrinkage approach to large-scale
covariance estimation and implications for functional genomics.
Statist. Appl. Genet. Mol. Biol. 4:32.
(http://www.bepress.com/sagmb/vol4/iss1/art32/)
See Also
cor.shrink, var.shrink.
Examples
# load corpcor library
library("corpcor")
# small n, large p
p = 100
n = 20
# generate random pxp covariance matrix
sigma = matrix(rnorm(p*p),ncol=p)
sigma = crossprod(sigma)+ diag(rep(0.1, p))
# simulate multinormal data of sample size n
sigsvd = svd(sigma)
Y = t(sigsvd$v %*% (t(sigsvd$u) * sqrt(sigsvd$d)))
X = matrix(rnorm(n * ncol(sigma)), nrow = n) %*% Y
# correlation shrinkage intensity
estimate.lambda(X)
c = cor.shrink(X)
attr(c, "lambda")
# variance shrinkage intensity
estimate.lambda.var(X)
v = var.shrink(X)
attr(v, "lambda.var")