plot.cv.rgam: Plot the cross-validation curve produced by "cv.rgam" object

Description Usage Arguments Details See Also Examples

View source: R/plot.cv.rgam.R

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

1
2
## S3 method for class '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).

...

Other graphical parameters to plot.

Details

A plot is produced and nothing is returned.

See Also

rgam and cv.rgam.

Examples

1
2
3
4
5
6
7
8
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)

relgam documentation built on Jan. 13, 2020, 5:06 p.m.