# Cross-validation for Lasso

### Description

This function computes the cross-validation-optimal regression coefficients for lasso.

### Usage

1 |

### Arguments

`X` |
matrix of observations. The rows of |

`y` |
vector of responses. The length of y must equal the number of rows of X |

`k` |
the number of splits in |

`use.Gram` |
When the number of variables is very large, you may not want LARS to precompute the Gram matrix. Default is |

`normalize` |
Should the columns of |

`intercept` |
Should an intercept be included? Default is |

### Details

We use the glmnet() function from the glmnet package to compute the fit. Note that in Kraemer et. al. (2009), we used the lars() function from the lars package, which is much slower than glmnet().

### Value

`lambda` |
vector of paramter values from which the optimal parameter is selected |

`cv` |
cross-validated error for all |

`lambda.opt` |
cross-validation optimal parameter |

`cv.lasso` |
cv error for the optimal model. |

`intercept` |
cross-validation optimal intercept. If |

`coefficients` |
cross-validation optimal regression coefficients, without intercept |

### Author(s)

Nicole Kraemer

### References

R. Tibshirani (1997) "Regression Shrinkage and Selection via the Lasso", Journal of the Royal Statistical Society B, 58 (1)

N. Kraemer, J. Schaefer, A.-L. Boulesteix (2009) "Regularized Estimation of Large-Scale Gene Regulatory Networks with Gaussian Graphical Models", BMC Bioinformatics, 10:384

http://www.biomedcentral.com/1471-2105/10/384/

### See Also

`Beta2parcor`

, `adalasso`

### Examples

1 2 3 4 5 |