EMcvlasso: cross validation for 'EMlasso'

View source: R/cvEM.R

EMcvlassoR Documentation

cross validation for EMlasso

Description

cross validation function for EMlasso.

Usage

EMcvlasso(
  X,
  y,
  lambda = NULL,
  nbFolds = 10,
  maxSteps = 1000,
  intercept = TRUE,
  model = c("linear", "logistic"),
  burn = 30,
  threshold = 1e-08,
  eps = 1e-05,
  epsCG = 1e-08
)

Arguments

X

the matrix (of size n*p) of the covariates.

y

a vector of length n with the response.

lambda

Values at which prediction error should be computed.

nbFolds

the number of folds for the cross-validation.

maxSteps

Maximal number of steps for EM algorithm.

intercept

If TRUE, there is an intercept in the model.

model

"linear" or "logistic".

burn

Number of steps for the burn period.

threshold

Zero tolerance. Coefficients under this value are set to zero.

eps

Tolerance of the EM algorithm.

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

minCv

Minimal lambda criterion.

lambda

Values of lambda at which prediction error should be computed.

lambda.optimal

Value of lambda for which the cv criterion is minimal.

Author(s)

Quentin Grimonprez, Serge Iovleff

Examples

dataset <- simul(50, 100, 0.4, 1, 10, matrix(c(0.1, 0.8, 0.02, 0.02), nrow = 2))
result <- EMcvlasso(
  X = dataset$data, y = dataset$response,
  lambda = 5:1, nbFolds = 5, intercept = FALSE
)

HDPenReg documentation built on March 31, 2023, 9:31 p.m.