plot.lars {lars} | R Documentation |
Produce a plot of a lars fit. The default is a complete coefficient path.
plot.lars(x, xvar= c("norm", "df", "arc.length"), breaks = TRUE, plottype = c("coefficients", "Cp"), omit.zeros = TRUE, eps = 1e-10, ...)
x |
lars object |
xvar |
The type of x variable against which to
plot. xvar=norm plots against the L1 norm of the coefficient
vector (default). xvar=df plots against the step number (which is
essentially degrees of freedom for LAR; not for LASSO or Forward
Stagewise). xvar=arc.length plots against the arc.length of the
fitted vector; this is useful for a LAR object, because the L1 norm of
its coefficient vector need not be monotone in the steps. |
breaks |
If TRUE , then vertical lines are drawn at each
break point in the piecewise linear coefficient paths |
plottype |
Either coefficients (default) or Cp . The
coefficient plot shows the path of each coefficient as a function
of the norm fraction or Df. The Cp plot shows the Cp curve. |
omit.zeros |
When the number of variables is much greater than
the number of observations, many coefficients will never be nonzero;
this logical (default TRUE ) avoids plotting these zero coefficents |
eps |
Definition of zero above, default is 1e-10 |
... |
Additonal arguments for generic plot. Can be used to set xlims, change colors, line widths, etc |
NULL
Trevor Hastie
Efron, Hastie, Johnstone and Tibshirani (2003) "Least Angle Regression" (with discussion) Annals of Statistics; see also http://www-stat.stanford.edu/~hastie/Papers/LARS/LeastAngle_2002.ps
data(diabetes) attach(diabetes) object <- lars(x,y) plot(object) detach(diabetes)