Performs cross-validation (CV) for Lasso regression and plots the results in order to select the optimal Lasso parameter.

1 2 |

`formula` |
formula, like y~X, i.e., dependent~response variables |

`data` |
data frame to be analyzed |

`K` |
the number of segments to use for CV |

`fraction` |
fraction for Lasso parameters to be used for evaluation, see details |

`trace` |
if 'TRUE', intermediate results are printed |

`plot.opt` |
if TRUE a plot will be generated that shows optimal choice for "fraction" |

`sdfact` |
factor for the standard error for selection of the optimal parameter, see details |

`legpos` |
position of the legend in the plot |

`...` |
additional plot arguments |

The parameter "fraction" is the sum of absolute values of the regression coefficients
for a particular Lasso parameter on the sum of absolute values of the regression
coefficients for the maximal possible value of the Lasso parameter (unconstrained
case), see also `lars`

.
The optimal fraction is chosen according to the following criterion:
Within the CV scheme, the mean of the SEPs is computed, as well as their standard
errors. Then one searches for the minimum of the mean SEPs and adds
sdfact*standarderror. The optimal fraction is the smallest fraction with an MSEP
below this bound.

`cv` |
MSEP values at each value of fraction |

`cv.error` |
standard errors for each value of fraction |

`SEP` |
SEP value for each value of fraction |

`ind` |
index of fraction with optimal choice for fraction |

`sopt` |
optimal value for fraction |

`fraction` |
all values considered for fraction |

Peter Filzmoser <P.Filzmoser@tuwien.ac.at>

K. Varmuza and P. Filzmoser: Introduction to Multivariate Statistical Analysis in Chemometrics. CRC Press, Boca Raton, FL, 2009.

1 2 |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.