Why the Boundary Changes the Calculation
A symmetric kernel balances observations on the left and right of an evaluation point. Near the edge of a density's support, some of that balance falls outside the region where observations can occur. The ordinary kernel density estimator still assigns weight to those unavailable locations, so its expectation can be far below the true density—even when the density is smooth at the edge.
This is not just a small adjustment to the usual interior bias expansion. Within a bandwidth of the boundary, the fraction of the kernel that lies inside the support can remain substantially below one as the sample size grows and the bandwidth shrinks. Reflection and boundary-kernel methods address that missing mass in different ways.
The Ordinary Estimator Near the Edge
Taking the expectation of the estimator and changing variables to \(u=(x-y)/h\) gives, for \(x\geq 0\),
At an interior point, the whole kernel is available when \(h\) is small, and the usual bias expansion uses its full moments. At the boundary \(x=0\), only \(u\leq 0\) contributes. If \(f\) is continuous from the right at zero, the estimator's expectation approaches \(f(0)\int_{-\infty}^0K(u)\,du=f(0)/2\), not \(f(0)\). More generally, at \(x=ch\), for fixed \(c\geq0\), the leading multiplier of \(f(0)\) is \(\int_{-\infty}^cK(u)\,du\). This multiplier is generally less than one when \(c<1\).
Worked Example: A Uniform Kernel at the Boundary
Take \(K(u)=1/2\) for \(-1\leq u\leq1\), zero otherwise, and \(f(x)=e^{-x}\) for \(x\geq0\). This is a density because \(\int_0^\infty e^{-x}\,dx=1\), and its boundary value is \(f(0)=1\). Set \(h=0.2\).
At \(x=0\), the ordinary estimator has expectation
The estimate's expectation is less than half the true boundary density, \(1\). As \(h\) decreases, the displayed expression tends to \(1/2\), not to \(1\). The error is caused by the missing half of the kernel, rather than by a failure of \(f\) to be smooth: here \(f\) is differentiable at zero.
Reflection: Add the Missing Mass Back
Reflection treats each observation \(X_i\) as if it were accompanied by a mirror observation at \(-X_i\). For estimation on the nonnegative half-line, the resulting estimator is
The second term supplies kernel weight from the reflected side of the boundary. At zero, symmetry makes the two terms equal, so the expected kernel mass that was missing from the ordinary estimator is restored.
Worked Example: Reflection at Zero
Continue with the uniform kernel, exponential density, and \(h=0.2\). At \(x=0\), the two kernel terms in the reflection estimator are equal. Therefore,
This is much closer to the true value \(f(0)=1\) than the ordinary estimator's expectation, approximately \(0.4532\). It is not exactly one for this positive bandwidth: reflection restores the leading, constant-density contribution, but the density changes across the interval \([0,h]\).
Reflection also preserves total mass on the half-line. For a fixed observation \(X_i\), its two contributions integrate over \(x\geq0\) to
To verify the equality, symmetry gives \(\int_{-X_i/h}^{\infty}K(u)\,du=1-\int_{X_i/h}^{\infty}K(u)\,du\). Thus the reflected estimator integrates to one, observation by observation.
Normalized Boundary Kernels
A second correction keeps the ordinary kernel weights but renormalizes the part that falls within the support. Define \(A(t)=\int_{-\infty}^{t}K(u)\,du\). For \(x\geq0\), use
The factor \(A(x/h)\) is the fraction of the kernel available at \(x\). At \(x=0\), it equals \(1/2\) for a symmetric kernel, so the estimator doubles the ordinary boundary estimate. For a nonnegative kernel, the estimator remains nonnegative. This normalization is designed to correct the leading bias for a density that is locally constant; it does not generally eliminate bias from a changing density.
Worked Example: Normalization Just Inside the Boundary
Use the same density, kernel, and bandwidth, but now evaluate at \(x=0.1\). Then \(t=x/h=0.5\). For the uniform kernel, \(A(0.5)=\int_{-1}^{0.5}(1/2)\,du=0.75\). The boundary-kernel estimator's expectation is
The true density is \(f(0.1)=e^{-0.1}\approx0.9048\), so the expectation is about \(0.0409\) below the truth. The truncated kernel has been normalized, but the density is not constant over the observations receiving weight. The calculation illustrates why correcting the missing mass does not in general remove the first-order bias.
What the Corrections Do—and Do Not—Guarantee
Both methods address the leading boundary defect, but they make different adjustments. Reflection augments the contribution from each observation with its mirror image. A normalized boundary kernel divides by the available kernel mass at the evaluation point. Under the conditions above, both reproduce the boundary density to leading order in the boundary layer.
| Method | Boundary adjustment | Important limitation |
|---|---|---|
| Ordinary kernel estimator | None | Missing kernel mass produces order-one relative bias within a boundary bandwidth. |
| Reflection | Adds a mirrored kernel contribution. | It restores the leading boundary value, but generally leaves order-\(h\) bias when the density has a nonzero derivative at the boundary. |
| Normalized boundary kernel | Divides by the available kernel mass. | It reproduces a constant density locally, but generally leaves order-\(h\) bias and does not automatically integrate to one over the whole estimation domain. |
The reflection limitation can be seen directly at zero. For a differentiable density, its expected value is \(2\int_0^1K(u)f(hu)\,du\). A first-order expansion of \(f(hu)\) has a term \(hu f'(0)\); unless \(f'(0)=0\), this term contributes order-\(h\) bias. Reflection has extended the density evenly across zero, but a nonzero right derivative becomes a cusp in that extension.
On a finite interval \([a,b]\), one can reflect across the left and right endpoints. The construction must account for both boundaries, especially if the bandwidth is not small relative to the interval length. The half-line formulas here should not be applied at the right endpoint without changing the reflected terms. Boundary-kernel normalizations likewise depend on which part of the kernel lies inside the domain.
Common Pitfall
Wrong reasoning: “The kernel is symmetric, so its positive and negative contributions cancel; the usual interior bias expansion applies at the boundary.” Symmetry is not enough: at the left endpoint, observations with \(X_i<0\) cannot occur, so the estimator's expectation integrates only over \(u\leq0\) when \(x=0\). Half of a symmetric kernel's mass is missing.
Correction: First write the expectation integral with its support restriction. Only then expand the density or apply a correction. Near the boundary, check the available kernel mass explicitly; do not substitute the full-kernel moment calculation used at an interior point.
Check Your Understanding
Use the definitions and derivations above to answer these questions.
- For a symmetric unit-integral kernel and a continuous density with \(f(0)>0\), what does the ordinary estimator's expectation approach at \(x=0\) as \(h\) decreases?
- At \(x=ch\), what fraction of the boundary density appears in the leading limit of the ordinary estimator's expectation?
- Why does the reflected estimator's expectation approach \(f(0)\) at \(x=ch\) for fixed \(c\)? Identify the two kernel-mass terms.
- What feature of the normalized boundary kernel ensures reproduction of a locally constant density?
- Why can reflection still have order-\(h\) bias when the density has a nonzero derivative at the boundary?