plot.cv.rgam: Plot the cross-validation curve produced by "cv.rgam" object
Description
Plots the cross-validation curve produced by a cv.rgam object, along
with upper and lower standard deviation curves, as a function of the lambda
values used. The plot also shows the number of non-zero features picked for
each value of lambda.
Usage
# S3 method for cv.rgam
plot(x, sign.lambda = 1, ...)
Arguments
x
Fitted "cv.rgam" object.
sign.lambda
Either plot against log(lambda) (default) or
-log(lambda) (if sign.lambda = -1).
# NOT RUN {set.seed(1)
n <- 100; p <- 20
x <- matrix(rnorm(n * p), n, p)
beta <- matrix(c(rep(2, 5), rep(0, 15)), ncol = 1)
y <- x %*% beta + rnorm(n)
cvfit <- cv.rgam(x, y)
plot(cvfit)
# }