Learn R Programming

sglasso (version 1.2.6)

plot.klcv: Plot Method for Leave-One-Out Cross-Validated Kullback-Leibler Divergence

Description

plot.klcv produces a plot to study the sequence of leave-one-out cross-validated Kullback-Leibler divergences computed by klcv.

Usage

# S3 method for klcv
plot(x, ...)

Arguments

x

fitted klcv object;

...

other parameters to be passed through the plotting function.

Author

Luigi Augugliaro
Maintainer: Luigi Augugliaro luigi.augugliaro@unipa.it

Details

This method function produces a plot showing the sequence of leave-one-out cross-validated Kullback-Leibler as function of the tuning parameter \(rho\). The optimal value of the tuning parameter is identified by a vertical dashed line.

See Also

klcv function.

Examples

Run this code
N <- 100
p <- 5
X <- matrix(rnorm(N * p), N, p)
S <- crossprod(X) / N
mask <- outer(1:p, 1:p, function(i,j) 0.5^abs(i-j))
mask[1,5] <- mask[1,4] <- mask[2,5] <- NA
mask[5,1] <- mask[4,1] <- mask[5,2] <- NA
out.sglasso_path <- sglasso(S, mask, tol = 1.0e-13)
out.klcv <- klcv(out.sglasso_path, X)
plot(out.klcv)

Run the code above in your browser using DataLab