| TRexSPCASelector | R Documentation |
Sparse principal components whose non-zero loadings are selected with FDR control. Each ordinary principal component is the response of a T-Rex+GVS run with the elastic net.
Steps:
X is centered and its first M ordinary principal components are
computed (a PCA of the covariance, the columns are not scaled).
For each component, a T-Rex+GVS run with the elastic net and the component as response selects its variables at the target FDR.
The sparse loading vector is assembled from the selected set (see mode of
trex_spca_control()), and the scores of the sparse component are the
centered X times the loading vector.
The explained variance is adjusted for components that are not orthogonal, by the QR decomposition of the scores.
A component without a selected variable has a zero column in V and Z and
the explained variance 0.
ZScores of the sparse components (n x M): column m is the centered X
times column m of V.
VSparse loadings (p x M), each column of unit L2 norm. In "ActiveSet"
mode the non-zero entries of column m are the variables of active_sets[[m]].
In "Thresholded" mode they are the largest ordinary PCA loadings, as many as
active_sets[[m]] has entries, which can be other variables.
active_setsSelected variables per component, a list of M integer vectors
(1-based), the result of the T-Rex+GVS runs. The FDR control holds for these sets. In
"Thresholded" mode they can differ from the non-zero entries of V.
adjusted_evAdjusted explained variance per component (length M):
r_mm^2 / (n - 1), with r_mm the m-th diagonal element of R in the QR
decomposition Z = QR. The adjustment accounts for sparse components that are
not orthogonal.
cumulative_evCumulative adjusted explained variance as a fraction of the total
variance of the centered X (length M), between 0 and 1. It is not the PEV of
Definition 1 of the paper, whose denominator (signal EV plus mixed EV) needs the true
support.
TRexSPCASelector$new()Create a new TRexSPCASelector.
TRexSPCASelector$new( X, M, tFDR, control = trex_spca_control(), seed = -1L, verbose = FALSE )
XDesign matrix (n x p) in memory, or an mmap_matrix opened in
"readwrite" mode. Both are bound without a copy. X is centered in place
during select() and restored on return.
MNumber of sparse principal components, 1 to min(n, p).
tFDRTarget FDR level of each component, in [0, 1].
controlA control list from trex_spca_control()
(default: trex_spca_control()).
seedRandom seed. A negative value (default: -1) gives a run that is not reproducible. Each component runs with its own seed derived from it.
verboseWhether to print one line per component (default: FALSE). The
T-Rex+GVS runs stay quiet.
TRexSPCASelector$select()Run the T-Rex sparse PCA selection.
TRexSPCASelector$select()
Invisible self for method chaining. The results are in the fields
Z, V, active_sets, adjusted_ev and cumulative_ev.
TRexSPCASelector$clone()The objects of this class are cloneable with this method.
TRexSPCASelector$clone(deep = FALSE)
deepWhether to make a deep clone.
J. Machkour, A. Breloy, M. Muma, D. P. Palomar, and F. Pascal, "Sparse PCA with False Discovery Rate Controlled Variable Selection," in Proc. IEEE 49th Int. Conf. Acoust., Speech, Signal Process. (ICASSP), 2024, pp. 9716-9720.
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,
TRexScreeningSelector,
TRexSelector,
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()
set.seed(1)
n <- 100; p <- 30
X <- matrix(rnorm(n * p), n, p)
sel <- TRexSPCASelector$new(X, M = 2, tFDR = 0.2,
control = trex_spca_control(K = 5))
sel$select()
sel$adjusted_ev
sel$active_sets
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.