AI Glossary / Time series and signal processing / Intermediate
Loess
Definition
Loess is a local regression method that estimates a smooth relationship by fitting low-degree polynomials to nearby observations. Points closer to the location being estimated usually receive more weight. Repeating this local fitting across locations produces a flexible curve or surface without requiring one global polynomial to describe the entire relationship.
What it means
A relationship may bend differently in different regions. Loess allows a simple line or quadratic to describe each neighborhood, rather than forcing the whole dataset into one rigid equation. The resulting smooth is useful for exploration and estimating local trends.
Flexibility brings choices. The neighborhood size, polynomial degree, distance scaling, and treatment of outliers all affect the result. A smooth curve can summarize data well without establishing causality or providing reliable predictions far outside the observed range.
How it works
At a target predictor value, select a neighborhood using a span or bandwidth rule. Assign distance-based weights, often from the tricube function: a normalized distance u below one receives weight (1 − u cubed) cubed, while points at or beyond the boundary receive zero. Fit a low-degree polynomial by weighted least squares and evaluate it at the target.
Repeat for other targets. A larger neighborhood usually produces a smoother, less locally responsive curve; a smaller one can follow finer structure and noise. Robust variants add residual-based reweighting to reduce some outlier influence. These robust weights are distinct from the distance weights used in the basic fit.
Three practical examples
- An analyst adds a loess curve to a scatterplot of workload and response time to inspect whether a straight-line model misses curvature.
- A time-series decomposition uses local regression to estimate components within a defined decomposition procedure.
- A calibration team estimates a smooth relationship between an instrument reading and a reference quantity, while checking local data coverage and uncertainty.
Think of it this way
Think of laying a short ruler along different parts of a curved path. Each placement approximates a small neighborhood, and the sequence of local estimates describes the broader curve. A ruler placed where there are few observations has less support, which is why sparse regions and edges deserve attention.
Worked example
Consider an original local-linear calculation at target x = 0. Observations have x values [−2, −1, 0, 1, 2] and y values [1, 2, 4, 8, 11]. Stipulate a neighborhood distance scale of 2 and use tricube distance weights, without robust reweighting.
The two endpoints have normalized distance one and weight zero. At x = −1 and +1, the weight is [1 − (1/2) cubed] cubed = 343/512. At x = 0, the weight is one. Write the local line as a + bx.
Because the weighted x values are symmetric, their weighted mean is zero. The intercept is therefore the weighted mean of y: a = [4 + (343/512) × (2 + 8)]/[1 + 2 × (343/512)] = 2739/599, approximately 4.57262. The slope is [(343/512) × (−2 + 8)]/[2 × (343/512)] = 3.
The loess estimate at the target is a = 4.57262, not the observed y value 4. Substituting the fitted line into the weighted normal equations independently verifies that both weighted residual sums are zero. This is one explicitly specified local fit, not a complete tuned loess model or a demonstration of every package's default span behavior.
Illustrative case study
Illustrative fictional case: Birch Operations uses loess to explore the relationship between daily workload and completion time. A very small span produces several sharp bends, some supported by only a few observations.
The analyst compares wider spans, marks sparse regions, and evaluates any predictive use on later data. Managers use the curve to identify questions for investigation rather than claiming that increasing workload causes each visible bend. This fictional example illustrates exploratory value alongside the need for validation.
Common misconceptions and mistakes
Loess does not normally interpolate every observed point, and local linear fitting is more than simply averaging neighboring responses. The local slope matters except in special symmetric situations such as the worked target.
Do not choose a span solely because its curve looks persuasive. Very small neighborhoods can overfit or become numerically unstable; broad neighborhoods can hide real structure. Robust loess is not immune to all outliers. In time-series use, a centered fit can use future observations, so a retrospective smooth must not be presented as a forecast available at an earlier time.
Business use
Businesses can use loess for exploratory analysis, calibration, and components of forecasting workflows. Its strength is flexible local approximation with interpretable tuning choices; its limitations include sparse-data behavior, computational cost, and weak support for extrapolation.
Document predictor scaling, span, degree, robust settings, and any observation weights. When several predictors are used, local neighborhoods become harder to populate as dimension increases. Evaluate the complete downstream task and preserve raw observations so important exceptions are not hidden by the smooth.
People also ask
Is loess the same as LOWESS?
The terms are closely related and sometimes used interchangeably, but implementations and defaults can differ.
Can loess forecast far beyond the data?
It is primarily a local fitting method; distant extrapolation lacks nearby evidence and requires particular caution.
Does a wider span always improve the estimate?
No. It trades lower local variability against possible bias from oversmoothing.
Check your understanding
Why do the endpoints receive zero weight in the example?
Answer: Their normalized distance equals the boundary of the stipulated tricube kernel.
Why is the estimate not exactly four?
Answer: The local regression combines neighboring evidence rather than forcing the curve through the center observation.
What would distinguish robust fitting from this calculation?
Answer: Additional weights based on residuals would be introduced, typically iteratively.
Would this target calculation alone establish an optimal span?
Answer: No. The neighborhood was stipulated for illustration.
Related terms
- Local regression
- Span
- Weighted least squares
- Robust regression
- Smoothing
- LOWESS
- bandwidth
- tricube weight
- STL decomposition
- extrapolation
Learn next
repeat the local fit at a point near the edge of the same dataset and inspect the asymmetry of its neighborhood. Then compare several spans using a validation method appropriate to the intended prediction task.
More in Time series and signal processing
- Laplace smoothing - Laplace smoothing, also called add-one smoothing, estimates probabilities from categorical counts by adding one to every category count before normalizing.
- Linear interpolation smoothing - Linear interpolation smoothing combines two or more probability distributions using nonnegative weights that sum to one.
- Ljung-Box test - The Ljung-Box test is a statistical test that jointly assesses whether a set of autocorrelations, from lag one through a chosen maximum lag, is consistent...
- Logarithmic transformation - A logarithmic transformation replaces positive values with their logarithms.
- Lomb-Scargle Periodograms - Lomb-Scargle periodograms assess periodic structure by fitting sinusoidal models across a range of frequencies, including when observations are unevenly...
- Metalevel state space - A metalevel state space is a representation of the possible internal computational states of an agent or program.
Sources
Sources: NIST, LOESS (aka LOWESS): https://www.itl.nist.gov/div898/handbook/pmd/section1/pmd144.htm . R statistics documentation, Local Polynomial Regression Fitting: https://stat.ethz.ch/R-manual/R-devel/library/stats/html/loess.html . Primary guidance and implementation documentation consulted. The tricube-weighted local line and normal-equation checks are original; the case is fictional.
Previous: Locks with ordered sharing Next: Log area ratio