HDcvlars | R Documentation |
cross validation function for lars algorithm
HDcvlars(
X,
y,
nbFolds = 10,
index = seq(0, 1, by = 0.01),
mode = c("fraction", "lambda"),
maxSteps = 3 * min(dim(X)),
partition = NULL,
intercept = TRUE,
eps = .Machine$double.eps^0.5
)
X |
the matrix (of size n*p) of the covariates. |
y |
a vector of length n with the response. |
nbFolds |
the number of folds for the cross-validation. |
index |
Values at which prediction error should be computed. When mode = "fraction", this is the fraction of the saturated |beta|. The default value is seq(0,1,by=0.01). When mode="lambda", this is values of lambda. |
mode |
Either "fraction" or "lambda". Type of values containing in partition. |
maxSteps |
Maximal number of steps for lars algorithm. |
partition |
partition in nbFolds folds of y. Must be a vector of same size than y containing the index of folds. |
intercept |
If TRUE, there is an intercept in the model. |
eps |
Tolerance of the algorithm. |
A list containing
Mean prediction error for each value of index.
Standard error of cv.
Minimal cv criterion.
Value of index for which the cv criterion is minimal.
Values at which prediction error should be computed. This is the fraction of the saturated |beta|. The default value is seq(0,1,by=0.01).
Maximum number of steps of the lars algorithm.
Quentin Grimonprez
dataset <- simul(50, 10000, 0.4, 10, 50, matrix(c(0.1, 0.8, 0.02, 0.02), nrow = 2))
result <- HDcvlars(dataset$data, dataset$response, 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.