permutation_filter: Runs permutation procedure

Description Usage Arguments Details Value References Examples

View source: R/permutation_filter.R

Description

Runs knockoff procedure with permuted variables instead of knockoff variables for Fixed-X from Barber & Candes (2015).

Usage

1
permutation_filter(X, y, fdr = 0.2, plus = TRUE)

Arguments

X

n-by-p design matrix, with n > p.

y

response vector of length n.

fdr

desired false discovery rate.

plus

True for knockoff+ procedure, false for knockoff procedure.

Details

This runs the knockoff procedure with permuted variables instead of knockoff variables for a given X matrix and y vector. This controls the false discovery rate at a given level.

Value

A list containing:

X

n-by-p design matrix, rescaled so that ||X_j||^2_2 = 1, and augmented if n < 2p.

X_perm

n-by-p matrix of knockoff variables.

y

vector of observed responses (augmented if n < 2p).

W

vector of test statistics.

thresh

threshold for variable selection.

Selected

list of selected variables.

References

Barber and Candes, Controlling the false discovery rate via knockoffs. Ann. Statist. 43 (2015), no. 5, 2055–2085. https://projecteuclid.org/euclid.aos/1438606853

Examples

1
2
3
4
5
6
p <- 50; n <- 100; k <- 5
X <- matrix(stats::rnorm(n*p), nrow = n)
true_covar <- sample(p, k)
beta <- 5 * (1:p %in% true_covar)
y <- X %*% beta + stats::rnorm(n, mean = 0, sd = 1)
results <- permutation_filter(X, y, 0.20, TRUE)

svteichman/prelim.knockoffs documentation built on May 28, 2020, 5:14 p.m.