These helpers expose the individual stages of the SelectBoost workflow so
that beta-regression selectors can be combined with correlation-aware
resampling directly from SelectBoost.beta. They normalise the design matrix,
derive correlation structures, form groups of correlated predictors, generate
Gaussian surrogates that mimic the observed dependency structure, and apply a
user-provided selector on each resampled design.
Usage
sb_normalize(X, center = NULL, scale = NULL, eps = 1e-08)
sb_compute_corr(X, corrfunc = "cor")
sb_group_variables(corr_mat, c0)Arguments
- X
Numeric matrix of predictors.
- center
Optional centering vector recycled to the number of columns. Defaults to the column means of
X.- scale
Optional scaling vector recycled to the number of columns. Defaults to the column-wise \(\ell_2\) norms of the centred matrix.
- eps
Small positive constant used when normalising columns.
- corrfunc
Function or character string used to compute pairwise associations. Defaults to
"cor".- corr_mat
Numeric matrix of associations.
- c0
Threshold applied to the absolute correlations.
Value
sb_normalize() returns a centred, \(\ell_2\)-scaled copy of X.
sb_compute_corr() returns the association matrix.
sb_group_variables() returns a list of integer vectors, one per
variable, describing the correlated group it belongs to.
Examples
sb_normalize(matrix(rnorm(20), 5))
#> [,1] [,2] [,3] [,4]
#> [1,] 0.3463524 -0.64667648 0.50238575 -0.1561321
#> [2,] -0.4636281 -0.19778617 0.06741316 0.3640875
#> [3,] -0.4517346 0.17420391 -0.49126825 0.4258594
#> [4,] 0.6712470 0.71441803 -0.53858287 -0.7969315
#> [5,] -0.1022367 -0.04415928 0.46005220 0.1631167
#> attr(,"center")
#> [1] -0.2391497 0.8453661 1.1584252 -0.6895804
#> attr(,"scale")
#> [1] 1.137317 1.709715 1.679133 2.070999