plot.ernet: Plot coefficients from an ernet object

View source: R/plot.ernet.R

plot.ernetR Documentation

Plot coefficients from an ernet object

Description

Produces a coefficient profile plot of the coefficient paths for a fitted ernet object. This function is modified based on the plot method in the glmnet package.

Usage

## S3 method for class 'ernet'
plot(x, xvar = c("norm", "lambda"), color = FALSE, label = FALSE, ...)

Arguments

x

fitted ernet model

xvar

what is on the x-axis. "norm" plots against the L1-norm of the coefficients, "lambda" against the log-lambda sequence.

color

if TRUE, plot the curves with rainbow colors. Otherwise, plot the curves with gray colors. Default is FALSE.

label

if TRUE, label the curves with variable sequence numbers. Otherwise, do not put labels. Default is FALSE.

...

other graphical parameters to plot.

Details

A coefficient profile plot is produced.

Author(s)

Yuwen Gu and Hui Zou

Maintainer: Yuwen Gu <yuwen.gu@uconn.edu>

See Also

plot.cv.ernet

Examples


set.seed(1)
n <- 100
p <- 400
x <- matrix(rnorm(n * p), n, p)
y <- rnorm(n)
tau <- 0.90
pf <- abs(rnorm(p))
pf2 <- abs(rnorm(p))
lambda2 <- 1
m1 <- ernet(y = y, x = x, tau = tau, eps = 1e-8, pf = pf,
            pf2 = pf2, standardize = FALSE, intercept = FALSE,
            lambda2 = lambda2)
plot(m1)


SALES documentation built on Aug. 16, 2022, 1:05 a.m.

Related to plot.ernet in SALES...