# cross validation

### Description

cross validation function for lars algorithm

### Usage

1 2 3 4 |

### Arguments

`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. This is the fraction of the saturated |beta|. The default value is seq(0,1,by=0.01). |

`maxSteps` |
Maximal number of steps for lars algorithm. |

`eps` |
Tolerance of the algorithm. |

### Value

A list containing

- cv
Mean prediction error for each value of index.

- cvError
Standard error of cv.

- minCv
Minimal cv criterion.

- fraction
Value of lambda for which the cv criterion is minimal.

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

- maxSteps
Maximum number of steps of the lars algorithm.

### Author(s)

Quentin Grimonprez

### Examples

1 2 |

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.