Local regression or local polynomial regression,[1] also known as moving regression,[2] is a generalization of the moving average and polynomial regression.[3] Its most common methods, initially developed for scatterplot smoothing, are LOESS (locally estimated scatterplot smoothing) and LOWESS (locally weighted scatterplot smoothing), both pronounced /ˈlɛs/ LOH-ess. They are two strongly related non-parametric regression methods that combine multiple regression models in a k-nearest-neighbor-based meta-model. In some fields, LOESS is known and commonly referred to as Savitzky–Golay filter[4][5] (proposed 15 years before LOESS).

LOESS curve fitted to a population sampled from a sine wave with uniform noise added. The LOESS curve approximates the original sine wave.

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 modeling are similar to LOESS in this respect. These methods have been consciously designed to use our current computational ability to the fullest possible advantage to achieve goals not easily achieved by traditional 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.[6][7]

History

edit

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[8] studying the problem of graduation (a term for smoothing used in Actuarial literature) introduced local regression using cubic polynomials, and showed how earlier graduation methods could be interpreted as local polynomial fitting. William S. Cleveland and Catherine Loader (1995)[9]; and Lori Murray and David Bellhouse (2019)[10] discuss more of the historical work on graduation.

The Savitzky-Golay filter, introduced by Abraham Savitzky and Marcel J. E. Golay (1964)[11] significantly expanded the method. Like the earlier graduation work, the focus was on 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 1970's; for example, Charles J. Stone (1977)[12], Vladimir Katkovnik (1979)[13] and William S. Cleveland (1979)[14]. Katkovnik (1985)[15] is the earliest book devoted primarily to local regression methods.

Extensive theoretical work continued to appear throughout the 1990's. Important contributions include Jianqing Fan and Irène Gijbels (1992)[16] studying efficiency properties, and David Ruppert and Matthew P. Wand (1994)[17] 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).[18] This replaces the local least-squares criterion with a likelihood-based criterion, thereby extending the local regresion method to the Generalized linear model setting; for example binary data; count data; censored data.

Practical implementations of local regression began appearing in statistical software in the 1980's. Cleveland (1981)[19] 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)[20]. 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.[21]

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

Model definition

edit

Local regression uses a data set consisting of observations one or more ‘independent’ or ‘predictor’ variables, and a ‘dependent’ or ‘response’ variable. The dataset will consist of a number   observations. The observations of the predictor variable can be denoted  , and corresponding observations of the response variable by  .

For ease of presentation, the development below assumes a single predictor variable; the extension to multiple predictors (when the   are vectors) is conceptually straightforward. A functional relationship between the predictor and response variables is assumed:   where   is the unknown ‘smooth’ regression function to be estimated, and represents the conditional expectation of the response, given a value of the predictor variables. In theoretical work, the ‘smoothness’ of this function can be formally characterized by placing bounds on higher order derivatives. The   represents random error; for estimation purposes these are assumed to have mean zero. Stronger assumptions (eg, independence and equal variance) may be made when assessing properties of the estimates.

Local regression then estimates the function  , for one value of   at a time. Since the function is assumed to be smooth, the most informative data points are those whose   values are close to  . This is formalized with a bandwidth   and a kernel or weight function  , with observations assigned weights   A typical choice of  , used by Cleveland in LOWESS, is   for  , although any similar function (peaked at   and small or 0 for large values of  ) can be used. Questions of bandwidth selection and specification (how large should   be, and should it vary depending upon the fitting point  ?) are deferred for now.

A local model (usually a low-order polynomial with degree  ), expressed as   is then fitted by weighted least squares: choose regression coefficients   to minimize   The local regresssion estimate of   is then simply the intercept estimate:   while the remaining coefficients can be interpreted (up to a factor of  ) as derivative estimates.

It is to be emphasized that the above procedure produces the estimate   for one value of  . When considering a new value of  , a new set of weights   must be computed, and the regression coefficient estimated afresh.

Matrix Representation of the Local Regression Estimate

edit

As with all least squares estimates, the estimated regression coefficients can be expressed in closed form (see Weighted least squares for details):   where   is a vector of the local regression coefficients;   is the   design matrix with entries  ;   is a diagonal matrix of the smoothing weights  ; and   is a vector of the responses  .

This matrix representation is crucial for studying the theoretical properties of local regression estimates. With appropriate definitions of the design and weight matrices, it immediately generalizes to the multiple-predictor setting.

Selection Issues: Bandwidth, local model, fitting criteria

edit

Implementation of local regression requires specification and selection of several components:

  1. The bandwidth, and more generally the localized subsets of the data.
  2. The degree of local polynomial, or more generally, the form of the local model.
  3. The choice of weight function  .
  4. The choice of fitting criterion (least sqaures or something else).

Each of these components has been the subject of extensive study; a summary is provided below.

