cv.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, index, trace = FALSE, plot.it = TRUE, se = TRUE, type = c("lasso", "lar", "forward.stagewise", "stepwise"), mode=c("fraction", "step"), ...)
x |
Input to lars |
y |
Input to lars |
K |
Number of folds |
index |
Abscissa values at which CV curve should be computed.
If |
trace |
Show computations? |
plot.it |
Plot it? |
se |
Include standard error bands? |
type |
type of |
mode |
This refers to the index that is used for
cross-validation. The default is |
... |
Additional arguments to |
Invisibly returns a list with components (which can be plotted using plotCVlars
)
index |
As above |
cv |
The CV curve at each value of index |
cv.error |
The standard error of the CV curve |
mode |
As above |
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.
data(diabetes) attach(diabetes) cv.lars(x2,y,trace=TRUE,max.steps=80) detach(diabetes)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.