Learn R Programming

cernn (version 0.1)

cernn: Compute the regularization path for Covariance Estimate Regularized by Nuclear Norms (CERNN)

Description

cernn performs stable covariance estimation over a grid of regularization parameters.

Usage

cernn(X, lambda, alpha)

Arguments

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.

References

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.

See Also

get_alpha, shrink_eigen, select_lambda

Examples

Run this code
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)

Run the code above in your browser using DataLab