Tutorials › Statistical Learning (Graduate) › Lepski’s Method for Selecting a Smoothing Scale

Adaptation and Honest Uncertainty · Tutorial 469 of 989

Lepski’s Method for Selecting a Smoothing Scale

Learn how to order kernel bandwidths, calibrate pairwise stochastic thresholds, and select the coarsest scale that remains compatible with finer estimates.

Advanced 11 min read

What You'll Learn

  • Define pointwise kernel estimates on an ordered bandwidth grid
  • Relate kernel weights to stochastic error scales
  • Calibrate thresholds for simultaneous pairwise comparisons
  • Apply Lepski’s selection rule, including its tie convention
  • Check threshold calculations and diagnose a common scale-selection error

Why Compare Estimates Across Bandwidths?

At a fixed point \(x_0\), a kernel estimate depends on its bandwidth. A narrow bandwidth uses observations close to \(x_0\), so it can track local features but is relatively noisy. A wider bandwidth averages more observations and is typically less noisy, but can smooth away local variation. Lepski’s method uses the estimates themselves to decide how far the bandwidth can be increased without creating a discrepancy that is too large to explain by stochastic error.

The method requires a finite, ordered collection of bandwidths and thresholds matched to the noise scale of each estimate. Its selection rule is precise: choose the largest bandwidth whose estimate agrees, within the specified thresholds, with every estimate at a finer bandwidth. This tutorial develops that construction and its basic stochastic justification; it does not require knowing the unknown smoothness of the regression function.

Pointwise Kernel Estimates and Their Error Scales

For concreteness, consider fixed design points \(x_1,\ldots,x_n\) and observations \(Y_i=f(x_i)+\varepsilon_i\). The errors are independent, have mean zero, and are sub-Gaussian with scale \(\sigma\): for every real \(t\), \(E[\exp(t\varepsilon_i)]\leq \exp(\sigma^2t^2/2)\). The design points are treated as fixed. Let \(K\) be a nonnegative kernel supported on \([-1,1]\), and suppose its denominator below is positive for each bandwidth under consideration.

Definition: For a bandwidth \(h\), define the pointwise kernel estimate at \(x_0\) by \(\hat f_h(x_0)=\sum_{i=1}^n w_{i,h}(x_0)Y_i\), where \(w_{i,h}(x_0)=K((x_i-x_0)/h)\big/\sum_{r=1}^n K((x_r-x_0)/h)\). Thus the weights are nonnegative and sum to one. Write \(m_h(x_0)=E[\hat f_h(x_0)]\) and \(\xi_h(x_0)=\hat f_h(x_0)-m_h(x_0)\). The quantity \(m_h(x_0)\) is the mean of the estimate, while \(\xi_h(x_0)\) is its centered stochastic error.

For a regular design and a bounded kernel, a usual weight condition is \(\sum_i w_{i,h}(x_0)^2\leq C/(nh)\), where \(C\) is a constant independent of \(h\) and \(n\). The sub-Gaussian error assumption then gives a stochastic scale no larger than \(\sigma\sqrt{C/(nh)}\). More generally, the construction only needs known upper bounds \(v_j\) on the scales of the centered estimates, with those upper bounds nonincreasing as the bandwidth increases.

Choose bandwidths \(h_1< h_2<\cdots<h_M\), from finest to coarsest. Let \(v_j\) be a positive, nonincreasing upper bound on the stochastic scale of \(\hat f_{h_j}(x_0)\). For example, under the weight condition one may take \(v_j=\sigma\sqrt{C/(nh_j)}\). A high-probability multiplier \(q\) gives the comparison threshold \(\tau_j=2qv_j\) for the \(j\)th, finer estimate in a comparison.

Definition: The Lepski selector is \(\hat j=\max\{j\in\{1,\ldots,M\}: |\hat f_{h_j}(x_0)-\hat f_{h_k}(x_0)|\leq\tau_k\ \text{for every }k<j\}\), with selected bandwidth \(\hat h=h_{\hat j}\). The index \(j=1\) passes vacuously because it has no finer estimates to compare with. If multiple indices pass, the maximum chooses the coarsest passing bandwidth.

The threshold is indexed by \(k\), the finer bandwidth in the pair. Its estimate generally has the larger stochastic scale. Thus a candidate coarse estimate is checked against each finer estimate using that finer estimate’s threshold. A comparison against only the immediately preceding bandwidth is not the rule: every finer estimate must pass.

Worked Comparisons

Worked Example: Applying the Rule at Three Bandwidths

