fs_adjustment(), and runs a study in which two selectors choose the
controls. Offered every variable, they keep the mediator and the collider
and lose most of the effect. Offered only the variables measured before the
treatment, their estimates are close to unbiased.as_orchestra_manifest(). The method for a selection
result is registered when 'orchestraManifest' is loaded; call it as
orchestraManifest::as_orchestra_manifest().fs_grid() takes data as one value: a matrix, data frame or other
classed object, and the vectors given as y, groups, block,
treatment or maf. Before, a matrix given as x was crossed cell by
cell. Several data sets are crossed by giving them as a list.fs_grid() crosses the arguments of a regime preset or a generator
(fs_design, fs_implant, fs_plant) into mechanisms, and an
argument named by an edge ("Z->Y") sets that regime coefficient. fs_study()
states a study before it runs: aims, mechanisms, estimand, methods and
reference sets, measures, replicates and seed, printed as a plan with a
hash of its content. For regimes it holds the exact bias and SE of each
reference set, and mcse = sets the replicates from the largest exact
variance. Each mechanism draws from its own L'Ecuyer-CMRG stream, so
adding a method changes no simulated data.fs_run() runs an fs_study(): every selector and reference
adjustment set ("none", "valid", "all", "optimal") on the same
replicates, with one status row per mechanism, arm and replicate.
Declined and failed cells stay in the table. Each method runs under
a seed of its own, so adding a method leaves the others' numbers as
they were. In a regime, each reference's simulated bias and SE are
checked against their exact values (a gap of more than four Monte Carlo
SEs marks its rows "generator_flag"), and each selector's population
RMSE of the sets it chose is reported beside its simulated RMSE.
summary() gives the cell counts and the measures with their Monte
Carlo SEs.fs_run(dir =) writes the plan and each finished mechanism to a
directory, so an interrupted run picks up where it stopped: run again
with the same study and directory, and only the unfinished mechanisms
run. The result equals that of an uninterrupted run except for
runtime. A directory holding another plan's run is refused.fs_study(methods =) takes your own fs_method() objects beside
registered ids, so a selector from another package, wrapped in one
call, runs in a study. Its declarations and the code of its run
function enter the plan hash. Registered experimental methods are now
taken by id too; before, they were refused as not registered.fs_benchmark() takes a single fs_method() as well as a list of
them. Before, a lone method object failed with a misleading message.fs_problem(protect =): columns every fit keeps, unpenalised, beside
the candidates. A regime draw from fs_plant() now carries its treatment
this way, so selectors choose controls with the treatment in the model
and drop a pure instrument. protect = FALSE leaves it out, and
fs_grid(protect = c(TRUE, FALSE)) runs both. Ten methods keep
protected columns: lasso, elastic_net, group_lasso,
sparse_group_lasso, adaptive_lasso, relaxed_lasso, mcp, scad,
group_mcp and group_scad (fs_methods()$protects). The others
decline with the new refusal code selection_method_cannot_protect, and
the plan of an fs_study() prints how many will.mcp and scad no longer report columns at the first point of their
path, where every penalised coefficient is zero by definition but
'ncvreg' could leave values of order 1e-5 when an unpenalised column
explains most of the response.fs_from_clone() reads a 'masque' null clone into the predictors,
treatment and groups on which a causal truth is planted. A missing
predictor value is imputed by its column median, and complete marks
the rows with nothing imputed, so an effect can be reported on all rows
and on the complete cases. New refusal codes:
causal_clone_mode_not_null, causal_treatment_not_found and
causal_treatment_levels_unsupported.fs_plant() plants a known treatment effect on kept predictors: a
shift for a two-valued treatment, or a dose curve (rise, plateau,
optimum or none) for a numeric dose with three or more levels, on one
outcome or on two outcomes with correlated residuals, such as yield and
grain protein. fs_effect() estimates the planted contrasts with lm()
or lme4::lmer() under no adjustment, all covariates or a selection, on
all rows or the complete cases, and fs_effect_ademp() reports bias,
empirical SE, MSE, RMSE, coverage and rejection with their Monte Carlo
SEs. The RMSE's SE is a delta-method value and is NA where the MSE is
under twice its own SE.
New refusal code: causal_effect_grid_invalid.fs_regime() reads a dagitty graph with standardised path coefficients
as a linear Gaussian model, and returns its estimand (total or direct
effect), whether adjustment identifies it, the population coefficient of
the treatment under any set of controls, and the causal role of each
observed node under two label sets. fs_regimes() lists 26 presets:
the 18 models and two variations of Cinelli, Forney and Pearl (2024),
Pearl's (2010) bias amplifier, the M- and butterfly structures of Ding
and Miratrix (2015), VanderWeele's (2010) mediator-outcome confounder,
and the regularisation-induced confounding cell of Hahn et al. (2018).
fs_plant(regime =) draws every node of a regime, fs_effect() gains a
continuous treatment and adjust = "valid", and fs_score(by = "role")
reports how often a selection keeps each role, its nominal
false-discovery proportion and its harmful selections. 'dagitty' is
suggested. New refusal codes: causal_regime_invalid,
causal_regime_infeasible and causal_effect_not_identified.fs_adjustment() gives the population cost of adjusting for each set of
controls in a regime: the treatment's coefficient and its bias, whether
the set is valid, and the variance of the least-squares estimate,
asymptotic and exact at a stated sample size, with the RMSE. It marks
the optimal valid set of Henckel, Perkovic and Maathuis (2022). The
preset near_instrument is a confounder with a strong effect on the
treatment and a weak one on the outcome, the linear form of Brookhart et
al. (2006, experiment 2). fs_score(by = "role") adds the exact cost of
each replicate's choice, its bias and its variance relative to the
optimal set, so a kept instrument shows as lost precision, or as bias
when a confounder is hidden.fa() term on four environments.fs_methods() example no longer runs during R CMD check.as_orchestra_manifest() is callable again after library(flexySelect)
under 'S7' 1.0.0, which left a placeholder in place of the re-exported
generic. 'S7' (>= 1.0.0) is now required.as_orchestra_manifest() emits an fs_select() result as an
'orchestraManifest' orchestra_manifest with target "parameters": one
row per candidate term, the selected term names in the summary, and the
tuning, seed and backend versions in the metadata. A declined or failed
selection is emitted as an abstention carrying its reason code. The new
vignette Handing a selection to the orchestra runs it on the Las Rosas
nitrogen trial from 'agridat'. fs_result gains terms, the column
names that selected indexes.
A method whose backend reports a fit that did not converge still returns
its selection, now flagged: fs_result carries converged,
fs_benchmark() a converged column and fs_ademp() an
n_not_converged count per cell. glmm_pen is the first method to
report it. Methods whose backend does not report convergence give NA.
fs_ademp() reports a benchmark in the ADEMP structure of Morris, White
and Crowther (2019): aims, data-generating mechanisms, estimands, methods,
and performance (true- and false-positive rates, exact-support rate,
model size, failures and declines) with Monte Carlo standard errors.
fs_transfer() compares how a panel of selectors behaves on the real
data and on a clone, using quantities observable without truth
(cross-validated prediction error, stability, model size, agreement
between selectors, decoys selected). It returns Kendall's tau per
quantity and a distance with a threshold set from random half-splits of
the real data.
fs_design() simulates a selection problem whose truth is known: six
predictor laws, marker columns, five support placements, the coefficient
patterns of Hastie, Tibshirani and Tibshirani (2020), interacting pairs
under strong, weak or no heredity, group intercepts, random slopes and a
relationship background, in the Gaussian, binomial, Poisson and negative
binomial families. Signal is set as shares of variance on the
linear-predictor scale. fs_problem() holds the data any selector reads.
fs_score() scores selections against that truth under four definitions
of a true positive and summarises replicates with Monte Carlo standard
errors. fs_stability() measures agreement across resamples.
fs_method() defines a selection method by what it fits, and
fs_methods() lists the methods the package ships. fs_select() runs
one method on one problem and declines, with a registered reason code,
when the family, a backend package or the random effects rule the method
out. fs_benchmark() runs every method on every simulation and returns
one status row per cell, including the cells that declined or failed.
The first shipped method, marginal_bh, screens each column on its own
and selects under Benjamini-Hochberg or Benjamini-Yekutieli control of
the false-discovery rate.
forward_stepwise adds, from the intercept-only GLM, the column that
lowers AIC or BIC most until none lowers it, and so takes the path of
stats::step(direction = "forward"). Its scores rank the columns by
order of entry.
fs_stabilise() wraps any method in complementary-pairs stability
selection (Shah and Samworth 2013). The method runs on both halves of
random splits of the data, drawn by whole groups when the problem has
them, and a column is selected when the share of halves that selected it
reaches the cutoff.
lasso, elastic_net, group_lasso and sparse_group_lasso run the
package's fold-wise penalised path as registry methods. Each fold's
training rows are rotated by a plug-in covariance of the group
intercepts, so these methods run on a problem with groups. The grouped
two penalise the problem's column blocks. The selected set is the union
of the fold supports at the point the one-standard-error rule picks, and
a column's score is the share of folds whose support holds it.
fs_method() gains carries, the random structures a method fits. On
every route, native included, fs_select() declines a problem with a
structure the method does not carry, and fs_stabilise() keeps the base
method's carries. fs_select() also returns a refusal raised while a
method runs as a decline.
fs_implant() plants a known truth into real or cloned predictors, in
four modes. Simulate draws a new outcome calibrated to the real
outcome's mean, group variance and total variance. Spike adds signal to
the real outcome. Null permutes the outcome within groups. Decoys
appends permuted copies of columns as known nulls. The planted outcome
is sparse or dense, and rows can be drawn by whole groups first. The
result is an fs_sim, scored as a draw from fs_design() is.
fs_implant() can also plant interacting pairs on the real columns,
non-linear main effects (quadratic, sine or threshold), a hidden
confounder built from the real columns and left out of the data, and a
random slope. Each is off by default, and a call without them returns
the same object as before. fs_score() scores a selected proxy of the
confounder under a causal rule, a predictive rule or both
(proxy_rule), and reports proxy_rate and nonlinear_tpr.
fs_accept() decides whether a clone is close enough to the real data:
margins, moments, correlation and its spectrum for the predictors, and
the outcome's margin, moments, linear fit, residual shape and group
share. Each statistic's threshold is drawn from splits of the real data
into halves by whole groups.
Thirteen penalised and screening selectors join the registry, each a
wrapper round a maintained package in Suggests: adaptive_lasso and
relaxed_lasso (glmnet), mcp and scad (ncvreg), group_mcp and
group_scad (grpreg), sparsegl, slope (SLOPE), l0_learn
(L0Learn), best_subset (abess), glinternet, hiernet (hierNet) and
sis (SIS). They fit fixed effects only and decline problems with
random effects.
Five selectors that fit the random effects themselves join the registry,
each a wrapper round a maintained package in Suggests: glmm_lasso
(glmmLasso), glmm_pen (glmmPen, tuned by BIC-ICQ), rpql (regularised
penalised quasi-likelihood), plmm (plmmr, a penalised linear mixed
model) and buildmer_step (buildmer, ordering then backward elimination
on lme4). The
random structure is fitted and left unpenalised. plmm hands plmmr a
similarity matrix scaled to trace n with a small ridge, because plmmr's
estimate of the variance ratio is a maximum-likelihood one only at that
scale and otherwise sits at its upper bound.
fs_method() gains requires, the random structures a method cannot run
without, so rpql and glmm_pen decline a problem with no groups, and
plmm declines a problem with both groups and a relationship matrix.
Sixteen selectors from Bayesian, error-controlling and tree-based
packages join the registry, each a wrapper round a maintained package in
Suggests, fitting fixed effects only: horseshoe, horseshoe_plus and
bayes_lasso (bayesreg); bayes_b and bayes_c (BGLR); bas_mpm
(BAS); ss_lasso (SSLASSO); susie (susieR); spike_slab
(BoomSpikeSlab); varbvs; sparse_vb (sparsevb); stability_stabs
(stabs, with its bound on expected false positives); stability_sharp
(sharp); knockoff (model-X knockoffs with false-discovery control);
rf_importance (ranger permutation importance with Altmann p-values);
and boruta (Boruta). A Bayesian method turns its posterior into a set
by a rule named in its tuning: the median probability model, a credible
interval, the Bayesian false-discovery rate or the signal adaptive
variable selector.
fs_method() gains maturity ("established" or "experimental"),
listed by fs_methods(), and a method may return its path.
Six selectors written in the package join the registry. mirror_ds and
mirror_mds select by data splitting and mirror statistics (Dai, Lin,
Xing and Liu 2023), with one split or many. Only mirror_mds claims
false-discovery-rate control: with one split the control is asymptotic,
and the measured rate sat above the nominal level.
stg (stochastic gates, Yamada et al. 2020), l0_hard_concrete (Louizos,
Welling and Kingma 2018), lassonet (Lemhadri et al. 2021) and the
experimental vgate (the variational gate of Yan et al. 2023) are
fitted in torch.
fs_nested() wraps a method that orders the columns and chooses among
its nested sets by refitting each by maximum likelihood and scoring it by
AIC, BIC, extended BIC, conditional AIC (cAIC4), cross-validation or one
of two experimental rules. The intercept-only model is always a
candidate, so a design with no signal can return the empty set. lasso and elastic_net now return their
path, and fs_select() keeps a method's path and nested record.
fs_lift() carries a Gaussian method into binomial, Poisson and negative
binomial mixed models by a working response round a null mixed-model fit
(experimental, approximate; its estimates are one-step values and
attenuated).
fs_methods() lists the established methods unless maturity = "all".
First version. fb_select(), fb_select_path(), fb_select_refit(),
fb_select_fold_data(), fb_penalty(), fb_resamples() and
fb_decision() come from flexyBayes 0.15.0, where they were part of the
package, and read a fit through the extension API of flexyBayes. The
package refuses to load against a flexyBayes whose fb_extension_api() is
not 1.
Options are renamed flexySelect.selection_dense_gb,
flexySelect.grouped_solver and flexySelect.workers. The flexyBayes
0.15.0 names flexyBayes.selection_dense_gb,
flexyBayes.selection_grouped_solver and flexyBayes.selection_workers
are still read when the new name is unset.