| TRexSelector | R Documentation |
FDR-controlled variable selection algorithm.
.ptrGet internal pointer.
.ptr_Xinternal proxy for data size
selected_varLogical vector indicating which variables were selected.
selected_indicesInteger vector of selected 1-based indices.
v_threshThe chosen voting threshold.
T_stopStopping time: the number of included dummies at which
the T-loop stopped, so the random experiments ran until T_stop
dummies were included. For T_stop > 1 it is not the stopping
time of the selection: the selection is taken from the stopping times
1 to T_stop - 1, mostly from T_stop - 1 and sometimes
from an earlier one (see select()).
LCalibrated dummy multiplier L (the selector uses L * p dummies).
voting_gridVoting levels 0.5, 0.5 + 1/K, ..., 1 - eps that the selection searches.
fdp_hat_matEstimated false discovery proportion per T step (rows) and voting level (columns).
phi_matRelative occurrences of the original variables over the K random experiments after each T step (rows).
r_matNumber of selected variables per stopping time (rows) and
voting level (columns). It has T_stop - 1 rows, the stopping
time T_stop is not part of it, and one row for
T_stop = 1.
phi_primeCalibrated relative occurrences used by the FDP estimate (length p), at most 1 and possibly negative.
x_meansColumn means of X that the selector subtracted
(zeros under scaling_mode = "NONE").
x_l2_normsScale divisors of the columns of X: the L2
norms of the centered columns under scaling_mode = "L2", the
sample standard deviations under "ZSCORE", ones under
"NONE".
y_meanMean of y that the selector subtracted (0 under
scaling_mode = "NONE").
tFDRThe target FDR level.
KThe number of random experiments.
max_num_dummiesThe cap of the dummy multiplier, max_dummy_multiplier
of trex_control(): the L-loop adds dummies up to this many times the number
of variables. The field holds a multiplier, not a number of dummies.
max_T_stopWhether the bound on the stopping time is on, use_max_T_stop
of trex_control(): the T-loop then ends at ceiling(n / 2) at the
latest. The field holds a logical, not a stopping time.
stagnation_checkWhether the T-loop stops on stagnation,
tloop_stagnation_stop of trex_control() after the default by the
solver family is resolved.
num_selectedThe number of selected variables.
num_dummiesThe number of dummies used by the last select() (the L-loop's calibration).
TRexSelector$new()Create a new TRexSelector object.
TRexSelector$new( X, y, tFDR = 0.1, seed = -1, verbose = TRUE, control = trex_control() )
XFeature matrix in memory, or an mmap_matrix, the handle
of a memory-mapped file. A numeric matrix of type double and a
memory-mapped file are bound without a copy. Any other matrix or a
data frame is converted first, which is a copy. The selector
standardizes a memory-mapped design in place and restores it, which
needs "readwrite" mode. Under scaling_mode = "NONE" it
writes nothing and "readonly" mode suffices.
yResponse vector. The selector works on a copy of it.
tFDRTarget FDR level in [0, 1] (default: 0.1).
seedRandom seed (default: -1). A seed of 0 or more makes the run deterministic and reproducible: the same seed draws the same dummies. A negative seed draws them from the hardware entropy source, and the run is not reproducible bit by bit. A Monte Carlo study gives every trial a seed of its own, or uses -1.
verboseWhether to print progress (default: TRUE).
controlA control list from trex_control() (default:
trex_control()).
TRexSelector$restore()Give X back before select(): undo the
in-place normalization applied at construction and release the
buffer claim (idempotent; a no-op after select(), which
restores X itself). A restored selector cannot run:
select() then errors, construct a new one. Without it, an
unselected selector gives X back only when it is
garbage-collected.
TRexSelector$restore()
Invisibly returns self.
TRexSelector$select()Run the TRexSelector algorithm. A selector runs once:
select() gives X back when it ends, so a second call
is an error instead of a run on a design that is no longer
standardized. Construct a new selector to run again. The fields keep
the results of the run. A select() that ends with an error
gives X back at once (original scale) and retires the
selector as well.
The T-loop raises the stopping time until the FDP estimate at the
highest voting level exceeds tFDR, or until its bound or the
stagnation stop ends it, and T_stop is where it stopped. The
selection is the cell with the largest number of
selected variables among the stopping times 1 to T_stop - 1
(the stopping time 1 for T_stop = 1) and the voting levels
whose FDP estimate does not exceed tFDR. Among equal counts
the highest voting level wins, then the latest stopping time. The
stopping time of the selection is therefore below T_stop,
mostly by one and sometimes by more.
TRexSelector$select()
invisible(self)
TRexSelector$clone()The objects of this class are cloneable with this method.
TRexSelector$clone(deep = FALSE)
deepWhether to make a deep clone.
J. Machkour, M. Muma, and D. P. Palomar, "The Terminating-Random Experiments Selector: Fast High-Dimensional Variable Selection with False Discovery Rate Control," Signal Process., vol. 231, Art. no. 109894, 2025, doi: 10.1016/j.sigpro.2025.109894.
Other T-Rex selectors and controls:
Gauss_data,
TRexBiobankScreeningSelector,
TRexDASelector,
TRexGVSSelector,
TRexSPCASelector,
TRexScreeningSelector,
TRexTikhonovSelector,
trex_biobank_control(),
trex_build_group_centering_k(),
trex_control(),
trex_da_control(),
trex_default_lambda2_grid(),
trex_dummy_distribution(),
trex_fdp(),
trex_fdp_dense(),
trex_gamma_to_k(),
trex_get_num_threads(),
trex_gvs_control(),
trex_gvs_lambda2_power_rule(),
trex_normalize_design(),
trex_precision(),
trex_recall(),
trex_screen_control(),
trex_spca_control(),
trex_tikhonov_control(),
trex_tikhonov_lambda2_power_rule(),
trex_tpp(),
trex_tpp_dense()
data(Gauss_data)
X <- Gauss_data$X
y <- Gauss_data$y
sel <- TRexSelector$new(X, y, tFDR = 0.1, verbose = FALSE)
sel$select()
sel$selected_indices
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.