Learn R Programming

cernn (version 0.1)

get_lambda_max: Compute lambda_max parameter for covariance regularization.

Description

get_lambda_max computes a maximum lambda value that will shrink eigenvalues nearly to the grand mean.

Usage

get_lambda_max(d, alpha, n, eps = 0.01)

Arguments

d
Vector of sample eigenvalues to shrink. These must be nonnegative.
alpha
Parameter that controls mixture between the trace and inverse trace penalties.
n
The number of observations.
eps
tolerance

Examples

Run this code
n <- 10
p <- 5
set.seed(12345)
X <- matrix(rnorm(n*p),n,p)
d <- svd(X)$d**2
alpha <- get_alpha(X)
get_lambda_max(d,alpha,n)

Run the code above in your browser using DataLab