agg.union: Union of selection sets

Description Usage Arguments Details Value Examples

View source: R/agg.types.R

Description

This function aggregates a list of selection sets by their union.

Usage

1
agg.union(Shat.list)

Arguments

Shat.list

list of K elements containing the selection sets.

Details

The function can be used in combination with multi.knockoffs and multi.knockfilter.

The function does not have to be used in the context of multiple knockoffs. It can also be used to aggregate the selection sets of multiple FDR controlling procedures in general.

Value

Aggregated union set of selected variables.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
#Multiple knockoff example (union knockoffs)
n <- 400; p <- 200; s_0 <- 30
amplitude <- 1; mu <- rep(0,p); rho <- 0.25
Sigma <- toeplitz(rho^(0:(p-1)))
X <- MASS::mvrnorm(n, mu, Sigma)
nonzero <- sample(p, s_0)
beta <- amplitude * (1:p %in% nonzero)
y <- X %*% beta + rnorm(n)

K <- 5
Xk <- multi.knockoffs(X, K = K)
q <- 0.2/2^((1:K)-1)
multi.res <- multi.knockfilter(X, Xk, y, q = q)
agg.union(multi.res$Shat.list)


#General example (selection sets with indices between 1 and 30)
Shat.list <- list(s1 = c(2,4,3,1,20,30), s2 = c(3,30,23,1,4,8),
                 s3 = c(3,4,5,13,15,12, 23:29, 30), s4 = c(1:10, 13:15, 17),
                 s5 = c(15:20, 23))
agg.union(Shat.list)

cKarypidis/multiknockoffs documentation built on Dec. 19, 2021, 12:53 p.m.