# cross validation for EM fused-lasso

### Description

cross validation function for `EMfusedlasso`

.

### Usage

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)
``` |

### Arguments

`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. |

### Value

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.

### Author(s)

Quentin Grimonprez, Serge Iovleff

### Examples

1 2 |