Learn R Programming

SelectBoost.beta (version 0.4.5)

sb_beta: SelectBoost for beta-regression models

Description

sb_beta() orchestrates all SelectBoost stages—normalisation, correlation analysis, grouping, correlated resampling, and stability tallying—while using the beta-regression selectors provided by this package. It can operate on point-valued or interval-valued responses and automatically squeezes the outcome into (0, 1) unless instructed otherwise.

Usage

sb_beta(
  X,
  Y = NULL,
  selector = betareg_step_aic,
  corrfunc = "cor",
  B = 100,
  step.num = 0.1,
  steps.seq = NULL,
  version = c("glmnet", "lars"),
  squeeze = TRUE,
  use.parallel = FALSE,
  seed = NULL,
  verbose = FALSE,
  threshold = 1e-04,
  interval = c("none", "uniform", "midpoint"),
  Y_low = NULL,
  Y_high = NULL,
  ...
)

Value

Matrix of selection frequencies with one row per c0 level and class "sb_beta". See Details for the recorded attributes.

Arguments

X

Numeric design matrix. Coerced with as.matrix() and normalised via sb_normalize().

Y

Numeric response vector. Values are squeezed to the open unit interval with the standard SelectBoost transformation unless squeeze = FALSE. Optional when interval bounds are supplied.

selector

Selection routine. Defaults to betareg_step_aic(). Function or character string. If it is a function, the selector name should be added as the fun.name attribute.

corrfunc

Correlation function passed to sb_compute_corr().

B

Number of replicates to generate.

step.num

Step length for the automatically generated c0 grid.

steps.seq

Optional user-supplied grid of absolute correlation thresholds.

version

Either "glmnet" (intercept in first row) or "lars".

squeeze

Logical; ensure the response lies in (0, 1).

use.parallel

Logical; enable parallel resampling and selector fits when supported by the current R session.

seed

Optional integer seed for reproducibility. The seed is scoped via withr::with_seed() so the caller's RNG state is restored on exit.

verbose

Logical; emit progress messages.

threshold

Numeric tolerance for considering a coefficient selected.

interval

Interval-resampling mode: "none" reuses Y, whereas "uniform" and "midpoint" draw pseudo-responses between Y_low and Y_high for each replicate.

Y_low, Y_high

Interval bounds in [0, 1] paired with the rows of X when interval is not "none".

...

Additional arguments forwarded to selector.

Details

The returned object carries a rich set of attributes:

  • "c0.seq" – the grid of absolute-correlation thresholds explored during resampling.

  • "steps.seq" – the raw sequence (if any) used to construct the grid.

  • "selector" – the selector identifier (function name or expression).

  • "B" – number of resampled designs passed to the selector.

  • "interval" – the interval sampling mode ("none", "uniform", or "midpoint").

  • "resample_diagnostics" – per-threshold data frames with summary statistics on the cached correlated draws.

These attributes mirror the historical SelectBoost beta implementation so the object can be consumed by existing plotting and reporting utilities.

Examples

Run this code
set.seed(42)
sim <- simulation_DATA.beta(n = 80, p = 4, s = 2)
# increase B for real applications
res <- sb_beta(sim$X, sim$Y, B = 5)
res

Run the code above in your browser using DataLab