Learn R Programming

sparsenet (version 1.6)

plot.sparsenet: plot coefficients from a "sparsenet" object

Description

Produces a series of coefficient profile plots of the coefficient paths for a fitted "sparsenet" object.

Usage

# S3 method for sparsenet
plot(x, xvar = c("rsq","lambda","norm"), which.gamma=NULL, label = FALSE,...)

Arguments

x

fitted "sparsenet" model

xvar

What is on the X-axis. "rsq" plots against the percent variance explained on the training data, "lambda" against the log-lambda sequence, and "norm" plots against the L1-norm of the coefficients

which.gamma

sequence numbers of gamma values to be used in the plots; default is all used in the fit

label

If TRUE, label the curves with variable sequence numbers.

...

Other graphical parameters to plot

Author

Rahul Mazumder, Jerome Friedman and Trevor Hastie

Maintainer: Trevor Hastie <hastie@stanford.edu>

Details

A series of coefficient profile plots is produced, one for each gamma specified. Users should set up the appropriate layout.

References

Mazumder, Rahul, Friedman, Jerome and Hastie, Trevor (2011) SparseNet: Coordinate Descent with Nonconvex Penalties. JASA, Vol 106(495), 1125-38, https://hastie.su.domains/public/Papers/Sparsenet/Mazumder-SparseNetCoordinateDescent-2011.pdf

See Also

glmnet package, sparsenet, cv.sparsenet and print and plot methods for both.

Examples

Run this code
x=matrix(rnorm(100*20),100,20)
y=rnorm(100)
fit=sparsenet(x,y)
par(mfrow=c(3,3))
plot(fit)

Run the code above in your browser using DataLab