View source: R/plot.cv.gamsel.R
plot.cv.gamsel | R Documentation |
Produces a cross-validation curve with standard errors for a fitted gamsel objecty.
## S3 method for class 'cv.gamsel'
plot(x, sign.lambda = 1, ...)
x |
|
sign.lambda |
Either plot against |
... |
Optional graphical parameters to plot. |
A plot showing cross-validation error is produced. Nothing is returned.
Alexandra Chouldechova and Trevor Hastie
Maintainer: Trevor
Hastie hastie@stanford.edu
Chouldechova, A. and Hastie, T. (2015) Generalized Additive Model Selection
##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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.