Given a candidate predictor matrix X and an optional unnamed covariate
matrix C, builds the design [1, X, C] and removes
rank-deficient columns from X until the design has full column rank.
Rank-deficient columns are identified via the pivot of qr([1, X, C]).
On each iteration, one problematic column is dropped using
dropCollinearColumns. If iterative pruning does not achieve full rank,
falls back to ldPruneByCorrelation at a descending sequence of
correlation thresholds.
Arguments
- X
Numeric matrix with column names (the predictors subject to pruning).
- C
Numeric matrix of covariates (can be unnamed) that will be kept. Pass
NULLor a zero-column matrix when there are no covariates.- strategy
Passed through to
dropCollinearColumns.- response
Passed through to
dropCollinearColumnswhenstrategy = "response_correlation".- maxIterations
Integer. Hard cap on the iterative-prune loop. Default 300.
- corrThresholds
Numeric vector of |cor| thresholds used for the
ldPruneByCorrelationfallback, tried in order. Defaultseq(0.75, 0.5, by = -0.05).- verbose
Logical. If TRUE, print per-iteration progress. Default FALSE.
- seed
Integer or
NULL. Seeds the tie-break draw on the rare occasion that exactly two equally-collinear columns are candidates for removal (strategy = "correlation"), via a scopedwithr::local_seed, so the session RNG is left untouched.NULL(default) leaves the draw under the session RNG, so an outerset.seed()still governs it.