Robust Linear Regression

Machine Learning
Introduced by
Huber, P. J.; Rousseeuw, P. J.
Year
1964–1987
Type
Outlier-resistant supervised regression
Family
Machine learning

What does it do?

Robust linear regression fits a linear relationship between predictors and a continuous outcome while limiting the influence that outlying observations can exert on the estimates.

Instead of minimising squared residuals as ordinary least squares does, it uses loss functions that grow more slowly for large residuals, or fits the line on a subset of the data. Common approaches fall into two groups: loss-based M-estimators (Huber regression, bisquare/Tukey), usually fitted by iteratively reweighted least squares (IRLS), and subset-based or non-parametric methods (least trimmed squares, RANSAC, Theil-Sen).

The intuition behind the method

Ordinary least squares squares every residual, which means a single extreme outlier can pull the fitted line far off course. Robust regression replaces the squared-loss with a loss function that grows more slowly for large residuals — for example the Huber loss, which is quadratic near zero but linear in the tails. The result is that outlying observations receive far less influence on the coefficient estimates, making the fitted line reflect the bulk of the data rather than its extremes. The approach does not remove outliers; it simply limits their leverage.

History

M-estimation was introduced by Peter J. Huber in his 1964 paper on robust estimation. That paper treats the estimation of a location parameter under contaminated normal distributions; the use of the Huber loss in regression is a later development of the same idea. Peter J. Rousseeuw and Annick M. Leroy's 1987 monograph Robust Regression and Outlier Detection covers robust regression and outlier detection at book length. Robust regression estimators are now available in standard statistical software, including the rlm function in R's MASS package and the HuberRegressor and RANSACRegressor estimators in scikit-learn.

When to use it

Choose robust linear regression when a linear model describes most of the data well, but a minority of observations are extreme and cannot be justified as recording errors on subject-matter grounds. Typical cases are observational datasets such as clinical records, survey responses or financial series, where large values may reflect real variability rather than measurement error. Do not use it to suppress outliers that carry substantive meaning; such observations should be modelled explicitly. Avoid it when the sample is very small, because outliers are then hard to distinguish from ordinary variation and the down-weighting may be driven by noise. If the question concerns conditional quantiles rather than the central tendency of the outcome, quantile regression is the more direct choice.

Limitations and considerations

  • Robust estimators give up some efficiency relative to OLS when errors are close to Gaussian, so there is a precision cost on clean data.
  • The delta threshold of the Huber loss must be chosen relative to the residual scale: a value that is too small down-weights legitimate variation, and one that is too large leaves outliers with substantial influence.
  • Robust inference (sandwich standard errors or bootstrap) adds complexity compared with the standard OLS t-tests familiar to most readers.
  • Huber-type M-estimators have a low breakdown point in regression: a few high-leverage points in the predictors can still distort the fit. High-breakdown methods such as least trimmed squares address this at higher computational cost.
  • Methods for many predictors are less developed than regularised OLS variants such as ridge or lasso.

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

Strengths

  • Coefficients are less affected by a moderate number of outlying responses than OLS coefficients.
  • The Huber loss exposes a threshold parameter (delta) that sets the trade-off between efficiency under clean Gaussian errors and resistance to contamination.
  • The down-weighting scheme naturally identifies influential observations as a by-product of fitting.
  • IRLS retains computational similarity to OLS, keeping runtimes tractable for moderate datasets.
  • Coefficient interpretation is identical to OLS: beta represents the expected change in outcome per unit change in predictor.

Applications

  • Medical and epidemiological studies where laboratory measurements can contain extreme values.
  • Financial econometrics with fat-tailed return distributions or data entry errors.
  • Remote-sensing and geophysical data where sensor malfunctions produce occasional gross errors.
  • Social-science survey analysis where self-reported values sometimes include implausible extremes.
  • Engineering quality-control settings where production anomalies inflate residuals.
  • Any OLS analysis that shows a small number of observations with Cook's distance above 1.

How it works

How it works

1

A robust loss function is selected to limit the influence of large residuals. The Huber loss is the canonical choice: it behaves like squared error when a residual is smaller than a threshold delta and like absolute error beyond it. Delta is expressed relative to the residual scale, so residuals are usually divided by a robust scale estimate before the threshold is applied; software defaults are typically chosen to retain high efficiency under normal errors, but should be checked against the data. Other choices include the bisquare (Tukey) loss, which can completely zero out the weight of extreme observations, and the least-trimmed squares criterion used by LTS estimators.

Formula
L_{\text{Huber}}(r) = \begin{cases} \frac{1}{2}r^2 & |r| \le \delta \\ \delta(|r| - \frac{\delta}{2}) & |r| > \delta \end{cases}
2

Most M-estimators are fit by iteratively reweighted least squares (IRLS). In each iteration the current residuals, scaled by a robust estimate such as the median absolute deviation of the residuals, determine case weights: for the Huber loss the weight is one for residuals within delta and delta divided by the absolute residual beyond it. A weighted OLS problem is then solved. The process is repeated until the weights and coefficients stop changing appreciably, although convergence is not guaranteed for every loss function and starting point.

3

After fitting, standardised residuals are inspected to identify which observations were heavily down-weighted. Points with near-zero final weight are likely outliers or high-leverage cases and deserve domain-level investigation. This diagnostic step distinguishes robust regression from simple outlier deletion: the model flags anomalies without discarding them blindly.

4

The classical OLS variance formula assumes the squared-error loss, so it does not apply directly after a non-quadratic fit. Standard errors should come from a sandwich variance estimator designed for M-estimators or from a case-resampling bootstrap. Note that options such as Stata's vce(robust) are heteroscedasticity corrections for OLS standard errors and do not by themselves provide M-estimator inference. The large-sample justification of these methods depends on regularity conditions, so they are approximations when the error model is strongly violated, and a bootstrap is only appropriate if the resampling scheme reflects the structure of the data.

Common pitfalls

  • Using robust regression to hide outliers rather than investigating their substantive meaning.
  • Forgetting to use robust standard errors for inference — default OLS standard errors after IRLS are incorrect.
  • Leaving delta at its software default without checking whether it matches the actual noise scale of the dataset.
  • Conflating robustness to outliers with robustness to model misspecification — the linear functional form is still assumed.
  • Reporting only the point estimates without the final case weights, which obscures which observations were suppressed.

Frequently asked questions

How is robust linear regression different from simply removing outliers before OLS?

Outlier removal is a binary, subjective decision that permanently discards information. Robust regression down-weights influential points continuously and automatically, retains them in the dataset, and flags them for inspection, which is more transparent and reproducible.

Which variant should I choose: Huber, bisquare, RANSAC, or Theil-Sen?

Huber regression is a common starting point when outliers are moderate. Bisquare (Tukey) loss can give zero weight to extreme points and is used when contamination is heavier. RANSAC fits models to random subsets and suits data with a clear inlier structure, such as geometric or computer-vision problems. Theil-Sen is a non-parametric slope estimator based on pairwise slopes; its behaviour in small samples should be checked for the specific data rather than assumed.

Do I still need to check linearity and homoscedasticity?

Yes. Robust regression relaxes the normality-of-errors assumption and limits the damage from outliers, but it still assumes a linear relationship between predictors and outcome. Severe heteroscedasticity should be addressed separately, for example with weighted least squares or generalised linear models.

Can I use robust regression for classification?

No. Robust linear regression is a regression method for a continuous outcome. For classification under outlier contamination, consider robust logistic regression or SVMs with soft-margin formulations.

How many outliers can robust regression tolerate?

The breakdown point, the fraction of contaminated observations an estimator can tolerate before its estimates can be arbitrarily wrong, depends on the estimator. Standard Huber and bisquare M-estimators do not have high breakdown points for regression, and a few high-leverage outliers can still distort them. High-breakdown estimators such as LTS are designed for heavier contamination, at the cost of more computation and some efficiency. Whatever the estimator, a large share of contaminated observations should prompt investigation of the data-generating process before any estimate is trusted.

Related methods

Sources

  1. Huber, P. J. (1964). Robust Estimation of a Location Parameter. Annals of Mathematical Statistics, 35(1), 73–101.

    Open DOI reference
  2. Rousseeuw, P. J. & Leroy, A. M. (1987). Robust Regression and Outlier Detection. Wiley.

    ISBN: 978-0-471-85233-9