Suppose \(h_1=0.05<h_2=0.10<h_3=0.20\), and the observed estimates at \(x_0\) are \(2.00, 1.90,\) and \(1.80\), respectively. Let \(\tau_1=\tau_2=0.10\).

Index 1 passes vacuously. At index 2, the only comparison is \(|1.90-2.00|=0.10\), which equals \(\tau_1\), so index 2 passes. At index 3, the comparisons are \(|1.80-2.00|=0.20>0.10\) and \(|1.80-1.90|=0.10\leq0.10\). Since the first comparison fails, index 3 does not pass. The selector is therefore \(\hat j=2\), and it chooses \(h_2=0.10\).

Now change only the first estimate from \(2.00\) to \(1.90\), leaving the second and third estimates at \(1.90\) and \(1.80\). At index 3 the differences are \(|1.80-1.90|=0.10\) from the first estimate and \(|1.80-1.90|=0.10\) from the second. Both equal their thresholds, so index 3 passes and is selected. Equality counts as passing because the rule uses \(\leq\).

Worked Example: Calibrating a Simultaneous Threshold

Suppose \(n=1000\), \(\sigma=0.5\), the weight bound has \(C=2\), and the candidate grid has \(M=4\) bandwidths. Choose a target failure probability \(\delta=0.05\), and set \(q=\sqrt{2\log(2M/\delta)}\). For a sub-Gaussian scale bound \(v_j\), use \(\tau_j=2qv_j\).

Here \(2M/\delta=160\), so \(q=\sqrt{2\log(160)}\approx3.186\). For a finer bandwidth \(h_1=0.10\), \(v_1=0.5\sqrt{2/(1000\cdot0.10)} =0.5\sqrt{0.02}\approx0.07071\). Consequently, \(\tau_1=2(3.186)(0.07071)\approx0.451\).

For \(h_2=0.20\), \(v_2=0.5\sqrt{2/(1000\cdot0.20)} =0.5\sqrt{0.01}=0.05\), so \(\tau_2=2(3.186)(0.05)\approx0.319\). The larger threshold for the finer estimate reflects its larger stochastic scale. These values are calibration examples; in an application, the scale bound and multiplier must be chosen to match the error assumptions and desired probability guarantee.

Worked Example: Interpreting Comparisons Under a Smoothness Model

Consider the regression function \(f(t)=t^2\) at \(x_0=0\), with a symmetric uniform kernel on \([-1,1]\). In the continuous-design smoothing calculation, the mean of the kernel average at bandwidth \(h\) is \(m_h(0)=\frac12\int_{-1}^1 (hu)^2\,du\). Since \(\frac12\int_{-1}^1u^2\,du=1/3\), this gives \(m_h(0)=h^2/3\).

For \(h_1=0.20,h_2=0.40,h_3=0.80\), the corresponding means are \(0.04/3\approx0.0133\), \(0.16/3\approx0.0533\), and \(0.64/3\approx0.2133\). Suppose the observed estimates are \(0.02,0.06,0.20\), with thresholds \(\tau_1=0.05\) and \(\tau_2=0.12\). The second bandwidth passes because \(|0.06-0.02|=0.04\leq0.05\). The third fails: its differences from the first and second estimates are \(0.18>0.05\) and \(0.14>0.12\), respectively. The selected bandwidth is \(h_2=0.40\).

The calculation illustrates the role of comparisons, not a performance guarantee. The means at wider bandwidths differ more because smoothing changes the target being averaged; the selector does not observe those means directly. It uses the observed estimates and stochastic thresholds to decide whether their discrepancies are large relative to estimated noise scales.

Why the Threshold Controls Stochastic Disagreement

The basic calibration argument needs no independence between the kernel estimates: they are computed from the same observations and are generally dependent. A simultaneous bound for each centered estimate is enough. The next result states the guarantee explicitly.

Theorem: Suppose that for each \(j=1,\ldots,M\) and every \(u>0\), \(P(|\xi_{h_j}(x_0)|>u v_j)\leq2\exp(-u^2/2)\), where \(v_j\) is nonincreasing in \(j\). Let \(q=\sqrt{2\log(2M/\delta)}\), for \(0<\delta<1\), and set \(\tau_k=2qv_k\). Then, with probability at least \(1-\delta\), every pairwise stochastic difference satisfies \(|\xi_{h_j}(x_0)-\xi_{h_k}(x_0)|\leq\tau_k\) whenever \(k<j\).