Localized subsets of data; Bandwidth

edit

The bandwidth   controls the resolution of the local regression estimate. If h is too small, the estimate may show high-resolution features that represent noise in the data, rather than any real structure in the mean function. Conversely, if h is too large, the estimate will only show low-resolution features, and important structure may be lost. This is the bias-variance tradeoff; if h is too small, the estimate exhibits large variation; while at large h, the estimate exhibits large bias.

Careful choice of bandwidth is therefore crucial when applying local regression. Mathematical methods for bandwidth selection require, firstly, formal criteria to assess the performance of an estimate. One such criterion is prediction error: if a new observation is made at  , how well does the estimate   predict the new response  ?

Performance is often assessed using a squared-error loss function. The mean squared prediction error is   The first term   is the random variation of the observation; this is entirely independent of the local regression estimate. The second term,   is the mean squared estimation error. This relation shows that, for squared error loss, minimizing prediction error and estimation error are equivalent problems.

In global bandwidth selection, these measures can be integrated over the   space ("mean integrated squared error", often used in theoretical work), or averaged over the actual   (more useful for practical implementations). Some standard techniques from model selection can be readily adapted to local regression:

  1. Cross Validation, which estimates the mean-squared prediction error.
  2. Mallow's Cp and Akaike's Information Criterion, which estimate mean squared estimation error.
  3. Other methods which attempt to estimate bias and variance variance components of the estimation error directly.

Any of these criteria can be minimized to produce an automatic bandwidth selector. Cleveland and Devlin[20] prefer a graphical method (the M-plot) to visually display the bias-variance trade-off and guide bandwidth choice.

One question not addressed above is, how should the bandwidth depend upon the fitting point  ? Often a constant bandwidth is used, while LOWESS and LOESS prefer a nearest-neighbor bandwidth, meaning h is smaller in regions with many data points. Formally, the smoothing parameter,  , is the fraction of the total number n of data points that are used in each local fit. The subset of data used in each weighted least squares fit thus comprises the   points (rounded to the next largest integer) whose explanatory variables' values are closest to the point at which the response is being estimated.[7]

More sophisticated methods attempt to choose the bandwidth adaptively; that is, choose a bandwidth at each fitting point   by applying criteria such as cross-validation locally within the smoothing window. An early example of this is Jerome H. Friedman's[22] "supersmoother", which uses cross-validation to choose among local linear fits at different bandwidths.

Degree of local polynomials

edit

Most sources, in both theoretical and computational work, use low-order polynomials as the local model, with polynomial degree ranging from 0 to 3.

The degree 0 (local constant) model is equivalent to a kernel smoother; usually credited to Èlizbar Nadaraya (1964)[23] and G. S. Watson (1964).[24]. This is the simplest model to use, but can suffer from bias when fitting near boundaries of the dataset.

Local linear (degree 1) fitting can substantially reduce the boundary bias.

Local quadratic (degree 2) and local cubic (degree 3) can result in improved fits, particularly when the underlying mean function   has substantial curvature, or equivalently a large second derivative.

In theory, higher orders of polynomial can lead to faster convergence of the estimate   to the true mean  , provided that   has a sufficient number of derivatives. See C. J. Stone (1980).[25] Generally, it takes a large sample size for this faster convergence to be realized. There are also computational and stability issues that arise, particularly for multivariate smoothing. It is generally not recommended to use local polynomials with degree greater than 3.

As with bandwidth selection, methods such as cross-validation can be used to compare the fits obtained with different degrees of polynomial.

Weight function

edit

As mentioned above, the weight function gives the most weight to the data points nearest the point of estimation and the least weight to the data points that are furthest away. The use of the weights is based on the idea that points near each other in the explanatory variable space are more likely to be related to each other in a simple way than points that are further apart. Following this logic, points that are likely to follow the local model best influence the local model parameter estimates the most. Points that are less likely to actually conform to the local model have less influence on the local model parameter estimates.

The traditional weight function used for LOESS is the tri-cube weight function,

 

where d is the distance of a given data point from the point on the curve being fitted, scaled to lie in the range from 0 to 1.[7]

However, any other weight function that satisfies the properties listed in Cleveland (1979) could also be used. The weight for a specific point in any localized subset of data is obtained by evaluating the weight function at the distance between that point and the point of estimation, after scaling the distance so that the maximum absolute distance over all of the points in the subset of data is exactly one.

Consider the following generalisation of the linear regression model with a metric   on the target space   that depends on two parameters,  . Assume that the linear hypothesis is based on   input parameters and that, as customary in these cases, we embed the input space   into   as  , and consider the following loss function

 

Here,   is an   real matrix of coefficients,   and the subscript i enumerates input and output vectors from a training set. Since   is a metric, it is a symmetric, positive-definite matrix and, as such, there is another symmetric matrix   such that  . The above loss function can be rearranged into a trace by observing that

 .

