AI Glossary / Statistics and probability / Intermediate
Local regression
Definition
Local regression estimates a response curve or surface by fitting simple regressions to neighborhoods of observations. The fitted rule changes as the prediction location changes, allowing the overall relationship to bend without imposing one global straight line. LOESS and LOWESS are well-known implementations. The method is useful for exploring and predicting smooth relationships where nearby predictor values provide relevant information, but it requires choices about neighborhood size, weights, polynomial degree, and evaluation.
What it means
Instead of asking one equation to describe the entire dataset, local regression asks what simple relationship works near a particular input. Observations close to that input usually receive more influence than distant ones.
Local refers to proximity in predictor space, not necessarily physical location or a model running on a local computer. A neighborhood might consist of similar temperatures, similar product sizes, or nearby combinations of several measured features. The distance definition therefore matters, especially when predictors use different units.
How it works
For a target x0, select a neighborhood or bandwidth and assign nonnegative proximity weights. Fit a low-degree polynomial by weighted least squares, often using x - x0 as the predictor coordinate. Evaluate the fitted polynomial at x0; in centered coordinates this is the fitted intercept.
Repeat at other target locations to obtain a curve. A smaller neighborhood can follow finer detail but may chase noise; a larger one smooths more but can miss genuine curvature. Tune this choice using the analytical purpose and suitable validation.
Some variants apply additional residual-based robust weights to reduce outlier influence. These are distinct from distance weights and are not automatically present in every local regression implementation. Boundary behavior, sparse regions, and numerical conditioning require attention.
Three practical examples
- A calibration analyst uses a local curve to describe a sensor response when a single straight-line equation leaves systematic residual patterns.
- A customer-research team explores how average satisfaction varies with waiting time, while keeping the smoother descriptive rather than interpreting it as a causal effect.
- An AI quality analyst smooths observed prediction errors against a continuous feature to identify regions where a deployed model performs differently.
Think of it this way
Think of tracing a winding road using a short ruler that moves along it. Each placement approximates a small stretch, and the collection of placements follows the road's overall curve. A very long ruler misses bends, while an extremely short one may follow every small bump. The neighborhood size controls that trade-off in local regression.
Worked example
Use fictional data x = 0, 1, 2, 3, and 4 with y = 0, 1, 4, 9, and 16. Estimate the response at x0 = 2 using a local straight line and a tricube bandwidth of 2.
Define w = [1 - (distance/2) cubed] cubed when distance is below 2, and zero otherwise. The endpoint weights are zero. At x = 1 and 3, the weights equal (1 - 1/8) cubed = 343/512, approximately 0.669922. The central weight is one.
Fit y approximately a + b(x - 2). Symmetry makes the fitted intercept the weighted response mean: a = [4 + (343/512)(1 + 9)]/[1 + 2(343/512)] = 4.572621. The fitted local slope is 4. The prediction at x0 is therefore about 4.573, even though the observed value there is 4.
Smoothing need not interpolate the data. A local quadratic would recover the underlying x-squared pattern in this noiseless construction, but a higher degree is not automatically preferable with noisy or sparse observations. The calculation specifies one local fit, not an entire software-default LOESS run.
Illustrative case study
Fictional case: Orchard Metrics examines delivery time against parcel weight. A global straight-line model misses a gradual bend in the middle of the weight range. The analyst fits local regressions with several neighborhood sizes and evaluates them on held-out deliveries.
The smallest neighborhood creates unstable wiggles where few heavy parcels were observed. The team chooses a smoother alternative and highlights the limited evidence at the heavy end rather than extending the curve confidently beyond available data.
The model becomes a descriptive and predictive benchmark. Operational staff investigate the bend separately; the smooth curve alone does not establish which handling process caused it.
Common misconceptions and mistakes
Do not assume a smooth-looking curve is true or that every wiggle reflects a real process. A bandwidth selected after repeatedly examining outcomes can overstate apparent evidence.
Do not confuse proximity weighting with outlier resistance. An unusual response near the target can receive high distance weight unless a robust procedure addresses it. Nor is local regression automatically suitable for extrapolation: there may be little or no relevant neighborhood beyond the observed range. In many dimensions, nearby observations become scarce, making local estimation much harder.
Business use
Local regression can help businesses discover patterns before committing to a restrictive global equation. It is useful for calibration, diagnostic plots, and low-dimensional prediction where sufficient neighboring data exist.
Record the distance scale, neighborhood rule, polynomial degree, and any robustness settings. Evaluate performance across dense and sparse regions. For time-ordered data, ensure that a smoother using future points is not presented as a real-time forecasting method. A retrospective curve and an operational forecast use different information.
People also ask
Does local regression pass through every point?
Usually not. It estimates a smoothed relationship rather than interpolating all observations.
Is LOESS always robust to outliers?
No. Implementations offer different fitting choices, and robust variants have limitations.
Is the neighborhood always a fixed distance?
No. Some methods use a fixed bandwidth; others use a specified fraction or number of nearby observations.
Check your understanding
The local estimate at x = 2 is about 4.573 while the observation is 4. Is that necessarily a mistake?
Answer: No. The local line balances weighted neighboring observations. Because the true teaching curve is curved, the fitted straight local approximation need not match the central point exactly.
Related terms
- Loess
- Locally weighted regression
- Weighted least squares
- Bias-variance trade-off
- LOWESS
- bandwidth
- kernel smoother
Learn next
Next, compare local constant, local linear, and local quadratic fits at interior and boundary points. Then study bandwidth selection and validation that respects the intended prediction setting.
More in Statistics and probability
- Linkage disequilibrium score regression - Linkage disequilibrium score regression, usually abbreviated LD Score regression or LDSC, is a method that relates genome-wide association statistics to...
- List sample - A list sample is a sample selected from an explicit list of units in the population being studied. The list acts as the sampling frame.
- Local model - In the supplied Aalto dictionary's federated-learning terminology, a local model is the hypothesis space assigned to a particular node of a learning network.
- Location test - A location test is a statistical hypothesis test about where a distribution is centered.
- Location testing for Gaussian scale mixture distributions - Location testing for Gaussian scale mixture distributions concerns testing a common center when independent observations have errors that can be represented...
- Log likelihood - Log likelihood is the logarithm of a likelihood function, usually using the natural logarithm.
Sources
Sources: Hyndman's hosted Glossary of Forecasting Terms, Local Regression: https://robjhyndman.com/mwh3/FG4.pdf . NIST/SEMATECH, LOESS: https://www.itl.nist.gov/div898/handbook/pmd/section1/pmd144.htm . R documentation, Local Polynomial Regression Fitting, for implementation and robust-family distinctions: https://stat.ethz.ch/R-manual/R-devel/library/stats/html/loess.html . These primary references were read. The tricube example and fictional case are original; weights, intercept and slope were independently checked by weighted least squares.
Previous: Local outlier factor Next: Local search