Learn R Programming

adelie (version 1.0.7)

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

Description

Produces a coefficient profile plot of the coefficient paths for a fitted "grpnet" object.

Usage

# S3 method for grpnet
plot(x, sign.lambda = -1, glm.name = TRUE, ...)

Arguments

x

fitted "grpnet" model

sign.lambda

This determines whether we plot against log(lambda) or its negative. values are -1(default) or 1

glm.name

This is a logical (default TRUE), and causes the glm name of the model to be included in the plot.

...

Other graphical parameters to plot

Author

James Yang, Trevor Hastie, and Balasubramanian Narasimhan
Maintainer: Trevor Hastie hastie@stanford.edu

Details

A coefficient profile plot is produced. If x is a multinomial or multigaussian model, the 2norm of the vector of coefficients is plotted.

References

Yang, James and Hastie, Trevor. (2024) A Fast and Scalable Pathwise-Solver for Group Lasso and Elastic Net Penalized Regression via Block-Coordinate Descent. arXiv tools:::Rd_expr_doi("10.48550/arXiv.2405.08631").

See Also

grpnet, and print, and coef methods, and cv.grpnet.

Examples

Run this code
x=matrix(rnorm(100*20),100,20)
y=rnorm(100)
fit1=grpnet(x,glm.gaussian(y))
plot(fit1)
g4=diag(4)[sample(1:4,100,replace=TRUE),]
fit2=grpnet(x,glm.multinomial(g4))
plot(fit2,lwd=3)
fit3=grpnet(x,glm.gaussian(y),groups=c(1,5,9,13,17))
plot(fit3)

Run the code above in your browser using DataLab