Learn R Programming

cernn (version 0.1)

loss_entropy: Entropy Loss

Description

loss_entropy computes the entropy loss, which is also known as Stein's loss.

Usage

loss_entropy(S, Sinv)

Arguments

S
Covariance Estimate
Sinv
Reference Precision Matrix

Examples

Run this code
set.seed(12345)
p <- 20
d <- sort(abs(rcauchy(p)),decreasing=TRUE)
sigma <- diag(d)
n <- 20
X <- scale(matrix(rnorm(n*p),n,p),center=FALSE,scale=1/sqrt(d))
alpha <- get_alpha(X)
lambda <- 10**(seq(-2,2,length.out=100))
sol_cv <- select_lambda(X,lambda)
loss_entropy(sol_cv$S,solve(sigma))

Run the code above in your browser using DataLab