Description Usage Arguments Details Value References Examples
View source: R/multiknockfilter.R
This function generates a specified number of knockoff matrices given the data and a knockoff sampling function.
1 | multi.knockoffs(X, K, knockoffs = create.second_order)
|
X |
n x p matrix or data frame of original variables. |
K |
number of knockoff matrices. |
knockoffs |
function for the knockoff construction. It must take the n x p matrix as input
and it must return a n x p knockoff matrix. Either choose a knockoff sampler of
the |
This function requires the installation of the knockoff
package prior to its execution.
The default knockoff sampler create.second_order
is the second-order Gaussian knockoff construction from
the knockoff
package.
A list that contains the K knockoff matrices.
Candes, Fan, Janson, and Lv (2018). Panning for gold. model-X knockoffs for high dimensional controlled variable selection. Journal of the Royal Statistical Society: Series B (Statistical Methodology) 80(3), 551-577.
1 2 3 4 5 6 7 8 9 10 11 12 | n <- 400; p <- 200
mu <- rep(0,p); rho <- 0.25
Sigma <- toeplitz(rho^(0:(p-1)))
X <- MASS::mvrnorm(n, mu, Sigma)
# Basic usage with default arguments
Xk <- multi.knockoffs(X, K = 5)
Xk
# Advanced usage with customized knockoff construction (equi-correlated)
equi.knock <- function(X) create.second_order(X, method = "equi")
Xk <- multi.knockoffs(X, K = 5, knockoffs = equi.knock)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.