cv.normal | R Documentation |

The function does k-fold cross validation for selecting best value of regularization parameter.

cv.normal(x,y,k=5,nlambda=50,tau=1,plot=TRUE,errorbars=TRUE)

`x` |
x is matrix of order n x p where n is number of observations and p is number of predictor variables. Rows should represent observations and columns should represent predictor variables. |

`y` |
y is a vector of response variable of order n x 1. |

`k` |
Number of folds for cross validation. Default is k=5. |

`nlambda` |
Number of lambda values to be used for cross validation. Default is nlambda=50. |

`tau` |
Elastic net parameter, |

`plot` |
if TRUE, produces a plot of cross validated prediction mean squared errors against lambda. Default is TRUE. |

`errorbars` |
If TRUE, error bars are drawn in the plot. Default is TRUE. |

Produces a plot and returns a list with following components:

`lambda` |
Value of lambda for which average cross validation error is minimum |

`pmse` |
A vector of average cross validation errors for various lambda values |

`lambdas` |
A vector of lambda values used in cross validation |

`se` |
A vector containing standard errors of cross validation errors |

This function need not be called by user. The function is internally called by cv.extlasso function.

B N Mandal and Jun Ma

Mandal, B.N. and Jun Ma, (2014). A Jacobi-Armijo Algorithm for LASSO and its Extensions.

x=matrix(rnorm(100*30),100,30) y=rnorm(100) cv.normal(x,y,k=10)

extlasso documentation built on May 13, 2022, 9:08 a.m.

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.