View source: R/lambda.TargetD.R
lambda.TargetD | R Documentation |
Estimation of a weighted average of a sample covariance (correlation) matrix and an identity matrix.
lambda.TargetD(x)
x |
Centered data for covariance shrinkage and standardized data for correlation shrinkage. |
An analytical approach to the estimate ridge parameter.
The estimates of shrinkage intensity.
Min Jin Ha
Schafer, J. and Strimmer, K. (2005). A shrinkage approach to large-scale covariance matrix estimation and implications for functional genomics. Statistical Applications in Genetics and Molecular Biology, 4, 32.
Ha, M. J. and Sun, W. (2014). Partial correlation matrix estimation using ridge penalty followed by thresholding and re-estimation. Biometrics, 70, 762–770.
###############################
# Simulate data
###############################
simulation <- simulateData(G = 100, etaA = 0.02, n = 50, r = 10)
dat <- simulation$data[[1L]]
stddat <- scale(x = dat, center = TRUE, scale = TRUE)
shrinkage.lambda <- lambda.TargetD(x = stddat)
###############################
# the ridge parameter
###############################
ridge.lambda <- shrinkage.lambda / (1.0 - shrinkage.lambda)
###############################
# partial correlation matrix
###############################
partial <- solve(cor(dat) + ridge.lambda * diag(ncol(dat)))
partial <- -scaledMat(x = partial)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.