Least Median of Squares (LMS) Regression

Statistics
Introduced by
Peter J. Rousseeuw
Year
1984
Type
Robust linear regression

What does it do?

Least Median of Squares (LMS) is a robust linear regression method introduced by Peter J. Rousseeuw in 1984.

Instead of minimising the sum of squared residuals as ordinary least squares does, it minimises the median of the squared residuals. The original paper shows that this lets the estimator resist contamination by nearly 50% of the observations.

The intuition behind the method

Ordinary least squares lets a single far-away point drag the whole line toward it, because squaring residuals gives very large weight to large errors. LMS instead asks which line keeps the typical (median) squared error as small as possible. Because the median ignores the largest residuals, nearly half of the data can be badly off without moving the fit, so the line tracks the bulk of the well-behaved points.

History

Least Median of Squares was proposed by Peter J. Rousseeuw in 1984 in the Journal of the American Statistical Association. Many earlier robust regression methods replaced the squared residual with another function, such as the absolute value; LMS instead replaces the sum of squared residuals with their median. In simple regression the resulting fit corresponds to finding the narrowest strip that covers half of the observations, and the approach has been generalised to multivariate location, orthogonal regression and hypothesis testing in linear models.

When to use it

Choose LMS when you need to model a continuous outcome linearly and suspect that a substantial share of the observations may be outliers, so that least squares would be pulled toward them. It assumes the linear model is appropriate for the bulk of the data, so checking the model specification is still necessary. Do not use it when the data are clean and the goal is precise estimation, because least squares will give more efficient coefficients. Do not treat an LMS fit as the final model for inference; use it to identify outliers and to check a least-squares or trimmed fit, as described under limitations.

Limitations and considerations

  • Lower statistical efficiency than least squares on clean data, because the median discards information carried by most of the residuals.
  • No closed-form solution; the estimate comes from a search over candidate fits, which is computationally heavier than least squares and can be approximate in practice.
  • Standard least-squares inference does not carry over directly to LMS coefficients. The objective is nondifferentiable and the estimate comes from a search, so the usual standard-error and test formulas are not derived for it. Report inference from a least-squares refit on the cleaned data or from a reweighted or trimmed estimator.

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

Strengths

  • Very high breakdown point: the estimate can tolerate contamination of nearly 50% of the observations before it can be forced toward an arbitrary value.
  • Extreme residuals have no direct influence on the objective, because only the median squared residual enters it. Ordinary least squares, by contrast, lets every large residual add its square to the total.
  • The robustness comes from the form of the objective rather than from a distributional assumption, so no normality of the errors is needed.

Applications

  • Fitting a linear relationship when a large fraction of the observations may be contaminated by outliers.
  • Detecting outliers and influential points by comparing observations against a fit that is not distorted by them.
  • Providing a robust baseline model for continuous outcomes where ordinary least squares would be unduly influenced by anomalies.

How it works

How it works

1

The outcome y is modelled as a linear function of the predictors X plus an error term ε, exactly the same linear form used in classical regression. The coefficients β describe how each predictor relates to the outcome.

Formula
y = X\beta + \varepsilon
2

LMS chooses the coefficients β̂ that minimise the median of the squared residuals, med_i r_i². Only the middle value of the squared residuals enters the objective, so the points lying furthest from the bulk of the data have no direct effect on the fit, as long as they make up less than about half of the sample. The objective has no closed-form solution, so the estimate is found by searching over candidate fits.

Formula
\hat{\beta} = \arg\min_{\beta}\; \operatorname{med}_i\, r_i^2(\beta), \quad r_i = y_i - x_i^{\top}\beta

Common pitfalls

  • Reporting LMS coefficients with OLS-style standard errors, t-tests or confidence intervals, which do not apply directly to a search-based robust fit.
  • Applying LMS to clean data and accepting an efficiency loss that least squares would not impose.
  • Treating LMS coefficients as final efficient estimates rather than as a robust fit used to flag outliers and to check the least-squares result.
  • Reading the 50% breakdown point as a guarantee for any dataset. It is the maximum share of contamination the estimator can tolerate; it does not establish that the linear model is correct.

Frequently asked questions

How is LMS different from ordinary least squares?

OLS minimises the sum of squared residuals, so a few large errors dominate and outliers can dictate the fit. LMS minimises the median of the squared residuals, so the most extreme residuals are ignored and the line follows the bulk of the data.

What does the 50% breakdown point mean?

It means that up to nearly half of the observations can be arbitrary outliers before the LMS fit can be forced to take an arbitrary value. By contrast, a single extreme point can dominate an ordinary least-squares fit.

Why is LMS less efficient than least squares?

Relying on the median rather than on all residuals throws away information when the data are clean, so on outlier-free data LMS estimates are noisier than least-squares estimates. The trade is robustness for efficiency.

What should I do when the sample is very small?

The LMS objective is determined by the median squared residual, so with few observations there are few values from which that median is formed, and the fit should be treated as tentative. Compare it with the OLS fit on the same data; if the two disagree, examine which observations drive the difference before drawing conclusions. The least-trimmed squares estimator, which also discards large residuals and then fits least squares to the remaining points, is a related option to compare.

Related methods

Sources

  1. Rousseeuw, P. J. (1984). Least Median of Squares Regression. Journal of the American Statistical Association, 79(388), 871-880.

    Open DOI reference
  2. Hampel, F. R., Ronchetti, E. M., Rousseeuw, P. J., & Stahel, W. A. (1986). Robust Statistics: The Approach Based on Influence Functions. Wiley.

    ISBN: 978-0471735779