sim_EN: Simulate from elastic-net regression model

Description Usage Arguments Value Examples

View source: R/simknockoffs.R

Description

Simulate from elastic-net regression model

Usage

1
sim_EN(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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(seqknockoff)

set.seed(1)

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

# simulate from elastic-net regression with elastic-net penalty alpha:
ysim = sim_EN(y=y, X=X, alpha=0.5)

# simulated versus input response:
plot(y, ysim)

kormama1/seqknockoff documentation built on April 11, 2021, 7:44 a.m.