Robust Regression
Outliers, Huber loss, quantile regression and breakdown points.
One bad point can drag a least-squares fit anywhere it likes. Robust regression asks how many bad points an estimator can survive, and what that protection costs when the data are clean. This lesson builds the answers: Huber's loss and its reweighted fitting algorithm, least absolute deviations and quantile regression, high-breakdown fits and RANSAC, and estimators made for heavy tails.
What you’ll learn
- Define the breakdown point, and show that least squares, least absolute deviations and Huber regression all break down with a single bad leverage point.
- Derive M-estimators from their -functions, compute the efficiency of Huber's estimator and of the median at the normal, and fit M-estimators by iteratively reweighted least squares.
- Prove that the pinball loss is minimized by a quantile, and use quantile regression to model data whose spread varies.
- Compare high-breakdown methods (LMS, LTS, MM, RANSAC), and prove the median-of-means deviation bound for heavy-tailed data.
How fragile is least squares?
Contamination comes in two kinds of outliers. A vertical outlier has an ordinary and a wild . A bad leverage point has an unusual and a that disagrees with the rest, and it is the more dangerous kind, because its high leverage lets it pull the fit toward itself and hide its own residual. To compare estimators, ask how much contamination they can absorb.
For least squares, changing one response by moves the coefficients by exactly , which is unbounded in , so : a single point suffices, and the asymptotic breakdown point is 0. The sample mean behaves the same way, while the sample median survives until about half the points are replaced. No regression-equivariant estimator can do better than roughly one half: beyond that, the "contamination" is the majority and becomes the data.
M-estimators and Huber's loss
Replace the square by a loss that grows more slowly, and scale the residuals by a robust estimate of the noise level:
with . Least squares has , unbounded: a residual's pull grows without limit. Least absolute deviations has . The Huber loss interpolates: quadratic near zero, linear in the tails,
A common scale is the median absolute deviation of the residuals of a preliminary robust fit, divided by , which estimates consistently for Gaussian noise.
At the standard normal, Huber's estimator with is 95% efficient relative to the mean. What is the efficiency of the sample median (the least-absolute-deviations estimate of location)?
Show the answer
64 %
For , and (the jump of the sign function, weighted by the density at 0). So and the efficiency is : the median needs about 57% more Gaussian data than the mean for the same precision, the price of its 50% breakdown point in the location problem.
Write the estimating equation as a weighted least-squares equation, with weights that depend on the current residuals :
Freeze the weights and solve the weighted normal equations; recompute residuals and weights; repeat. Points with large residuals are down-weighted in proportion to their excess:
Why it descends: if with concave (equivalently, is nonincreasing in , as for Huber), the tangent line of gives a quadratic upper bound that touches at the current residual. Each IRLS step minimizes the sum of these bounds, so the objective never increases: IRLS is a majorize–minimize algorithm. For a convex such as Huber's, it converges to the global minimizer under mild conditions.
Least absolute deviations and quantile regression
Least absolute deviations (LAD), , estimates a conditional median instead of a mean; Boscovich used a version of it in the 1750s, half a century before least squares. Tilting the absolute value gives every other quantile. The pinball (check) loss at level is
and recovers LAD.
Let have a continuous distribution function and consider the expected loss of predicting . Split it at :
Differentiate under the expectation. Raising lowers the loss on the points above it and raises it on the points below:
is convex and its derivative vanishes where : the minimizer is the -quantile. Conditioning on turns this into the conditional quantile, which is what quantile regression estimates.
Quantile regression (Koenker & Bassett, 1978) fits for each level of interest. It is a linear program, and some solution passes exactly through of the data points (a vertex of the feasible region). Its strengths:
- Heteroscedasticity becomes signal. If the spread of grows with , the fitted lines for fan out, describing the whole conditional distribution rather than its mean alone.
- Robustness in . Like LAD, it ignores how far a point lies beyond the line, only on which side.
- Equivariance. Quantiles commute with increasing transformations, ; means do not.
Separately fitted quantile lines can cross in finite samples, which is a known nuisance. With i.i.d. errors of density , is asymptotically normal with covariance , so extreme quantiles, where data are sparse, are estimated less precisely.
Think first A retailer forecasts demand with the pinball loss at . How many times more does an under-forecast of one unit cost than an over-forecast of one unit, and why would anyone want that?
times. Running out of stock is costly, so the forecast should sit at the level that demand exceeds only 10% of the time. The asymmetric loss turns "forecast the 90th percentile" into a minimization problem, and the same logic sets any quantile from the ratio of the two costs.
High breakdown: LMS, LTS, MM and RANSAC
To survive close to half the data being arbitrary, including bad leverage points, an estimator must be able to ignore points entirely. Rousseeuw (1984) proposed two such estimators:
- Least median of squares (LMS) minimizes . Geometrically, in simple regression it finds the narrowest strip that covers half of the points. Its breakdown point is about 50%, the maximum possible, but it is statistically inefficient.
- Least trimmed squares (LTS) minimizes the sum of the smallest squared residuals, with about : least squares on the best-fitting half, chosen by the estimator itself. It keeps the 50% breakdown point and behaves better statistically, which is why LTS is usually preferred.
Both objectives are non-convex and combinatorial. Practical algorithms start from many random elemental fits through points and improve each by concentration steps: refit least squares on the points with the smallest current residuals, which can never increase the LTS objective. MM-estimators (Yohai, 1987) then recover efficiency: start from a high-breakdown fit and its robust scale, and finish with an M-estimate using a redescending , achieving breakdown point 0.5 together with high efficiency (85–95% are common targets) at the normal.
RANSAC (Fischler & Bolles, 1981), the workhorse of computer vision, takes the elemental-subset idea all the way. Repeat: sample points (the minimum needed to determine the model, for a hyperplane), fit them exactly, and count the inliers, the points within a threshold of the fit. Keep the model with the largest consensus set, then refit on its inliers. If a fraction of the data are outliers, one sample is all inliers with probability , so the number of trials needed to succeed with probability satisfies
RANSAC fits a line ( points per sample) to data in which half the points are outliers (). How many random samples guarantee at least a 99% chance that one of them is outlier-free?
Show the answer
17 samples
One sample is clean with probability , so , hence 17 samples. A plane () needs 35 and a 4-point model 72: the count grows exponentially in , which is why RANSAC suits low-dimensional geometric models.
| Estimator | Breakdown point in regression | Efficiency at the normal | Convex? |
|---|---|---|---|
| Least squares | 100% | yes | |
| LAD / quantile regression | (leverage points) | (LAD) | yes (a linear program) |
| Huber, | (leverage points) | 95% | yes |
| LMS | about 50% | low | no |
| LTS, | about 50% | low unless followed by a reweighting step | no |
| MM (Yohai) | 50% | tunable, e.g. 85–95% | no |
Heavy tails: median-of-means
Sometimes nothing is "wrong" with any point: the noise simply has heavy tails, with finite variance but rare enormous values. Then the question is not breakdown but how fast the error concentrates. For the sample mean, a variance bound alone gives only Chebyshev's guarantee, with probability at least , which deteriorates quickly for small . Splitting the data and taking a median repairs the dependence on .
Each block mean has variance , so by Chebyshev's inequality it misses by more than with probability at most :
The median misses by more than only if at least half of the block means do. The number of bad blocks is a sum of independent indicators with mean at most , so Hoeffding's inequality bounds the chance that it reaches :
Choose , so that , and substitute :
At , Chebyshev guarantees the sample mean only within , while median-of-means guarantees under the same assumption. (For moderate such as , the loose constant 32 makes the simple bound no better than Chebyshev's; the gain is in the dependence.) That dependence is optimal: a lower bound due to Devroye, Lerasle, Lugosi & Oliveira shows that no estimator can guarantee better than order for all distributions with variance (see the survey of Lugosi & Mendelson, 2019). For least-squares regression, a generalized median-of-means estimator reaches a constant-factor approximation of the best achievable squared loss from about samples (up to logarithmic factors), assuming only bounded low-order moments and without assuming bounded or sub-Gaussian features or noise (Hsu & Sabato, 2016).
Key takeaways
- The breakdown point is the smallest fraction of arbitrary points that can carry an estimate anywhere. Least squares breaks down with one point; the median and high-breakdown regression estimators survive close to half.
- M-estimators replace the square by with bounded . Huber's loss with keeps 95% efficiency at the normal (the median keeps ) and is fitted by iteratively reweighted least squares, a majorize–minimize scheme. Bounded still does not stop bad leverage points.
- The pinball loss is minimized by the -quantile; quantile regression is a linear program that describes how the whole conditional distribution changes with .
- LMS and LTS reach 50% breakdown by ignoring points, MM-estimators add efficiency, and RANSAC needs about random samples.
- For heavy tails, median-of-means achieves under a variance bound alone, the optimal dependence.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
What are the (asymptotic) breakdown points of the sample mean and the sample median as estimates of location?
- 0 and 1/2
- 1/2 and 1/2
- 0 and 1
- 1/n and 1/n
Show the answer
A. 0 and 1/2
Moving a single point far enough moves the mean as far as you like: breakdown . The median stays within the range of the uncontaminated points until about half of them are replaced: breakdown , the best possible for an equivariant estimator.
Huber regression is applied to data with one point far out in whose response is badly wrong. What happens?
- Huber's loss caps that point's influence, so the fit is safe
- The point is automatically removed because its residual exceeds
- The fit can still be dragged arbitrarily far: the point's leverage tilts the line toward it, and its large multiplies even a clipped
- Huber regression fails to converge
Show the answer
C. The fit can still be dragged arbitrarily far: the point's leverage tilts the line toward it, and its large multiplies even a clipped
Huber's bounds the effect of large residuals, but the estimating equation weights each by , and a high-leverage point keeps its own residual small by pulling the fit. Regression M-estimators with monotone have breakdown point ; LTS, MM-estimators or RANSAC are needed.
A quantile regression with is fitted to house prices. What does the fitted value estimate?
- The average price of houses with features , plus 90%
- The price that 90% of houses with features fall below
- The price predicted with 90% confidence
- The price after removing the most expensive 10% of houses from the data
Show the answer
B. The price that 90% of houses with features fall below
The pinball loss at level is minimized by the -quantile, so the fit estimates the conditional 90th percentile of price given . Comparing fits at several shows how the whole conditional distribution shifts and spreads with .
For heavy-tailed data with finite variance, what does median-of-means improve over the sample mean's Chebyshev guarantee?
- It removes the dependence on
- It converges at rate instead of
- It needs no assumptions at all on the distribution
- The dependence on the failure probability: instead of
Show the answer
D. The dependence on the failure probability: instead of
Both scale as . Median-of-means achieves , the sub-Gaussian shape, versus Chebyshev's , a dramatic gain for small , and the order cannot be improved in general.
Further reading
- P. J. Huber, "Robust estimation of a location parameter," Annals of Mathematical Statistics 35(1), 73–101 (1964).
- R. Koenker & G. Bassett, "Regression quantiles," Econometrica 46(1), 33–50 (1978).
- P. J. Rousseeuw, "Least median of squares regression," Journal of the American Statistical Association 79(388), 871–880 (1984).
- M. A. Fischler & R. C. Bolles, "Random sample consensus: a paradigm for model fitting with applications to image analysis and automated cartography," Communications of the ACM 24(6), 381–395 (1981).
- G. Lugosi & S. Mendelson, "Mean estimation and regression under heavy-tailed distributions: a survey," Foundations of Computational Mathematics 19(5), 1145–1190 (2019).