From a Local Fit to a Regression Estimate
In nonparametric regression, the estimate at a point \(x\) is built from observations near \(x\), with nearby observations receiving more weight. A local constant fit makes the simplest possible local approximation: near \(x\), represent the regression function by a single number \(a\). Choosing that number by weighted least squares gives the Nadaraya–Watson estimator.
The fitted value is not generally centered on the true regression function \(m(x)=E[Y\mid X=x]\). Even away from boundaries, its leading smoothing bias depends on how curved \(m\) is and on how the design points are distributed nearby. The density contribution matters because local weighting averages responses over the observed design points, not over an evenly spaced grid.
The Degree-Zero Fit and Its Formula
Write \(K_h(t)=K(t/h)/h\). The local constant criterion is
Here \(a\) is the only coefficient: the local approximation has degree zero. The bandwidth determines the scale of the neighborhood, while the kernel determines how weights vary within it. Multiplying all weights by the same positive constant does not change the minimizer.
To verify the result, differentiate the criterion with respect to \(a\):
When the weights are nonnegative and their sum is positive, \(Q_x''(a)>0\), so the criterion is strictly convex. Setting \(Q_x'(a)=0\) gives \(a\sum_i K_h(X_i-x)=\sum_i K_h(X_i-x)Y_i\), which yields the stated minimizer. The common factor \(1/h\) cancels from numerator and denominator. \(\square\)
If all weights vanish, the criterion is constant in \(a\) and does not define a fitted value. In practice one reports the estimate only where the denominator is positive. The usual setting assumes a nonnegative kernel, so the fitted value is a weighted average of the responses with positive weights.
Worked Example: Calculating a Local Constant Fit
Suppose three observations are \((-0.5,1)\), \((0,2)\), and \((0.5,4)\). Estimate the regression function at \(x=0\) using \(h=1\) and the triangular kernel \(K(u)=1-|u|\) for \(|u|\leq 1\), with \(K(u)=0\) otherwise.
The scaled locations are \((X_i-x)/h=-0.5,0,0.5\). Their kernel weights are \(0.5,1,0.5\), respectively. Thus the denominator is \(0.5+1+0.5=2\), and the numerator is \(0.5(1)+1(2)+0.5(4)=4.5\). Therefore
This is the weighted average of the three responses, with the central observation receiving twice the weight of either outer observation.
The Interior Bias Expansion
To describe the leading smoothing bias, first consider the population version of the weighted average. Let \(X\) have density \(f\), let \(m(t)=E[Y\mid X=t]\), and suppose \(f(x)>0\). For a random observation, the conditional mean response at design value \(t\) is \(m(t)\). The population smoother at \(x\) is therefore
This ratio is the population target of the local constant weighted average. Its difference from \(m(x)\) is the smoothing bias. It is not, for finite \(n\), exactly the expectation of the sample ratio \(\hat m_{\mathrm{NW}}(x)\): taking the expectation of a ratio is not the same as taking the ratio of expectations.
The compact support and interior-point condition ensure that, for sufficiently small \(h\), the kernel neighborhood stays within the region where the stated smoothness conditions hold. Symmetry gives \(\int uK(u)\,du=0\); normalization and the second moment determine the remaining terms of this order.
For a proof, substitute \(t=x+hu\) in the numerator and denominator, cancelling the common factor \(h\). Define \(q(t)=m(t)f(t)\). Taylor expansion at \(x\), with the continuous second derivatives giving remainders uniform over the bounded support of \(K\), gives
The first-order terms vanish because the kernel is symmetric. Since \(f(x)>0\), divide the expansions using \(1/(f(x)+\delta)=1/f(x)-\delta/f(x)^2+o(\delta)\) as \(\delta\to0\). This yields
Now \(q(x)/f(x)=m(x)\), and differentiating \(q=mf\) gives \(q''=m''f+2m'f'+mf''\). Substituting and cancelling the terms involving \(mf''\) leaves \(m''+2m'f'/f\), proving the expansion. \(\square\)
The first part of the bracket, \(m''(x)\), is the contribution from curvature in the regression function. The second part, \(2m'(x)f'(x)/f(x)\), records how the design density changes across the local neighborhood. It vanishes when the density is locally flat or the regression function has zero slope at \(x\). This is an interior expansion; near a boundary, the effective kernel neighborhood need not be symmetric, so the argument and leading terms can change.
Worked Bias Calculations
Worked Example: Uniform Design and a Curved Regression Function
Let \(m(t)=t^2\) and suppose the design density is constant near \(x=1\). Use the normalized Epanechnikov kernel \(K(u)=\tfrac34(1-u^2)\) on \([-1,1]\), zero outside. Its second moment is
At \(x=1\), \(m'(1)=2\), \(m''(1)=2\), and \(f'(1)/f(1)=0\). The leading bias is consequently
The density contributes nothing in this example. The positive leading term comes from the curvature of the quadratic regression function.
Worked Example: A Nonuniform Design Adds Bias
Let \(m(t)=2+t\), so \(m'(0)=1\) and \(m''(0)=0\). Suppose near \(x=0\) the design density is proportional to \(\exp(t/2)\), giving \(f'(0)/f(0)=1/2\). With the same Epanechnikov kernel, \(\mu_2(K)=1/5\). The leading bias at zero is
Although the regression function is exactly linear, the local constant smoother has a nonzero leading bias here. The design places relatively more weight on observations to the right of zero, where the regression function is larger. This example isolates the density contribution.
Worked Example: Curvature and Density Contributions Cancel
Let \(m(t)=t^2\) and evaluate at \(x=1\), so \(m'(1)=2\) and \(m''(1)=2\). Suppose the density is locally proportional to \(\exp(-(t-1)/2)\), so \(f'(1)/f(1)=-1/2\). The bracket in the bias formula is
Thus the coefficient of \(h^2\) is zero, and the expansion says \(m_h(1)-m(1)=o(h^2)\). This does not establish that the bias is exactly zero for a nonzero bandwidth; it says only that the two leading contributions cancel.
Interpretation and a Common Pitfall
The formula shows why a local constant estimate can respond to the design even when the target \(m\) itself is unchanged: observations in denser parts of the neighborhood contribute more to the weighted average. A calculation that retains only \(m''(x)\) is valid only when the density term vanishes, for example when \(f'(x)=0\) or \(m'(x)=0\) at the point of interest. The logarithmic derivative \(f'(x)/f(x)\) describes the local relative change in density, so it is the relevant quantity rather than \(f'(x)\) alone.
- Wrong reasoning: “The kernel is symmetric, so the local average has no first-order effect and its leading bias is just the curvature term.”
- Correction: Kernel symmetry removes the first kernel moment, but it does not make the design density locally constant. Expanding both the numerator and denominator of the population ratio produces the additional term \(2m'(x)f'(x)/f(x)\).
A second distinction is also important: the derived expression is the leading bias of the population smoothing target. The sample estimator is a ratio with a random denominator, so its finite-sample expectation does not equal that target exactly. In applications, the displayed expansion describes the leading smoothing component; sampling variability and finite-sample ratio effects are separate considerations.
Check Your Understanding
Use the definitions and bias expansion to answer the following questions.
- What condition on the observed kernel weights ensures that the local constant criterion has a unique minimizer?
- For what reason can the expectation of the finite-sample Nadaraya–Watson estimator differ from the population smoother \(m_h(x)\)?
- If \(m'(x)=0\), which part of the leading interior bias remains?
- Suppose \(m''(x)=0\), \(m'(x)\ne0\), and \(f'(x)\ne0\). Does the leading bias necessarily vanish? Explain using the expansion.
- In the cancellation example, what does a zero coefficient of \(h^2\) establish, and what does it not establish?