By arranging the vectors   and   into the columns of a   matrix   and an   matrix   respectively, the above loss function can then be written as

 

where   is the square diagonal   matrix whose entries are the  s. Differentiating with respect to   and setting the result equal to 0 one finds the extremal matrix equation

 .

Assuming further that the square matrix   is non-singular, the loss function   attains its minimum at

 .

A typical choice for   is the Gaussian weight

 .

Choice of Fitting Criterion

edit

As described above, local regression uses a locally weighted least squares criterion to estimate the regression parameters. This inherits many of the advantages (ease of implementation and interpretation; good properties when errors are normally distributed) and disadvantages (sensitivity to extreme values and outliers; inefficiency when errors have unequal variance or are not normally distributed) usually associated with least squares regression.

To address the sensitivity to outliers, techniques from robust regression can be employed. In local M-estimation, the local least-squares criterion is replaced by a criterion of the form   where   is a robustness function and   is a scale parameter. Discussion of the merits of different choices of robustness function is best left to the robust regression literature. The scale paramter   must also be estimated. References for local M-estimation include Katkovnik (1985)[15] and Alexandre Tsybakov (1986).[26]

The robustness iterations in LOWESS and LOESS correspond to the robustness function defined by   and a robust global estimate of the scale parameter.

If  , the local   criterion   results; this does not require a scale parameter. When  , this criterion is minimized by a locally-weighted median; local   regression can be interpreted as estimating the median, rather than mean, response. If the loss function is skewed, this becomes local quantile regression. See Keming Yu and M.C. Jones (1998).[27]

Advantages

edit

As discussed above, the biggest advantage LOESS has over many other methods is the process of fitting a model to the sample data does not begin with the specification of a function. Instead the analyst only has to provide a smoothing parameter value and the degree of the local polynomial. In addition, LOESS is very flexible, making it ideal for modeling complex processes for which no theoretical models exist. These two advantages, combined with the simplicity of the method, make LOESS one of the most attractive of the modern regression methods for applications that fit the general framework of least squares regression but which have a complex deterministic structure.

Although it is less obvious than for some of the other methods related to linear least squares regression, LOESS also accrues most of the benefits typically shared by those procedures. The most important of those is the theory for computing uncertainties for prediction and calibration. Many other tests and procedures used for validation of least squares models can also be extended to LOESS models [citation needed].

Disadvantages

edit

LOESS makes less efficient use of data than other least squares methods. It requires fairly large, densely sampled data sets in order to produce good models. This is because LOESS relies on the local data structure when performing the local fitting. Thus, LOESS provides less complex data analysis in exchange for greater experimental costs.[7]

Another disadvantage of LOESS is the fact that it does not produce a regression function that is easily represented by a mathematical formula. This can make it difficult to transfer the results of an analysis to other people. In order to transfer the regression function to another person, they would need the data set and software for LOESS calculations. In nonlinear regression, on the other hand, it is only necessary to write down a functional form in order to provide estimates of the unknown parameters and the estimated uncertainty. Depending on the application, this could be either a major or a minor drawback to using LOESS. In particular, the simple form of LOESS can not be used for mechanistic modelling where fitted parameters specify particular physical properties of a system.

Finally, as discussed above, LOESS is a computationally intensive method (with the exception of evenly spaced data, where the regression can then be phrased as a non-causal finite impulse response filter). LOESS is also prone to the effects of outliers in the data set, like other least squares methods. There is an iterative, robust version of LOESS [Cleveland (1979)] that can be used to reduce LOESS' sensitivity to outliers, but too many extreme outliers can still overcome even the robust method.

See also

edit

References

edit

Citations

