Learn R Programming

lars (version 0.9-8)

plot.lars: Plot method for lars objects

Description

Produce a plot of a lars fit. The default is a complete coefficient path.

Usage

## 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, ...)

Arguments

Value

NULL

Details

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.

References

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.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.

Examples

Run this code
data(diabetes)
attach(diabetes)
object <- lars(x,y)
plot(object)
detach(diabetes)

Run the code above in your browser using DataLab