Bayesian Robust Regression

Statistics
Introduced by
Geweke (1993); Gelman et al. (2013)
Year
1993
Type
Bayesian regression with heavy-tailed errors
Family
Regression / GLM

What does it do?

Bayesian Robust Regression replaces the Gaussian error assumption of ordinary linear regression with a heavy-tailed distribution, most commonly the Student-t, and estimates all parameters within a Bayesian framework.

Because heavy tails limit how far any single observation can pull the fitted line, coefficient estimates are less distorted by outliers, and the posterior distributions give credible intervals that reflect the remaining uncertainty.

The intuition behind the method

In ordinary regression every residual, no matter how extreme, pulls the fitted line toward it with comparable force. Replacing the normal error with a Student-t distribution gives each observation an adaptive weight: points close to the line keep most of their influence, while points far from it, the potential outliers, are down-weighted. Bayesian inference then propagates uncertainty, including uncertainty about how heavy the tails should be, into the posterior distributions of the coefficients, so the credible intervals reflect what the data can and cannot tell you.

History

The Bayesian treatment of regression with Student-t errors was given a tractable form by Geweke (1993), who used the equivalence between the Student-t distribution and an appropriate scale mixture of normals together with a Gibbs sampler. Gelman et al.'s Bayesian Data Analysis is cited as a general textbook reference for Bayesian modelling rather than as the origin of this method. The approach is now supported in Stan, PyMC, and brms, which makes it a routine alternative to OLS when outlier robustness and full uncertainty quantification are both needed.

When to use it

Choose this method when the outcome is continuous, when outliers or heavy-tailed errors are plausible enough to distort an OLS fit, and when you want posterior distributions for the coefficients rather than point estimates alone. It is useful in small samples, where a few extreme values can dominate the fit, and when prior knowledge about the coefficients is available to include. Extreme values are scientifically plausible in fields such as finance, environmental science and clinical measurement. Do not use it when the Gaussian assumption holds and simplicity or computation matter more, since OLS is then adequate. It is also a poor fit for discrete or censored outcomes, and caution is needed when the tail behaviour of the data is unknown and no sensible prior for nu can be justified, because nu is then weakly determined by the data.

Limitations and considerations

  • Computationally more expensive than OLS: MCMC sampling can be slow for large datasets or many predictors.
  • Results depend on prior choices for nu and sigma; poorly chosen priors can dominate in small samples.
  • Interpretation requires familiarity with posterior distributions and credible intervals, which may be unfamiliar to audiences trained only in frequentist methods.
  • Does not select variables; a separate regularisation strategy or spike-and-slab prior is needed for sparse settings.
  • Convergence of MCMC chains must be diagnosed (R-hat, trace plots), adding workflow overhead compared to OLS.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Automatically down-weights outliers through the heavy-tailed Student-t likelihood, protecting coefficient estimates without ad hoc data cleaning.
  • Provides full posterior distributions for all parameters, giving credible intervals rather than asymptotic confidence intervals.
  • The degrees-of-freedom parameter nu is estimated from the data, so the model learns how heavy the tails are rather than assuming a fixed value.
  • Allows prior information on the coefficients to stabilise estimates when the sample is small and some coefficients are weakly determined by the data.
  • Via the scale-mixture representation, inference is tractable with standard MCMC samplers and modern probabilistic programming languages.

Applications

  • Financial return modelling, where fat-tailed residuals are the norm and outlier contamination is frequent.
  • Clinical and biomedical research with small samples that may include physiologically extreme measurements.
  • Environmental and geophysical data analysis where extreme events produce heavy-tailed residuals.
  • Social science surveys with influential respondents or recording errors that produce outlying values.
  • Any domain where a researcher wishes to combine prior knowledge with outlier-robust coefficient estimation.

How it works

How it works

1

The model posits that each observation equals a linear predictor plus an error drawn from a Student-t distribution with location zero, scale sigma, and degrees of freedom nu. Here sigma is a scale parameter, not the standard deviation: for nu > 2 the standard deviation is sigma times the square root of nu/(nu-2), and for nu <= 2 the variance is infinite. Small nu (e.g. 3-5) produces heavy tails, and the tails become extremely heavy as nu approaches 2 or falls below it; as nu grows, the error distribution approaches the normal and the model approaches Gaussian regression.

Formula
y_i = X_i\beta + \varepsilon_i,\quad \varepsilon_i \sim t_\nu(0,\sigma)
2

Prior distributions are placed on the regression coefficients beta, the error scale sigma (equivalently sigma-squared), and the degrees of freedom nu. Weakly informative choices (e.g. normal priors on beta, half-Cauchy on sigma, exponential or gamma on nu) are typical and let the data dominate when the sample is reasonably informative.

