plot.lars | R Documentation |
Produce a plot of a lars fit. The default is a complete coefficient path.
## S3 method for class 'lars' plot(x, xvar= c("norm", "df", "arc.length", "step"), 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. |
breaks |
If |
plottype |
Either |
omit.zeros |
When the number of variables is much greater than
the number of observations, many coefficients will never be nonzero;
this logical (default |
eps |
Definition of zero above, default is |
... |
Additonal arguments for generic plot. Can be used to set xlims, change colors, line widths, etc |
The default plot uses the fraction of L1 norm as the xvar. For forward stagewise and LAR, coefficients can pass through zero during a step, which causes a change of slope of L1 norm vs arc-length. Since the coefficients are piecewise linear in arc-length between each step, this causes a change in slope of the coefficients.
NULL
Trevor Hastie
Efron, Hastie, Johnstone and Tibshirani (2003) "Least Angle Regression" (with discussion) Annals of Statistics; see also https://hastie.su.domains/Papers/LARS/LeastAngle_2002.pdf. Yann-Ael Le Borgne (private communication) pointed out the problems in plotting forward stagewise and LAR coefficients against L1 norm, and the solution we have implemented.
data(diabetes) attach(diabetes) object <- lars(x,y) plot(object) detach(diabetes)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.