This function runs the knockoff procedure from start to finish, creating the knockoffs, computing the test statistics, and selecting variables. It is the main entry point for the knockoff package.
1 2 3 |
X |
matrix or data frame of predictors |
y |
response vector |
fdr |
target FDR (false discovery rate) |
statistic |
the test statistic (by default, a lasso statistic). See the Details section for more information. |
threshold |
either 'knockoff' or 'knockoff+'. |
knockoffs |
either equicorrelated knockoffs ('equicorrelated') or knockoffs optimized using semidefinite programming ('sdp') |
normalize |
whether to scale the data columns to have unit norm. Only disable this if your data is already normalized. |
randomize |
whether randomization is to be used when constructing knockoffs and (when p < n < 2p) augmenting the model with extra rows |
The default test statistic is knockoff.stat.lasso_signed_max
.
Other useful test statistics include knockoff.stat.fs
and
knockoff.stat.fs_omp
. It is also possible to provide your own test
statistic (for an example, see the vignette).
To use SDP knockoffs, you must have a Python installation with CVXPY. For more information, see the vignette on SDP knockoffs:
vignette('sdp', package='knockoff')
An object of class "knockoff.result". This object is a list containing at least the following components:
knockoff |
matrix of knockoff variables |
statistic |
computed test statistic |
threshold |
computed selection threshold |
selected |
named vector of selected variables |
Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
All documentation is copyright its authors; we didn't write any of that.