# LOESS Smoothing

A Statistics reference entry (Regression & filtering) in the LuxAlgo Library: explained, not implemented as a chart indicator.

## What is LOESS Smoothing?

LOESS (locally estimated scatterplot smoothing) fits a smooth curve through noisy data one point at a time. For each evaluation point it takes a neighborhood of nearby observations, fits a low-degree polynomial (locally linear in the original LOWESS, often quadratic in LOESS) by weighted least squares with nearer points weighted more heavily (a tricube weighting is the classic choice), and records the fitted value at that point. Repeating this across the series traces a flexible curve with no assumed global shape. The method comes from statistician William Cleveland; its span parameter, the fraction of data used in each local fit, controls smoothness.

On a chart, LOESS behaves like a trend curve that bends with the data, where a single [linear regression](https://www.luxalgo.com/library/concept/linear-regression/) forces one straight line; [kernel regression](https://www.luxalgo.com/library/concept/kernel-regression/) is its close cousin, built from weighted averages rather than local fits. The catch is the right edge: the newest bars have no future neighbors, so their fit is one-sided and gets revised as bars arrive. Historical values look excellent precisely because they were smoothed with hindsight.

The parameters are few and consequential. The span, commonly between a fifth and a half of the data in chart applications, is the bias-variance dial: small spans follow every wiggle, large ones flatten genuine bends. Degree matters less, locally linear for stability, quadratic where the curve must track curvature through turns. Cleveland's robust variant adds iterations that reweight by residual size, so outliers progressively lose influence and one wild bar cannot drag the local fit, a genuinely useful upgrade on spike-prone market data. The cost of all this fitting is computational: every point is its own regression, which is why LOESS lives in analysis tools more comfortably than in per-tick engines.

Chart implementations exercise both its strengths and its known weaknesses. Channel builds wrap the curve in residual-scaled envelopes, framing stretch around a local fit rather than a rigid average; extrapolation builds project the fitted curve forward, which is the method's weakest deployment, since a local smoother has no model beyond its last neighborhood; and monotone-fit relatives like isotonic regression solve a cousin problem, best fit under an order constraint rather than a smoothness one. Across all of them the right-edge honesty rule applies: the newest stretch of any LOESS curve is provisional by construction.

## How to identify LOESS smoothing

Local fits, distance weights, connected values: the construction explains both the beauty and the edge problem.

1. Choose the span, the fraction of data each local fit uses, and the degree, linear or quadratic; these two settings are most of the method.
2. For each evaluation point, weight neighbors by distance, the classic tricube giving smooth influence that vanishes at the neighborhood edge.
3. Fit the local polynomial by weighted least squares and record its value at the evaluation point.
4. Optionally run robustness iterations: reweight by residuals so outliers lose influence, then refit.
5. Connect the fitted values into the curve, and treat the newest segment as provisional, since one-sided neighborhoods revise as bars arrive.

## How traders use it

- As a flexible trend baseline: the curve's direction and bend give a visual trend read, and subtracting it from price yields a detrended oscillator of local deviations.
- As the centerline of a channel: offsetting the curve by a multiple of the residual standard deviation frames stretch and reversion around the local fit.
- As a smoother for indicator inputs where fixed-length moving averages feel too rigid, accepting the edge instability that comes with recomputation.
- As a detrender before cycle work: removing the LOESS trend isolates the oscillation for [dominant cycle measurement](https://www.luxalgo.com/library/concept/dominant-cycle-measurement/) without imposing a global trend shape the data never had.
- As projected scenario paths: extrapolation builds extend the fitted curve forward as a sketch of current curvature persisting, honestly the method's weakest use, and read as a visual hypothesis rather than a forecast.

## LOESS vs related fitting methods

- **Linear Regression** (https://www.luxalgo.com/library/concept/linear-regression/): One global line versus many local fits: the regression compresses the whole window into a single slope, while LOESS lets the trend bend wherever the data bends. The regression is rigid and transparent; LOESS is flexible and revises, especially at the edge where decisions live.
- **Kernel Regression** (https://www.luxalgo.com/library/concept/kernel-regression/): The degree-zero cousin: kernel regression takes weighted averages where LOESS fits weighted polynomials. Local fitting tracks slopes into the neighborhood edges better than averaging, which is precisely where the fitted version earns its extra computation.
- **Polynomial Regression** (https://www.luxalgo.com/library/concept/polynomial-regression/): One global curve versus stitched local ones. The global polynomial gains a formula and pays with edge oscillation and whole-window sensitivity; LOESS gains local control and pays with computation and the absence of any equation to reason about.

## FAQ

### What is the difference between LOESS and LOWESS?

LOWESS is the original locally weighted scatterplot smoother, which fits local straight lines. LOESS is the later generalization that allows higher-degree local polynomials, commonly quadratics. Both come from William Cleveland's work, and in charting practice the names are used almost interchangeably for the same idea: fit locally, weight by distance, connect the fitted values.

### Does a LOESS curve repaint?

The right edge does. Recent points are fit with one-sided neighborhoods, so as new bars arrive the latest segment of the curve is recomputed and can shift, while values deep in the sample are stable. Treat the newest stretch as provisional, and apply [repaint-safe engineering](https://www.luxalgo.com/library/concept/repaint-safe-engineering/) habits, such as confirmation delays and evaluating on closed data, before acting on it.

### What span should LOESS use on charts?

Chart practice runs the span between roughly 0.2 and 0.5, a fifth to a half of the window per local fit. Smaller spans follow short swings and inhale noise; larger ones produce serene curves that flatten genuine turns. The span is the method's real parameter, degree being secondary, and the honest calibration is visual and purposive: smooth at the scale of the swings you intend to analyze.

### What is robust LOESS?

Cleveland's outlier-resistant variant: after an initial fit, residuals are computed, points with large residuals get their weights reduced, and the fit repeats, typically for a few iterations. The effect is that spikes and data errors progressively lose influence instead of dragging the local curve toward themselves. On market data, where single bars routinely print far outside their neighborhood, the robust version is usually the right default.

### Can LOESS forecast prices?

Not credibly. The method is a local smoother with no model beyond each neighborhood, so extending the curve past the data extrapolates the last one-sided fit, exactly the segment most subject to revision. Channel-and-extrapolation tools draw such projections as scenario sketches, useful for visualizing current curvature persisting, and that is the ceiling of the claim. For actual forecasting structure, model-based methods are the honest tools.

### Why use LOESS instead of a moving average?

Mid-sample, a LOESS curve hugs the data with no fixed-kernel lag, bends with genuine trend changes, and, in robust form, shrugs off outliers, producing a description of the path that averages cannot match. The bill arrives at the edge and in the engine: the newest segment revises, and every point is its own regression. For display, detrending and research, LOESS wins; for live causal signals, lag-honest averages keep the advantage.

## Related concepts

- Linear Regression: https://www.luxalgo.com/library/concept/linear-regression/
- Polynomial Regression: https://www.luxalgo.com/library/concept/polynomial-regression/
- Quantile Regression: https://www.luxalgo.com/library/concept/quantile-regression/
- Kalman Filter: https://www.luxalgo.com/library/concept/kalman-filter/
- Hodrick-Prescott Filter: https://www.luxalgo.com/library/concept/hodrick-prescott-filter/
- Wavelet Decomposition: https://www.luxalgo.com/library/concept/wavelet-decomposition/
- FFT/spectral Analysis: https://www.luxalgo.com/library/concept/fft-spectral-analysis/
- Maximum-entropy Spectrum: https://www.luxalgo.com/library/concept/maximum-entropy-spectrum/
- Hilbert Transform: https://www.luxalgo.com/library/concept/hilbert-transform/
- Exponential Smoothing Forecasts: https://www.luxalgo.com/library/concept/exponential-smoothing-forecasts/

---

Source: https://www.luxalgo.com/library/concept/loess-smoothing/ (LuxAlgo Library, the encyclopedia of trading & technical analysis). Free to use with attribution: https://www.luxalgo.com/library/license/