cv.lars {lars} | R Documentation |
Computes the K-fold cross-validated mean squared prediction error for lars, lasso, or forward stagewise.
cv.lars(x, y, K = 10, fraction = seq(from = 0, to = 1, length = 100), trace = FALSE, plot.it = TRUE, se = TRUE, ...)
x |
Input to lars |
y |
Input to lars |
K |
Number of folds |
fraction |
Abscissa values at which CV curve should be computed,
as a fraction of the saturated |beta|. Default is seq(from = 0, to = 1, length = 100) |
trace |
Show computations? |
plot.it |
Plot it? |
se |
Include standard error bands? |
... |
Additional arguments to lars |
Invisibly returns a list with components (which can be plotted using plotCVlars
)
fraction |
As above |
cv |
The CV curve at each value of fraction |
cv.error |
The standard error of the CV curve |
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.pdf.
data(diabetes) attach(diabetes) cv.lars(x2,y,trace=TRUE,max.steps=80) detach(diabetes)