View source: R/plot.cv.sparsegl.R
plot.cv.sparsegl | R Documentation |
cv.sparsegl
object.Plots the cross-validation curve, and upper and lower standard deviation
curves, as a function of the lambda
values used.
## S3 method for class 'cv.sparsegl'
plot(x, log_axis = c("xy", "x", "y", "none"), sign.lambda = 1, ...)
x |
Fitted |
log_axis |
Apply log scaling to the requested axes. |
sign.lambda |
Either plot against |
... |
Not used. |
A ggplot2::ggplot()
plot is produced. Additional user
modifications may be added as desired.
cv.sparsegl()
.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.