Proof. For each \(j\), apply the assumed tail bound with \(u=q\): \(P(|\xi_{h_j}(x_0)|>qv_j)\leq2\exp(-q^2/2)=\delta/M\). The union bound therefore gives \(P(\text{some }j\text{ has }|\xi_{h_j}(x_0)|>qv_j)\leq \sum_{j=1}^M\delta/M=\delta\). On the complementary event, take any \(k<j\). Since \(v_j\leq v_k\), the triangle inequality yields \[ |\xi_{h_j}(x_0)-\xi_{h_k}(x_0)| \leq|\xi_{h_j}(x_0)|+|\xi_{h_k}(x_0)| \leq qv_j+qv_k \leq2qv_k=\tau_k. \] This holds for every pair on the same event, whose probability is at least \(1-\delta\). \(\square\)

For the fixed-design model above, the tail condition follows from the sub-Gaussian assumption. Indeed, independence gives \(E[\exp(t\xi_h)]=\prod_i E[\exp(tw_{i,h}\varepsilon_i)] \leq\exp(t^2\sigma^2\sum_iw_{i,h}^2/2)\). Thus a valid scale is \(v_h=\sigma\sqrt{\sum_iw_{i,h}^2}\), or any upper bound on it. If the chosen upper bounds decrease with bandwidth, the theorem applies. The union bound accounts for all \(M\) estimates and does not require their errors to be independent.

What the Comparison Means—and What It Does Not Mean

Write \(m_j=m_{h_j}(x_0)\) and \(\xi_j=\xi_{h_j}(x_0)\), so that \(\hat f_{h_j}(x_0)=m_j+\xi_j\). For a pair \(k<j\), the observed difference is the sum of a mean difference and a stochastic difference. On the simultaneous event in the theorem, the stochastic part is at most \(\tau_k\). Thus a discrepancy beyond \(\tau_k\) cannot be explained by that event’s stochastic fluctuation alone; it signals a difference between the estimates’ means as well.

A useful deterministic implication makes the converse direction precise. If for every \(k<j\), \(|m_j-m_k|\leq\tau_k-2qv_k\), and the right-hand sides are nonnegative, then index \(j\) passes on the simultaneous event. In fact, on that event, \[ |\hat f_{h_j}(x_0)-\hat f_{h_k}(x_0)| \leq|m_j-m_k|+|\xi_j-\xi_k| \leq(\tau_k-2qv_k)+2qv_k =\tau_k. \] This is a comparison fact, not an oracle bound: it does not by itself quantify the risk of the selected estimate or establish adaptation over a function class.

If all candidate estimates have the same mean \(m\), then every mean difference is zero. On the simultaneous event, every pairwise comparison passes, so the selector chooses \(h_M\), the coarsest candidate. This follows directly from the comparison guarantee and the maximum-index rule. If means separate as bandwidth increases, some coarse candidates may fail, and the rule returns the coarsest one that still agrees with all finer estimates at the prescribed stochastic scale.

Common Mistakes and Practical Checks

  • Comparing only adjacent bandwidths. Passing the comparison with \(h_{j-1}\) does not imply passing comparisons with every \(h_k\), \(k<j-1\). The definition requires all finer estimates.
  • Using the candidate’s coarse scale for every threshold. The threshold for comparing with \(h_k\) is based on the finer estimate’s scale \(v_k\), not simply on the candidate bandwidth’s scale.
  • Reversing the order. Here \(h_1\) is the finest bandwidth and \(h_M\) the coarsest. The rule maximizes the index, not the amount of local detail.
  • Treating the threshold as a bias bound. It calibrates stochastic differences. The rule does not know the mean differences or guarantee that every passing estimate has small bias.
  • Miscomputing a pairwise difference. Recalculate each absolute difference from the displayed estimates before comparing it with its threshold. For example, if the estimates are \(1.90,1.90,1.80\), the last estimate differs from each of the first two by \(0.10\), not by \(0.00\).

Lepski’s selector is useful because its comparisons use observable estimates and thresholds rather than the unknown smoothness level. The stochastic calibration explains why the comparisons are meaningful; evaluating the risk and adaptation properties of the selected bandwidth requires additional analysis.

Check Your Understanding

Use the rule and threshold convention from this tutorial.

  1. For three bandwidths, which estimates must the third candidate be compared with before it can pass?
  2. If \(v_1\geq v_2\geq v_3\), why does the bound \(qv_j+qv_k\leq2qv_k\) hold when \(k<j\)?
  3. With estimates \(3.0,2.9,2.7\) and thresholds \(\tau_1=0.1,\tau_2=0.2\), which index is selected? Show each comparison.
  4. Why does the simultaneous stochastic comparison result not require independent kernel estimates?
  5. What does a failed comparison indicate on the event in the theorem, and what does it not establish about the selected estimate’s risk?
Clinical Biostats