- Introduced by
- William S. Cleveland
- Year
- 1979
- Type
- Local nonparametric regression smoother
What does it do?
LOESS (locally weighted scatterplot smoothing) is a family of local regression smoothers developed by William S. Cleveland.
His 1979 paper introduced robust locally weighted regression for smoothing scatterplots, and Cleveland and Susan J. Devlin extended it in 1988 into a general multivariate method for local fitting, which they called loess. The method fits a separate weighted low-degree polynomial in the neighbourhood of each point, so nearby observations count more than distant ones and no global functional form is assumed.
The intuition behind the method
Rather than fitting one equation to all the data, LOESS asks a local question at every point: 'using just the observations near here, what low-order polynomial fits best?' Points close to the target get high weight and far points little or none, so the fit adapts to whatever the curve is doing locally — rising here, flattening there. Sliding this local window across the range traces out a smooth curve. Because it never commits to a global shape, it can reveal nonlinear patterns you would otherwise have to guess and impose.
History
William S. Cleveland introduced robust locally weighted regression for smoothing scatterplots in a 1979 Journal of the American Statistical Association paper. In 1988, Cleveland and Susan J. Devlin presented locally weighted regression, or loess, as a multivariate smoothing procedure for data exploration, diagnostic checking of parametric models, and nonparametric regression surfaces.
When to use it
Use LOESS as an exploratory smoother when you want to see how a response varies with one or two predictors without assuming a functional form, for example to add a trend line to a scatterplot, to smooth a noisy series, or to check fitted residuals for remaining nonlinear structure. The robust variant is the better choice when a few extreme observations may distort the local fits. Do not use LOESS when you need a compact, interpretable equation, when you have many predictors (local neighbourhoods become sparse), or when you need predictions beyond the range of the data. For several predictors, additive models with splines are generally more practical.
Limitations and considerations
- Every evaluation point needs its own weighted regression, so computation grows with the number of points at which the curve is evaluated.
- The local neighbourhoods become sparse in high dimensions, so the method is practical only for one or two predictors.
- The output is a set of local fits rather than a compact equation, and predictions outside the data range are unreliable.
- The fitted curve depends strongly on the span: a large span oversmooths real features, while a small one follows noise.
- The method assumes that a low-degree polynomial approximates the curve well within each neighbourhood, and that each neighbourhood contains enough points for a stable weighted fit.
- Cleveland and Devlin (1988) introduce statistical procedures analogous to least-squares fitting of parametric models, but the smoothed curve is not an exact parametric fit. Check the software documentation for how any standard errors or confidence bands are computed before treating them as exact.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Makes no global assumption about the shape of the relationship, so it can follow local curvature that a single polynomial would miss.
- Well suited to visual exploration, since the smoothed points can be drawn over a scatterplot to show the trend.
- The robust iterations reduce the influence of deviant points on each local fit.
- The same local-fitting approach supports diagnostic checks of parametric models, as Cleveland and Devlin describe.
Applications
- Adding a smooth trend line to a scatterplot for exploratory analysis.
- Smoothing noisy time series to reveal the underlying trend.
- Inspecting regression residuals for remaining nonlinear structure.
- Providing a nonparametric regression surface for one or two predictors.
- Smoothing measurements to make trends visible in graphical displays.
How it works
How it works
To estimate the curve at a target point x₀, take a fixed fraction α of the data nearest to x₀. This fraction is the span (or bandwidth) and is the main tuning choice. A larger span uses more neighbours and gives a smoother, more biased curve; a smaller span follows local detail at the cost of more variance.
Formula
\text{for target } x_0,\ \text{select fraction } \alpha\ \text{nearest points (the span)}Within the neighbourhood, observations are weighted by their distance from x₀ using the tricube function, W(u) = (1 − u³)³ for u < 1. The closest points dominate, and the weight falls to zero at the edge of the window. This smooth tapering is what makes the resulting curve continuous.
Formula
w_i(x_0) = W\!\left(\dfrac{|x_i - x_0|}{d(x_0)}\right),\ W(u)=(1-u^3)^3_{+}\ \text{(tricube)}A weighted least-squares fit of a low-degree polynomial (for example linear or quadratic) is made to the neighbourhood, and its prediction at x₀ becomes the smoothed value there. Repeating this local fit across a grid of target points produces the full LOESS curve.
Formula
\min_{\beta} \sum_i w_i(x_0)\big(y_i - \beta_0 - \beta_1 (x_i-x_0) - \cdots\big)^2An optional robust variant performs extra iterations that down-weight points with large residuals using a bisquare function and refits. As Cleveland's 1979 paper describes, this guards against deviant points distorting the smoothed curve, which is useful for data with occasional extreme observations.
Formula
\text{reweight by bisquare of residuals and refit (optional iterations)}Common pitfalls
- Choosing the span by eye, which can oversmooth genuine features or leave noise in the curve. Cleveland and Devlin's M plot, an adaptation of Mallows's Cp, is one graphical way to weigh bias against variance.
- Extrapolating the curve beyond the observed range, where each neighbourhood is one-sided and the local fits carry no information about the unobserved region.
- Reading the curve near the ends of the data range, where neighbourhoods also lie on one side of the target. The local fit there rests on less balanced information and is typically more biased, so the edges of the curve deserve extra caution.
- Applying LOESS to several predictors without accounting for sparsity, which leaves most local neighbourhoods with too few points to fit.
- Using the non-robust version on data with outliers, where a few extreme points can distort the local regressions.
Frequently asked questions
What is the span in LOESS?
The span (or bandwidth) is the fraction of the data used in each local regression. A larger span produces a smoother but more biased curve; a smaller span captures more local detail but is noisier. It is the primary tuning parameter. Cleveland and Devlin (1988) describe a graphical M plot, based on Mallows's Cp, to help choose how much smoothing to apply.
What is the difference between LOESS and LOWESS?
The two names are often used interchangeably. Cleveland's 1979 paper introduced robust locally weighted regression for smoothing scatterplots, the procedure usually known as LOWESS. The term loess appears in Cleveland and Devlin's 1988 paper for the broader multivariate local-fitting procedure.
Why shouldn't I use LOESS with many predictors?
LOESS relies on having enough neighbouring points near each target. In high dimensions the data become sparse, so neighbourhoods are either nearly empty or so large that they are no longer local, and the method breaks down. It is best limited to one or two predictors. For more predictors, additive models with splines or other scalable methods are more practical.
Related methods
Sources
Cleveland, W. S. (1979). Robust locally weighted regression and smoothing scatterplots. Journal of the American Statistical Association, 74(368), 829–836.
Open DOI referenceCleveland, W. S., & Devlin, S. J. (1988). Locally weighted regression: an approach to regression analysis by local fitting. Journal of the American Statistical Association, 83(403), 596–610.
Open DOI referencenlme, p. ?