Formula
\beta \sim p(\beta),\quad \sigma^2 \sim p(\sigma^2),\quad \nu \sim p(\nu)
3

The Student-t likelihood is written as a scale mixture of normals: each observation i receives a latent weight lambda_i drawn from a Gamma distribution with shape nu/2 and rate nu/2 (mean 1). Conditional on these weights, each error is normal with variance sigma-squared divided by lambda_i, so the model reduces to a weighted normal regression and Gibbs sampling or HMC becomes straightforward.

Formula
\varepsilon_i | \lambda_i \sim N(0, \sigma^2/\lambda_i),\quad \lambda_i \sim \text{Gamma}(\text{shape}=\nu/2,\ \text{rate}=\nu/2)
4

Bayes' theorem combines the likelihood and all priors into a joint posterior over beta, sigma-squared, nu, and the observation-level weights. Posterior values of lambda_i tend to be larger for points that fit the line and smaller for points with large residuals, so outliers are automatically down-weighted during estimation.

Formula
p(\beta,\sigma^2,\nu,\lambda_{1:n}\mid y) \propto p(y\mid\beta,\sigma^2,\lambda_{1:n})\,p(\lambda_{1:n}\mid\nu)\,p(\beta)\,p(\sigma^2)\,p(\nu)
5

The joint posterior is explored with Markov chain Monte Carlo. Geweke (1993) used a Gibbs sampler that exploits the Gaussian mixture structure. Conditional on the weights, beta and sigma-squared have the standard weighted-regression updates, and each lambda_i has a Gamma full conditional with shape (nu+1)/2 and rate (nu + r_i^2/sigma^2)/2, where r_i is the residual of observation i. The conditional for nu is not of standard form, so it is updated with a separate step such as a Metropolis or grid step. Modern implementations often use HMC via Stan or PyMC, which does not require these conditionals. Posterior summaries (means, medians, credible intervals) take the place of classical point estimates and p-values.

Formula
\lambda_i \mid \cdot \sim \text{Gamma}\!\left(\tfrac{\nu+1}{2},\ \tfrac{\nu + r_i^2/\sigma^2}{2}\right),\quad r_i = y_i - X_i\beta

Common pitfalls

  • Fixing nu to a single value chosen without domain justification, rather than estimating it from the data: a misspecified nu can leave the model either too sensitive or too insensitive to outliers.
  • Using flat or improper priors on nu: without a sensible prior the sampler may drift to extreme values, slowing convergence.
  • Neglecting MCMC diagnostics: accepting results from non-converged chains leads to unreliable posterior summaries.
  • Confusing down-weighting with deletion: the model reduces outlier influence but does not remove observations, so unusual points still inform the posterior.
  • Applying the method to discrete or censored outcomes, where the Student-t likelihood is inappropriate; use the corresponding Bayesian GLM variant instead.

Frequently asked questions

How does Bayesian Robust Regression differ from frequentist M-estimation?

Both approaches reduce the influence of large residuals. M-estimation does this by choosing a loss function directly and returns point estimates with asymptotic standard errors. Bayesian robust regression instead specifies a heavy-tailed error model and returns full posterior distributions for the coefficients and for nu, so credible intervals and prior information can be incorporated.

What prior should I use for the degrees-of-freedom parameter?

A weakly informative prior on nu is a common starting point: it lets the data identify the tail weight while ruling out implausible extremes. Fixing nu is discouraged unless domain knowledge justifies a specific tail weight. Because the result can depend on this choice, a sensitivity analysis over reasonable priors is advisable.

Can I use this model for large datasets?

Yes, but full MCMC can be slow. Variational inference, such as the ADVI algorithm in Stan, is a faster approximation, though it may understate posterior uncertainty. For very large samples where outliers are not a concern, OLS with heteroscedasticity-robust standard errors may be more practical.

Does down-weighting outliers mean the model ignores them?

No. Down-weighting reduces an outlier's pull on the regression line, but the observation still enters the likelihood and informs the posterior for all parameters, including nu. The model learns from outliers; it just does not let them dominate the fit.

How do I check whether the robust model fits better than OLS?

Compare models using leave-one-out cross-validation (LOO-CV) via the loo R package or arviz in Python, or using the widely applicable information criterion (WAIC). Both estimate expected log predictive density, where a higher value indicates better predictive fit. Judge the difference between models against its standard error before concluding that one is better.

Related methods

Sources

  1. Geweke, J. (1993). Bayesian treatment of the independent Student-t linear model. Journal of Applied Econometrics, 8(S1), S19–S40.

    Open DOI reference
  2. Gelman, A., Carlin, J. B., Stern, H. S., Dunson, D. B., Vehtari, A., & Rubin, D. B. (2013). Bayesian Data Analysis (3rd ed.). CRC Press.

    ISBN: 978-1439840955