plot.cv.gamsel: Plotting Routine for Gamsel Cross-Validation Object

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

plot.cv.gamselR Documentation

Plotting Routine for Gamsel Cross-Validation Object

Description

Produces a cross-validation curve with standard errors for a fitted gamsel objecty.

Usage

## S3 method for class 'cv.gamsel'
plot(x, sign.lambda = 1, ...)

Arguments

x

cv.gamsel object

sign.lambda

Either plot against log(lambda) (default) against -lambda if sign.lambda=-1.

...

Optional graphical parameters to plot.

Details

A plot showing cross-validation error is produced. Nothing is returned.

Author(s)

Alexandra Chouldechova and Trevor Hastie
Maintainer: Trevor Hastie hastie@stanford.edu

References

Chouldechova, A. and Hastie, T. (2015) Generalized Additive Model Selection

Examples


##data=gamsel:::gendata(n=500,p=12,k.lin=3,k.nonlin=3,deg=8,sigma=0.5)
data = readRDS(system.file("extdata/gamsel_example.RDS", package = "gamsel"))
attach(data)
bases=pseudo.bases(X,degree=10,df=6)
# Gaussian gam
gamsel.out=gamsel(X,y,bases=bases)
gamsel.cv=cv.gamsel(X,y,bases=bases)
par(mfrow=c(1,1))
plot(gamsel.cv)

gamsel documentation built on Sept. 11, 2024, 6:31 p.m.