plot.glmpath {glmpath} | R Documentation |
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.
plot.glmpath(x, xvar = c("norm", "lambda", "step"), type = c("coefficients", "aic", "bic"), xlimit = NULL, predictor = FALSE, omit.zero = TRUE, breaks = TRUE, mar = NULL, eps = .Machine$double.eps, main = NULL, ...)
x |
a glmpath object
|
xvar |
horizontal axis. xvar=norm plots against the L1 norm of the
coefficients (to which L1 norm penalty was applied);
xvar=lambda plots against λ; and xvar=step
plots against the number of steps taken. Default is norm.
|
type |
type of the plot, or the vertical axis. Default is
coefficients.
|
xlimit |
When the user wants to visualize a (beginning) sub-part of the plot,
xlimit sets an upper limit to the L1 norm or the number of
steps, or a lower limit to λ.
|
predictor |
If TRUE and type=coefficients, the predictor step
estimates are connected with dotted lines. If FALSE, only the
corrector step estimates are connected with solid lines.
|
omit.zero |
If TRUE and type=coefficients, the predictors that
were never in the active set are omitted.
|
breaks |
If TRUE, vertical lines are drawn at the points where the
active set changes and numbered with the degrees of freedom.
|
mar |
margin relative to the current font size |
eps |
an effective zero |
main |
title of the plot |
... |
other options for the plot |
Mee Young Park and Trevor Hastie
Mee Young Park and Trevor Hastie (2006) L1 Regularization Path Algorithm for Generalized Linear Models - available at the authors' websites, http://www.stanford.edu/~mypark or http://stat.stanford.edu/~hastie/pub.htm.
cv.glmpath, glmpath, predict.glmpath
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)