Skip to content

New notebook: Heteroscedastic Bayesian robust regression (Peña, Zamar, Yan 2009) #873

Description

@anevolbap

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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions