cross validation function for `EMfusedlasso`

.

1 2 3 | ```
EMcvfusedlasso(X, y, lambda1, lambda2, nbFolds = 10, maxSteps = 1000,
burn = 50, intercept = TRUE, model = c("linear", "logistic"),
eps = 1e-05, eps0 = 1e-08, epsCG = 1e-08)
``` |

`X` |
the matrix (of size n*p) of the covariates. |

`y` |
a vector of length n with the response. |

`lambda1` |
Values of lambda1 at which prediction error should be computed. Can be a single value. |

`lambda2` |
Values of lambda2 at which prediction error should be computed. Can be a single value. |

`nbFolds` |
the number of folds for the cross-validation. |

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

`burn` |
Number of steps for the burn period. |

`intercept` |
If TRUE, there is an intercept in the model. |

`model` |
"linear" or "logistic". |

`eps` |
Tolerance of the algorithm. |

`eps0` |
Zero tolerance. Coefficients under this value are set to zero. |

`epsCG` |
Epsilon for the convergence of the conjugate gradient. |

A list containing

- cv
Mean prediction error for each value of index.

- cvError
Standard error of cv.

- minCv
Minimal cv criterion.

- lambda1
Values of lambda1 at which prediction error should be computed.

- lambda2
Values of lambda2 at which prediction error should be computed.

- lambda.optimal
Value of (lambda1,lambda2) for which the cv criterion is minimal.

Quentin Grimonprez, Serge Iovleff

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.