R: Computes K-fold cross-validated error curve for lars
cv.lars
R Documentation
Computes K-fold cross-validated error curve for lars
Description
Computes the K-fold cross-validated mean squared prediction error for
lars, lasso, or forward stagewise.
Usage
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"), ...)
Arguments
x
Input to lars
y
Input to lars
K
Number of folds
index
Abscissa values at which CV curve should be computed.
If mode="fraction" this is the fraction of the saturated
|beta|. The default value in this case is index=seq(from = 0, to =
1, length =100).
If mode="step", this is the number of steps in lars
procedure. The default is complex in this case, and depends on
whether N>p or not. In principal it is index=1:p.
Users can supply their own values of index (with care).
trace
Show computations?
plot.it
Plot it?
se
Include standard error bands?
type
type of lars fit, with default "lasso"
mode
This refers to the index that is used for
cross-validation. The default is "fraction" for
type="lasso" or type="forward.stagewise". For
type="lar" or type="stepwise" the default is "step"
...
Additional arguments to lars
Value
Invisibly returns a list with components (which can be plotted using plotCVlars)