Description Usage Arguments Value Examples
This function samples multivariate Gaussian model-X knockoff variables multiple times for each original variable
1 2 3 4 5 6 7 8 | multiple_knockoff_Gaussian(
X,
mu,
Sigma,
omega,
type = c("entropy", "sdp", "equi"),
diag_s = NULL
)
|
X |
A |
mu |
A |
Sigma |
A |
omega |
A |
type |
Could be "entropy" (default), "sdp" or "equal", indicating the method that will be used to construct the knockoff variables. |
diag_s |
A |
a n
-by-p * max{omega - 1}
matrix containing the constructed knockoff variables. Although we construct the same number of knockoffs for all variables (which is the maximum cost), in subsequent steps, we only use the number of knockoffs based on the feature costs.
1 2 3 4 5 6 7 8 9 | 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.