Lably
Skip to content

Local regression

Moving average and polynomial regression method for smoothing data

  • 16 min read
  • 5 chapters

Related on Lably

Through Moving average, K-nearest neighbors algorithm and Linear least squares

LOESS and LOWESS thus build on "classical" methods, such as linear and nonlinear least squares regression. They address situations in which the classical procedures do not perform well or cannot be effectively applied without undue labor. LOESS combines much of the simplicity of linear least squares regression with the flexibility of nonlinear regression. It does this by fitting simple models to localized subsets of the data to build up a function that describes the deterministic part of the variation in the data, point by point. In fact, one of the chief attractions of this method is that the data analyst is not required to specify a global function of any form to fit a model to the data, only to fit segments of the data.

The trade-off for these features is increased computation. Because it is so computationally intensive, LOESS would have been practically impossible to use in the era when least squares regression was being developed. Most other modern methods for process modelling are similar to LOESS in this respect. These methods have been consciously designed to use current computational ability to the fullest possible advantage to achieve goals not easily achieved by earlier approaches.

A smooth curve through a set of data points obtained with this statistical technique is called a loess curve, particularly when each smoothed value is given by a weighted quadratic least squares regression over the span of values of the y-axis scattergram criterion variable. When each smoothed value is given by a weighted linear least squares regression over the span, this is known as a lowess curve. However, some authorities treat lowess and loess as synonyms.

History

Local regression and closely related procedures have a long and rich history, having been discovered and rediscovered in different fields on multiple occasions. An early work by Robert Henderson studying the problem of graduation (a term for smoothing used in Actuarial literature) introduced local regression using cubic polynomials.

Specifically, let Yj denote an ungraduated sequence of observations. Following Henderson, suppose that only the terms from Y−h to Yh are to be taken into account when computing the graduated value of Y0, and Wj is the weight to be assigned to Yj. Henderson then uses a local polynomial approximation a+bj+cj2+dj3, and sets up the following four equations for the coefficients:

∑j=−hh(a+bj+cj2+dj3)Wj=∑j=−hhWjYj∑j=−hh(aj+bj2+cj3+dj4)Wj=∑j=−hhjWjYj∑j=−hh(aj2+bj3+cj4+dj5)Wj=∑j=−hhj2WjYj∑j=−hh(aj3+bj4+cj5+dj6)Wj=∑j=−hhj3WjYj

Solving these equations for the polynomial coefficients yields the graduated value, Y^0=a.

Henderson went further. In preceding years, many 'summation formula' methods of graduation had been developed, which derived graduation rules based on summation formulae (convolution of the series of observations with a chosen set of weights). Two such rules are the 15-point and 21-point rules of Spencer (1904). These graduation rules were carefully designed to have a quadratic-reproducing property: If the ungraduated values exactly follow a quadratic formula, then the graduated values equal the ungraduated values. This is an important property: a simple moving average, by contrast, cannot adequately model peaks and troughs in the data. Henderson's insight was to show that any such graduation rule can be represented as a local cubic (or quadratic) fit for an appropriate choice of weights.

Further discussions of the historical work on graduation and local polynomial fitting can be found in Macaulay (1931), Cleveland and Loader (1995); and Murray and Bellhouse (2019).

The Savitzky-Golay filter, introduced by Abraham Savitzky and Marcel J. E. Golay (1964) significantly expanded the method. Like the earlier graduation work, their focus was data with an equally-spaced predictor variable, where (excluding boundary effects) local regression can be represented as a convolution. Savitzky and Golay published extensive sets of convolution coefficients for different orders of polynomial and smoothing window widths.

Local regression methods started to appear extensively in statistics literature in the 1970s; for example, Charles J. Stone (1977), Vladimir Katkovnik (1979) and William S. Cleveland (1979). Katkovnik (1985) is the earliest book devoted primarily to local regression methods.

Theoretical work continued to appear throughout the 1990s. Important contributions include Jianqing Fan and Irène Gijbels (1992) studying efficiency properties, and David Ruppert and Matthew P. Wand (1994) developing an asymptotic distribution theory for multivariate local regression.

An important extension of local regression is Local Likelihood Estimation, formulated by Robert Tibshirani and Trevor Hastie (1987). This replaces the local least-squares criterion with a likelihood-based criterion, thereby extending the local regression method to the Generalized linear model setting; for example binary data, count data or censored data.

Practical implementations of local regression began appearing in statistical software in the 1980s. Cleveland (1981) introduces the LOWESS routines, intended for smoothing scatterplots. This implements local linear fitting with a single predictor variable, and also introduces robustness downweighting to make the procedure resistant to outliers. An entirely new implementation, LOESS, is described in Cleveland and Susan J. Devlin (1988). LOESS is a multivariate smoother, able to handle spatial data with two (or more) predictor variables, and uses (by default) local quadratic fitting. Both LOWESS and LOESS are implemented in the S and R programming languages. See also Cleveland's Local Fitting Software.

While Local Regression, LOWESS and LOESS are sometimes used interchangeably, this usage should be considered incorrect. Local Regression is a general term for the fitting procedure; LOWESS and LOESS are two distinct implementations.

Sign in to keep reading

4 more chapters are free with a Lably account.

More in Statistics