Why should this notebook be added to pymc-examples?
The gallery currently has two robust-regression notebooks:
Both protect against vertical outliers but neither defends against leverage points: observations far from the bulk of the predictor space that drag the regression line even under heavy-tailed likelihoods.
Peña, Zamar & Yan (2009) prove that this is fundamental:
-
Theorem 1: no i.i.d. error model (Normal, Student-t, Laplace, or any scale mixture of normals) can achieve formal Kullback-Leibler robustness against contamination of arbitrary size.
-
Theorem 2: a heteroscedastic Laplace model with deterministic data-driven weights $w_i \in (0, 1]$ does achieve KL-robustness.
The proposed notebook implements that method and compares it head-to-head with the Normal and Student-t baselines on three classic datasets: Animals (brain/body), CYG OB1 stars, and Hawkins-Bradu-Kass.
Related notebooks
The new notebook is complementary, not an extension or replacement. The same Animals dataset used in `GLM-robust` reappears here so readers can see the failure mode side-by-side.
References
- Peña, D., Zamar, R., Yan, G. (2009). Bayesian likelihood robustness in linear models. JSPI 139(7), 2196-2207.
- Huber, P. J. (1981). Robust Statistics. Wiley.
- Hawkins, D. M., Bradu, D., Kass, G. V. (1984). Location of several outliers in multiple-regression data using elemental sets. Technometrics 26(3), 197-208.
- Datasets:
Level
Intermediate.
Diataxis type
Explanation.
Implementation status
A complete working draft is ready locally:
- Reproduces paper Table 1 (Animals) and Table 2 (CYG OB1) Normal-model 95 % CIs to two decimals.
- PZY results match the paper qualitatively (mean slopes agree; CI widths differ slightly, likely paper's Gibbs sampler vs our NUTS).
- Three datasets exported from MASS/robustbase to CSV (28+47+75 rows total).
- Convergence diagnostics, posterior predictive check, sensitivity-to-k analysis.
- 29 cells, clean execution (no divergences, no max-tree-depth warnings).
- Dependencies: `numpy pandas pymc arviz matplotlib watermark` only.
Happy to share the current draft for early feedback if useful.
Why should this notebook be added to pymc-examples?
The gallery currently has two robust-regression notebooks:
GLM-robust.ipynb, Student-t likelihood.GLM-robust-with-outlier-detection.ipynb, Hogg (2010) signal-vs-noise mixture.Both protect against vertical outliers but neither defends against leverage points: observations far from the bulk of the predictor space that drag the regression line even under heavy-tailed likelihoods.
Peña, Zamar & Yan (2009) prove that this is fundamental:
The proposed notebook implements that method and compares it head-to-head with the Normal and Student-t baselines on three classic datasets: Animals (brain/body), CYG OB1 stars, and Hawkins-Bradu-Kass.
Related notebooks
GLM-robust, the Student-t baseline. Demonstrably vulnerable to leverage points per Theorem 1.GLM-robust-with-outlier-detection, the Hogg mixture. Also operates on the response, not on leverage.The new notebook is complementary, not an extension or replacement. The same Animals dataset used in `GLM-robust` reappears here so readers can see the failure mode side-by-side.
References
Level
Intermediate.
Diataxis type
Explanation.
Implementation status
A complete working draft is ready locally:
Happy to share the current draft for early feedback if useful.