plot.cv.sparsegl {sparsegl} | R Documentation |
Plot cross-validation curves produced from a cv.sparsegl
object.
Description
Plots the cross-validation curve, and upper and lower standard deviation
curves, as a function of the lambda
values used.
Usage
## S3 method for class 'cv.sparsegl'
plot(x, log_axis = c("xy", "x", "y", "none"), sign.lambda = 1, ...)
Arguments
x |
Fitted |
log_axis |
Apply log scaling to the requested axes. |
sign.lambda |
Either plot against |
... |
Not used. |
Details
A ggplot2::ggplot()
plot is produced. Additional user
modifications may be added as desired.
See Also
Examples
n <- 100
p <- 20
X <- matrix(rnorm(n * p), nrow = n)
eps <- rnorm(n)
beta_star <- c(rep(5, 5), c(5, -5, 2, 0, 0), rep(-5, 5), rep(0, (p - 15)))
y <- X %*% beta_star + eps
groups <- rep(1:(p / 5), each = 5)
cv_fit <- cv.sparsegl(X, y, groups)
plot(cv_fit)
[Package sparsegl version 1.1.0 Index]