Description Usage Arguments References See Also Examples
cernn
performs stable covariance estimation over a grid of regularization parameters.
1 | cernn(X, lambda, alpha)
|
X |
The data matrix whose rows are observations and columns are covariates. |
lambda |
vector of regularization parameters controling amount of shrinkage towards the target. |
alpha |
Parameter that controls mixture between the trace and inverse trace penalties. |
Eric C. Chi and Kenneth Lange, Stable estimation of a covariance matrix guided by nuclear norm penalties, Computational Statistics and Data Analysis, 80:117-128, 2014.
get_alpha
, shrink_eigen
, select_lambda
1 2 3 4 5 6 7 8 9 10 11 12 13 | n <- 10
p <- 5
set.seed(12345)
X <- matrix(rnorm(n*p),n,p)
alpha <- get_alpha(X)
lambda <- 10**(seq(-1,4,length.out=100))
sol_path <- cernn(X,lambda,alpha)
df <- t(sol_path$e)
## Plot regularization paths of eigenvalues
matplot(x=log10(lambda),y=df,type='l',ylab='shrunken eigenvalue')
grand_mean <- (norm(scale(X,center=TRUE,scale=FALSE),'f')**2)/(n*p)
abline(h=grand_mean)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.