Generates sparse Gaussian knockoff variables using the second-order method with the semi-definite programming (SDP) approach.

create.sparse_Gaussian(X, n_ko = 1, verbose = FALSE)

Arguments

X

A numeric matrix of predictors for which knockoffs will be generated. Each column represents a variable, and each row corresponds to an observation.

n_ko

An integer specifying the number of knockoff matrices to generate. Default is 1.

verbose

Logical. Whether to display progress information during the knockoff generation. Default is TRUE.

Value

A list of matrices containing sparse Gaussian knockoff variables corresponding to the original matrix X. Each matrix in the list has the same dimensions as X.

Details

This function generates knockoff variables using the semi-definite programming (SDP) method for second-order knockoffs with a sparse covariance matrix. Sparsity is controlled through the spcov package, which allows for shrinkage methods in variable selection tasks.

Examples

X <- matrix(rnorm(100), nrow = 10, ncol = 10)
Xk <- create.sparse_Gaussian(X)
#> MM converged in 95 steps!