create.fixed: Fixed-X knockoffs

Description Usage Arguments Details Value References See Also Examples

View source: R/create_fixed.R

Description

Creates fixed-X knockoff variables.

Usage

1
2
3
4
5
6
7
create.fixed(
  X,
  method = c("sdp", "equi"),
  sigma = NULL,
  y = NULL,
  randomize = F
)

Arguments

X

normalized n-by-p matrix of original variables.(n ≥q p).

method

either "equi" or "sdp" (default: "sdp"). This determines the method that will be used to minimize the correlation between the original variables and the knockoffs.

sigma

the noise level, used to augment the data with extra rows if necessary (default: NULL).

y

vector of length n, containing the observed responses. This is needed to estimate the noise level if the parameter sigma is not provided, in case p ≤q n < 2p (default: NULL).

randomize

whether the knockoffs are constructed deterministically or randomized (default: F).

Details

Fixed-X knockoffs assume a homoscedastic linear regression model for Y|X. Moreover, they only guarantee FDR control when used in combination with statistics satisfying the "sufficiency" property. In particular, the default statistics based on the cross-validated lasso does not satisfy this property and should not be used with fixed-X knockoffs.

Value

An object of class "knockoff.variables". This is a list containing at least the following components:

X

n-by-p matrix of original variables (possibly augmented or transformed).

Xk

n-by-p matrix of knockoff variables.

y

vector of observed responses (possibly augmented).

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

See Also

Other create: create.gaussian(), create.second_order()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
p=100; n=200; k=15
X = matrix(rnorm(n*p),n)
nonzero = sample(p, k)
beta = 5.5 * (1:p %in% nonzero)
y = X %*% beta + rnorm(n)

# Basic usage with default arguments
result = knockoff.filter(X, y, knockoffs=create.fixed)
print(result$selected)

# Advanced usage with custom arguments
knockoffs = function(X) create.fixed(X, method='equi')
result = knockoff.filter(X, y, knockoffs=knockoffs)
print(result$selected) 

knockoff documentation built on July 2, 2020, 12:02 a.m.