Description Usage Arguments Value Examples
This function generates a path of selected variables using multiple knockoff given the test statistics (kappa, tau)
1 | generate_path(kappa, tau)
|
kappa |
A |
tau |
A |
An list of selected variable sets
1 2 3 4 5 6 7 8 9 10 11 12 13 | library(cheapknockoff)
set.seed(123)
n <- 100
p <- 30
x <- matrix(data = rnorm(n * p), nrow = n, ncol = p)
y <- x[, 1] - 2 * x[, 2] + rnorm(n)
omega <- c(2, 9, sample(seq(2, 9), size = 28, replace = TRUE))
# construct multiple knockoffs
X_k <- multiple_knockoff_Gaussian(X = x, mu = rep(0, p), Sigma = diag(1, p), omega = omega)
# compute knockoff statistics
stat <- cheapknockoff::stat_glmnet_coef(X = x, X_k = X_k, y = y, omega = omega)
# yield the path of selected variables
path <- cheapknockoff::generate_path(kappa = stat$kappa, tau = stat$tau)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.