Quant Memo
Advanced

Kernel Regression and the Nadaraya-Watson Estimator

A way to fit a curve through scattered data without assuming any functional form — at each point, estimate the outcome as a weighted average of nearby observations, with closer points getting more weight.

Prerequisites: Kernel Density Estimation, Bandwidth Selection for Smoothers

You have scattered data pairs — say, option moneyness against implied volatility — and you want a curve through them, but you don't trust any particular parametric shape (quadratic, cubic, whatever) to be right. Fitting the wrong shape everywhere is worse than fitting no fixed shape at all. Kernel regression sidesteps the choice entirely: instead of fitting one global curve, it estimates the value at each point separately, as a weighted average of whatever data happens to be nearby.

An analogy: pricing a house from its neighbors

To estimate what a house is worth, one approach is a weighted average of nearby houses' recent sale prices — with weights that fade smoothly as a comparable house gets farther away in location or size, rather than a hard cutoff. A house next door counts a lot; a house across town barely counts at all. Kernel regression does exactly this for any xx-yy relationship: to estimate yy at some value of xx, take a weighted average of the yy's from data points whose xx's are nearby, letting the weight smoothly decay with distance rather than picking a fixed neighborhood or a fixed functional shape.

The idea, one symbol at a time

The Nadaraya-Watson estimator at a point xx is

m^(x)=i=1nK(xxih)yii=1nK(xxih),\hat{m}(x) = \frac{\sum_{i=1}^{n} K\left(\frac{x - x_i}{h}\right) y_i}{\sum_{i=1}^{n} K\left(\frac{x - x_i}{h}\right)},

where K()K(\cdot) is a kernel function (commonly a Gaussian bump) that assigns higher weight to xix_i closer to xx, and hh is the bandwidth controlling how quickly that weight decays. In plain English: the estimate at xx is a weighted average of all the observed yiy_i, where the weight on each observation is determined entirely by how close its xix_i is to xx — points right at xx count heavily, points far away barely count at all, and the denominator simply rescales the weights so they add up to 1 (turning them into a proper weighted average rather than a raw weighted sum).

Worked example 1: implied vol at a specific strike, by hand

Suppose you have three observed (moneyness, implied vol) pairs: (0.95,22%)(0.95, 22\%), (1.00,18%)(1.00, 18\%), (1.05,21%)(1.05, 21\%), and you want to estimate implied vol at moneyness x=0.98x = 0.98, using a simple triangular kernel with bandwidth h=0.05h = 0.05 that gives weight max(0,1xxi/h)\max(0, 1 - |x - x_i|/h). Distances: 0.980.95=0.03|0.98-0.95|=0.03 \to weight 10.03/0.05=0.41 - 0.03/0.05 = 0.4; 0.981.00=0.02|0.98-1.00|=0.02 \to weight 10.02/0.05=0.61-0.02/0.05=0.6; 0.981.05=0.07|0.98-1.05|=0.07 \to weight max(0,10.07/0.05)=0\max(0, 1-0.07/0.05) = 0 (outside the window entirely). The estimate:

m^(0.98)=0.4×22+0.6×18+0×210.4+0.6+0=8.8+10.81.0=19.6%.\hat{m}(0.98) = \frac{0.4 \times 22 + 0.6 \times 18 + 0 \times 21}{0.4 + 0.6 + 0} = \frac{8.8 + 10.8}{1.0} = 19.6\%.

Notice the far point at 1.051.05 contributes nothing — outside the triangular window it's given zero weight — while the closer point at 1.001.00 carries more influence than the slightly farther point at 0.950.95.

Worked example 2: what happens with a wider bandwidth

Redo the same estimate with h=0.15h = 0.15 instead, which now includes the third point too: weights become 10.03/0.15=0.81-0.03/0.15=0.8, 10.02/0.150.8671-0.02/0.15\approx0.867, 10.07/0.150.5331-0.07/0.15\approx0.533.

m^(0.98)=0.8(22)+0.867(18)+0.533(21)0.8+0.867+0.533=17.6+15.6+11.22.244.42.220.2%.\hat{m}(0.98) = \frac{0.8(22) + 0.867(18) + 0.533(21)}{0.8+0.867+0.533} = \frac{17.6+15.6+11.2}{2.2} \approx \frac{44.4}{2.2} \approx 20.2\%.

The wider bandwidth pulls in the point at 1.051.05 (21%) and shifts the estimate up from 19.6%19.6\% to 20.2%20.2\% — a direct, hand-computable illustration of why bandwidth choice (see Bandwidth Selection for Smoothers) changes the answer, sometimes substantially, even with the exact same data.

0.95, 22% 1.00, 18% 1.05, 21% kernel weight bump centered at x=0.98 m̂(0.98)=19.6%
The kernel weight bump (light curve) determines how much each observation contributes to the estimate at the query point — nearby points get high weight, distant points fade toward zero.
Nadaraya-Watson fit follows local weighted averages, no fixed shape assumed
The fitted curve is a sequence of local weighted averages, not a single global formula — it can bend to follow the data wherever the data leads.

What this means in practice

Kernel regression is used wherever a relationship is believed to be smooth but not well described by any specific functional form — smoothing an implied volatility smile, estimating how expected returns vary with a continuous factor exposure, or building a nonparametric hedge-ratio curve. It requires no assumption about linearity or curvature, at the cost of needing more data to estimate well (see Parametric vs. Nonparametric Models) and needing a well-chosen bandwidth to avoid either overfitting or oversmoothing.

The Nadaraya-Watson estimator predicts y at any x as a weighted average of observed y's, weighting each observation by a kernel function of its distance from x — nearby points dominate, distant points fade out, and no functional form for the relationship is ever assumed.

Kernel regression suffers badly from boundary bias: near the edges of your data range, the kernel window can only see points on one side, so the weighted average is systematically pulled toward the interior rather than reflecting the true edge behavior — a stock's implied vol curve estimated this way will look artificially flat right at the extreme strikes just because there's no data beyond the boundary to balance the average. Local polynomial regression (see Local Polynomial Regression and LOESS) is a standard fix for this specific problem.

Related concepts

Practice in interviews

Further reading

  • Nadaraya, 'On Estimating Regression', Theory of Probability and Its Applications
  • Hastie, Tibshirani & Friedman, The Elements of Statistical Learning, ch. 6
ShareTwitterLinkedIn