Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

name: regression-collinearity
description: Variance inflation factors on a fitted regression — VIF and tolerance per term, the generalized VIF (GVIF and GVIF^(1/(2 df))) for a multi-column term such as a one-hot block, read off the fit's own weighted design or the predictors alone, execution and the refusals. Topical design; per-model params in atomic op-reg-* skills.
type: guide
kind: design
applies_to: process, compose, predict
covers: [collinearity, multicollinearity, VIF, GVIF, variance inflation factor, tolerance, car vif, regressions]

Regression collinearity (VIF)

collinearity reports how much each term’s coefficient variance is inflated by its overlap with the other predictors, on the fit itself — R car::vif(model), Stata estat vif.

For a candidate predictor set with no model yet, use MAT_COLLINEARITY instead (same VIF, plus Belsley’s diagnostics).

{"cohort": {"filename": "subscribers.pulse"},
 "features": [{"type": "FEAT_ONE_HOT", "field": "plan"}],
 "regressions": [{"type": "REG_GLM", "family": "binomial", "target": "churned",
  "predictors": ["late_payment", "plan_plus", "plan_pro"],
  "collinearity": {"groups": [{"name": "plan", "predictors": ["plan_plus", "plan_pro"]}]}}]}

"collinearity": {} = every predictor its own term, basis model. Absent = no collinearity output.

Knobs

KeyValuesDefaultMeaning
basismodel, predictorsmodelmodel: the fit’s centered XᵀWX at the fitted weights (a GLM’s IRLS working weights) — car::vif on the fit. predictors: the prior-weighted predictor correlation alone, as if the model were linear. On OLS the two are one matrix.
groups[{name, predictors}]noneColumns judged together as one term (a one-hot block’s dummies, a spline basis). Every other predictor is its own term.

Output

regressions[i].collinearity: basis, terms (order: a group at its first predictor), then maps keyed by term — vif, tolerance (1/vif), df (columns), and gvif_scaled = vif^(1/(2·df)) when groups is set. A group’s vif is Fox & Monette’s generalized VIF det(R_SS)·det(R_−S)/det(R); compare groups of different df through gvif_scaled (√vif for one column). Unbanded: 5 / 10 are rules of thumb. Rides the standard preset.

Design, not estimator

The VIF reads the design only: a penalty (OLS), bounds, a robust covariance, resample or holdout leave the figures as the plain fit’s on the same rows. Dispersion and the sandwich never enter. Weights enter as the fit’s prior weights; frequency = the rep() expansion, and both kinds give the same figures (scale-free).

Execution

OLS reads its streaming moments, so it streams and merges with the fit. A GLM is buffered anyway: one pass over the fitted rows after IRLS. Identical across decode / shard worker counts.

Refusals

PROCESSING_CONFIG, details.requires, the same at predict and run:

Causerequires
bad basisbasis model or predictors
a group with no name / a non-predictor or repeated member / a clashing namea group name / a predictor / a unique term name
intercept: falseintercept
selectionno_selection
a GLM penalty on basis modelunpenalized (or set basis predictors)
fewer than two termstwo_or_more_terms
REG_BAYES_LINEAR, an extension or model regressiontype REG_OLS or REG_GLM

Against R

Pinned to car::vif 3.1-5 on R 4.6.1 at 1e-10 (OLS, logit, poisson, negative binomial, gamma; grouped terms; both bases; frequency and probability weights): oracle vif.json.

See