knockoffDMC function

Group knockoffs of discrete Markov chains

Group knockoffs of discrete Markov chains

This function constructs knockoffs of variables distributed as a discrete Markov chain.

knockoffDMC(X, pInit, Q, groups = NULL, seed = 123, cluster = NULL, display_progress = FALSE)

Arguments

  • X: an integer matrix of size n-by-p containing the original variables.
  • pInit: an array of length K, containing the marginal distribution of the states for the first variable.
  • Q: an array of size (p-1,K,K), containing a list of p-1 transition matrices between the K states of the Markov chain.
  • groups: an array of length p, describing the group membership of each variable (default: NULL).
  • seed: an integer random seed (default: 123).
  • cluster: a computing cluster object created by makeCluster (default: NULL).
  • display_progress: whether to show progress bar (default: FALSE).

Returns

An integer matrix of size n-by-p containing the knockoff variables.

Details

Each element of the matrix X should be an integer value between 0 and K-1. The transition matrices contained in Q are defined such that P[Xj+1=kXj=l]=Q[j,l,k]P[X_{j+1}=k|X_{j}=l]=Q[j,l,k].

Examples

# Generate data p = 10; K = 5; pInit = rep(1/K,K) Q = array(stats::runif((p-1)*K*K),c(p-1,K,K)) for(j in 1:(p-1)) { Q[j,,] = Q[j,,] / rowSums(Q[j,,]) } X = sampleDMC(pInit, Q, n=20) # Generate knockoffs Xk = knockoffDMC(X, pInit, Q) # Generate group-knockoffs for groups of size 3 groups = rep(seq(p), each=3, length.out=p) Xk = knockoffDMC(X, pInit, Q, groups=groups)

References

Rdpack::insert_ref(key="sesia2019",package="SNPknock")

Rdpack::insert_ref(key="sesia2019multi",package="SNPknock")

See Also

Other knockoffs: knockoffGenotypes, knockoffHMM, knockoffHaplotypes

  • Maintainer: Matteo Sesia
  • License: GPL-3
  • Last published: 2019-05-17