edit
  1. ^ Fox & Weisberg 2018, Appendix.
  2. ^ Harrell 2015, p. 29.
  3. ^ Garimella 2017.
  4. ^ "Savitzky–Golay filtering – MATLAB sgolayfilt". Mathworks.com.
  5. ^ "scipy.signal.savgol_filter — SciPy v0.16.1 Reference Guide". Docs.scipy.org.
  6. ^ Kristen Pavlik, US Environmental Protection Agency, Loess (or Lowess), Nutrient Steps, July 2016.
  7. ^ a b c d NIST, "LOESS (aka LOWESS)", section 4.1.4.4, NIST/SEMATECH e-Handbook of Statistical Methods, (accessed 14 April 2017)
  8. ^ Henderson, R. Note on Graduation by Adjusted Average. Actuarial Society of America Transactions 17, 43--48. archive.org
  9. ^ William S. Cleveland; Catherine Loader (1996). "Smoothing by Local Regression: Principles and Methods". Statistical Theory and Computational Aspects of Smoothing: 10–49. doi:10.1007/978-3-642-48425-4_2. S2CID 14593932. Wikidata Q132138257.
  10. ^ Lori Murray; David Richard Bellhouse (11 June 2019). "W.F. Sheppard's Smoothing Method: A Precursor to Local Polynomial Regression". International Statistical Review. 87 (3): 604–612. doi:10.1111/INSR.12330. ISSN 0306-7734. JSTOR 48554897. Wikidata Q127772934.
  11. ^ Abraham. Savitzky; M. J. E. Golay (July 1964). "Smoothing and Differentiation of Data by Simplified Least Squares Procedures". Analytical Chemistry. 36 (8): 1627–1639. doi:10.1021/AC60214A047. ISSN 0003-2700. Wikidata Q56769732.
  12. ^ Charles J. Stone (July 1977). "Consistent Nonparametric Regression". Annals of Statistics. 5 (4): 595–620. doi:10.1214/AOS/1176343886. ISSN 0090-5364. JSTOR 2958783. MR 0443204. Zbl 0366.62051. Wikidata Q56533608.
  13. ^ Katkovnik, Vladimir (1979), "Linear and nonlinear methods of nonparametric regression analysis", Soviet Automatic Control, 12 (5): 25–34
  14. ^ William S. Cleveland (December 1979). "Robust Locally Weighted Regression and Smoothing Scatterplots". Journal of the American Statistical Association. 74 (368): 829–836. doi:10.1080/01621459.1979.10481038. ISSN 0162-1459. JSTOR 2286407. Zbl 0423.62029. Wikidata Q30052922.
  15. ^ a b Vladimir Katkovnik (1985), Непараметрическая идентификация и сглаживание данных. Метод Локальной Аппроксимации. (in Russian), Nauka, LCCN 86141102, Zbl 0576.62050, Wikidata Q132129931
  16. ^ Jianqing Fan; Irène Gijbels (December 1992). "Variable Bandwidth and Local Linear Regression Smoothers". Annals of Statistics. 20 (4): 2008–2036. doi:10.1214/AOS/1176348900. ISSN 0090-5364. JSTOR 2242378. S2CID 8309667. Wikidata Q132202273.
  17. ^ David Ruppert; Matt Wand (September 1994). "Multivariate Locally Weighted Least Squares Regression". Annals of Statistics. 22 (3): 1346–1370. doi:10.1214/AOS/1176325632. ISSN 0090-5364. JSTOR 2242229. MR 1311979. Zbl 0821.62020. Wikidata Q132202598.
  18. ^ Robert Tibshirani; Trevor Hastie (1987). "Local Likelihood Estimation". Journal of the American Statistical Association. 82 (398): 559–567. doi:10.1080/01621459.1987.10478466. ISSN 0162-1459. Zbl 0626.62041. Wikidata Q132187702.
  19. ^ William S. Cleveland (February 1981). "LOWESS: A Program for Smoothing Scatterplots by Robust Locally Weighted Regression". The American Statistician. 35 (1): 54. doi:10.2307/2683591. ISSN 0003-1305. JSTOR 2683591. Wikidata Q29541549.
  20. ^ a b William S. Cleveland; Susan J. Devlin (September 1988). "Locally Weighted Regression: An Approach to Regression Analysis by Local Fitting". Journal of the American Statistical Association. 83 (403): 596–610. doi:10.1080/01621459.1988.10478639. ISSN 0162-1459. JSTOR 2289282. Zbl 1248.62054. Wikidata Q29393395.
  21. ^ Cleveland, William. "Local Fitting Software".
  22. ^ Friedman, Jerome H. (October 1984), A Variable Span Smoother (PDF), Technical report, Laboratory for Computational Statistics LCS 5; SLAC PUB-3466, doi:10.2171/1447470
  23. ^ Elizbar A. Nadaraya (January 1964). "On Estimating Regression". Theory of Probability and Its Applications. 9 (1): 141–142. doi:10.1137/1109020. ISSN 0040-585X. Wikidata Q29303512.
  24. ^ Watson, G. S., "Smooth regression analysis", Sankhya Series A, 26: 359–372
  25. ^ Charles J. Stone (November 1980). "Optimal Rates of Convergence for Nonparametric Estimators". Annals of Statistics. 8 (6): 1348–1360. doi:10.1214/AOS/1176345206. ISSN 0090-5364. MR 0594650. Zbl 0451.62033. Wikidata Q132272803.
  26. ^ Tsybakov, Alexandre B., "Robust reconstruction of functions by the local-approximation method.", Problems of Information Transmission, 22: 133–146
  27. ^ Yu, Keming; Jones, M.C., "Local Linear Quantile Regression", Journal of the American Statistical Association, 93: 228–237

Sources

edit
edit

  This article incorporates public domain material from the National Institute of Standards and Technology