plot.glmpath {glmpath} | R Documentation |
Plots the regularization path computed from glmpath
Description
This function takes a glmpath
object and visualizes the
regularization path. The horizontal axis can be norm,
lambda
or step.
The vertical axis can be
coefficients,
aic
or bic.
Usage
## S3 method for class 'glmpath'
plot(x, xvar = c("norm", "lambda", "step"),
type = c("coefficients", "aic", "bic"),
plot.all.steps = FALSE, xlimit = NULL, predictor = FALSE,
omit.zero = TRUE, breaks = TRUE, mar = NULL,
eps = .Machine$double.eps, main = NULL, ...)
Arguments
x |
a |
xvar |
horizontal axis. |
type |
type of the plot, or the vertical axis. Default is
|
plot.all.steps |
If |
xlimit |
When the user wants to visualize a (beginning) sub-part of the plot,
|
predictor |
If |
omit.zero |
If |
breaks |
If |
mar |
margin relative to the current font size |
eps |
an effective zero |
main |
title of the plot |
... |
other options for the plot |
Author(s)
Mee Young Park and Trevor Hastie
References
Mee Young Park and Trevor Hastie (2007) L1 regularization path algorithm for generalized linear models. J. R. Statist. Soc. B, 69, 659-677.
See Also
cv.glmpath, glmpath, predict.glmpath
Examples
data(heart.data)
attach(heart.data)
fit <- glmpath(x, y, family=binomial)
par(mfrow=c(3, 2))
plot(fit)
plot(fit, xvar="lambda")
plot(fit, xvar="step")
plot(fit, xvar="step", xlimit=8)
plot(fit, type="aic")
plot(fit, type="bic")
detach(heart.data)