Description Usage Arguments Value References See Also Examples

View source: R/create_gaussian.R

Samples multivariate Gaussian model-X knockoff variables.

1 | ```
create.gaussian(X, mu, Sigma, method = c("asdp", "sdp", "equi"), diag_s = NULL)
``` |

`X` |
n-by-p matrix of original variables. |

`mu` |
vector of length p, indicating the mean parameter of the Gaussian model for |

`Sigma` |
p-by-p covariance matrix for the Gaussian model of |

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

`diag_s` |
vector of length p, containing the pre-computed covariances between the original
variables and the knockoffs. This will be computed according to |

A n-by-p matrix of knockoff variables.

Candes et al., Panning for Gold: Model-free Knockoffs for High-dimensional Controlled Variable Selection, arXiv:1610.02351 (2016). https://web.stanford.edu/group/candes/knockoffs/index.html

Other create:
`create.fixed()`

,
`create.second_order()`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ```
p=200; n=100; k=15
rho = 0.4
mu = rep(0,p); Sigma = toeplitz(rho^(0:(p-1)))
X = matrix(rnorm(n*p),n) %*% chol(Sigma)
nonzero = sample(p, k)
beta = 3.5 * (1:p %in% nonzero)
y = X %*% beta + rnorm(n)
# Basic usage with default arguments
knockoffs = function(X) create.gaussian(X, mu, Sigma)
result = knockoff.filter(X, y, knockoffs=knockoffs)
print(result$selected)
# Advanced usage with custom arguments
knockoffs = function(X) create.gaussian(X, mu, Sigma, method='equi')
result = knockoff.filter(X, y, knockoffs=knockoffs)
print(result$selected)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.