plot.cv.rgam {relgam}R Documentation

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 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

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)


[Package relgam version 1.0 Index]