Simulate from glmnet penalized regression model

glmnet.recovery(y, X, ...)

Arguments

y

response vector (either "numeric" or "factor") that gets passed to cv.glmnet

X

data.frame of covariates that are passed to cv.glmnet

...

other parameters passed to the function cv.glmnet

Value

simulated response

See also

Examples

set.seed(1)

X = data.frame(matrix(rnorm(100 * 20), 100, 20))
y = X[,1] + rnorm(100)

# simulate from elastic-net regression:
ysim = glmnet.recovery(y=y, X=X)