EMcvfusedlasso | R Documentation |
cross validation function for EMfusedlasso
.
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
Mean prediction error for each value of index.
Standard error of cv.
Minimal cv criterion.
Values of lambda1 at which prediction error should be computed.
Values of lambda2 at which prediction error should be computed.
Value of (lambda1,lambda2) for which the cv criterion is minimal.
Quentin Grimonprez, Serge Iovleff
dataset <- simul(50, 100, 0.4, 1, 10, matrix(c(0.1, 0.8, 0.02, 0.02), nrow = 2))
result <- EMcvfusedlasso(
X = dataset$data, y = dataset$response, lambda1 = 3:1,
lambda2 = 3:1, nbFolds = 5, intercept = FALSE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.