Bandwidth Selection for Smoothers
The single dial that controls every nonparametric smoother — kernel density estimates, kernel regression, LOESS — trading off a noisy, wiggly fit against a smooth but biased one, and the main job is picking its value in a principled way.
Prerequisites: Kernel Density Estimation, The RBF Kernel and Bandwidth Selection
Every nonparametric smoother — a kernel density estimate of return distributions, a kernel regression of implied vol against strike, a LOESS fit through noisy scatter — has one number you must choose before anything else: the bandwidth. It controls how wide a "neighborhood" of nearby data points gets averaged together at each point of the fit. Get it wrong in one direction and your fit is a jagged mess that chases noise; get it wrong in the other and it's an overly smooth blur that hides real structure. Every other decision in nonparametric smoothing is secondary to getting this one number right.
An analogy: a camera's focus and blur
Think of bandwidth like the blur radius on a photo filter. A tiny blur radius leaves every pixel nearly untouched — you preserve fine detail, but also every speck of sensor noise, so the image looks grainy and jittery. A huge blur radius smooths away the noise beautifully, but it also smears out real edges and features you wanted to see — a face becomes an unrecognizable smudge. There's no blur radius that's "correct" in some absolute sense; the right amount depends on how much genuine fine detail exists versus how much of what looks like detail is actually noise. Bandwidth selection is choosing that blur radius for your data.
The idea, one symbol at a time
For a kernel smoother with bandwidth , the expected squared error at a point decomposes as
where is the sample size and are constants depending on the true underlying function's curvature and the noise level. In plain English: a larger averages over more points, which smooths out noise (shrinking the variance term ) but also blurs together points where the true function is actually changing, introducing systematic bias (growing as ). A smaller does the opposite — low bias, high variance. Minimizing the sum over gives the theoretically optimal bandwidth for typical kernel smoothers: it shrinks as data accumulates, but only slowly, at the fifth-root rate rather than the square-root rate you might expect from simple averaging.
Worked example 1: kernel density estimate of returns
Suppose you're estimating the density of 1,000 daily returns using a Gaussian kernel. Silverman's rule-of-thumb bandwidth is . With (daily return standard deviation) and : , so . Using produces a density estimate that's smooth enough to reveal the overall shape (fat tails, slight skew) without artificially breaking it into spurious little bumps around individual return values, which a much smaller (say ) would do.
Worked example 2: cross-validation picks it automatically
Rather than a formula, you can pick by leave-one-out cross-validation: for a grid of candidate bandwidths , refit the smoother leaving out each point in turn and measure how well the fit (built without that point) predicts it. Suppose the resulting average prediction errors are (in some error units) for the five candidates respectively — the error dips at and rises on both sides, tracing out exactly the U-shaped bias-variance tradeoff. Cross-validation picks the bandwidth at the bottom of that U, here confirming the rule-of-thumb value.
The explorer above plots the same tradeoff for model complexity in general; for a smoother, bandwidth plays the role of complexity in reverse — small h is high complexity (low bias, high variance), large h is low complexity (high bias, low variance). Drag it and watch the U-shaped total error curve.
What this means in practice
Bandwidth selection is the practical crux of every nonparametric method used in quant work: estimating a return density for VaR, smoothing an implied volatility surface with kernel regression, or fitting a LOESS curve through noisy factor exposures over time. Whenever a nonparametric fit looks suspiciously jagged or suspiciously flat, the first thing to check is not the method itself but the bandwidth it was given — cross-validation is the general-purpose fix when a rule-of-thumb formula doesn't fit the data well.
Bandwidth controls the bias-variance tradeoff for every nonparametric smoother: small bandwidth means low bias but high variance (a noisy, wiggly fit), large bandwidth means low variance but high bias (an oversmoothed fit). Cross-validation, or a plug-in formula like Silverman's rule, picks the bandwidth that minimizes their sum.
A single bandwidth chosen for the bulk of the data is often wrong in the tails or in sparse regions, where fewer nearby points mean the same effectively averages over far less local information — producing a systematically worse fit exactly where you can least afford it, such as the tail of a return distribution used for risk estimation. Variable-bandwidth methods exist for this reason; a fixed global bandwidth is a simplification, not a law.
Related concepts
Practice in interviews
Further reading
- Silverman, Density Estimation for Statistics and Data Analysis, ch. 3
- Hastie, Tibshirani & Friedman, The Elements of Statistical Learning, ch. 6