Why the Zero Boundary Matters
Loss amounts are nonnegative, so their density is supported on \([0,\infty)\). A symmetric kernel, however, places half of its mass on either side of its center. When a kernel density estimate is evaluated at zero, the part extending into negative loss values has no observations to contribute. The result is a systematic downward effect at the boundary, even when the underlying density is smooth.
This is a feature of the estimator and its evaluation point, not evidence that the true density is necessarily small. Understanding the effect requires keeping the support of the loss distribution in view when taking expectations.
The usual kernel-density setup assumes the observations are drawn from a continuous distribution and that the kernel is integrable. For the boundary limit below, assume \(f_X\) has a finite right-hand limit at zero, denoted \(f_X(0)\), and that the integrands are dominated by an integrable function as \(h\) decreases to zero. These conditions hold for the examples in this tutorial. If losses have a separate probability mass at exactly zero, a continuous density alone does not describe that mass, and this analysis should not be applied to the atom as if it were ordinary density.
Deriving the Boundary Expectation
At \(x=0\), the expected estimate can be written as an integral over possible nonnegative losses. Changing variables makes the kernel’s half-mass contribution explicit.
As \(h\) decreases to zero, \(f_X(-ht)\) approaches the boundary value \(f_X(0)\) for each fixed \(t\leq 0\). Dominated convergence then gives the additive limit below. Symmetry and normalization of \(K\) give the last equality.
The additive form matters. If \(f_X(0)>0\), it also implies the ratio statement \(E[\widehat f_h(0)]/f_X(0)\to 1/2\), or equivalently \(E[\widehat f_h(0)]\sim f_X(0)/2\). If \(f_X(0)=0\), that ratio is not defined. In that case the additive limit still says \(E[\widehat f_h(0)]\to 0\), but the expectation may be positive for every \(h>0\) and may approach zero at a particular rate.
For a positive boundary density, the limiting bias at zero is consequently
Unlike the familiar interior bias that vanishes with bandwidth under smoothness conditions, this boundary bias does not vanish in the limit when \(f_X(0)>0\). The reason is geometric: even an arbitrarily narrow symmetric kernel centered at zero still puts half of its mass on the negative side.
Integrate only over \(y\geq 0\), because a nonnegative loss cannot take a negative value.
Use \(t=-y/h\) at zero; the integration range becomes \(t\leq 0\).
Replace \(f_X(-ht)\) by its right-hand boundary limit inside the integral, under the stated domination condition.
The integral of \(K\) from \(-\infty\) to zero is \(1/2\), not \(1\).
Worked Boundary Calculations
Worked Example: Exponential Losses With a Normal Kernel
Suppose hypothetical individual losses have density \(f_X(y)=e^{-y}\) for \(y\geq 0\), and use the standard normal kernel \(K(t)=\phi(t)\) with bandwidth \(h=0.5\). Find the expected kernel estimate at zero and compare it with the true boundary density. Here \(\phi\) and \(\Phi\) denote the standard normal density and distribution function.
Method. Substitute the exponential density into the boundary expectation and complete the square. This evaluates the finite-bandwidth expectation rather than using only its small-bandwidth limit.
Step 1: Set up the expectation. With \(t\leq 0\), \(f_X(-ht)=e^{ht}\), so
Step 2: Complete the square. Since \(-t^2/2+ht=-(t-h)^2/2+h^2/2\), the substitution \(z=t-h\) gives
Step 3: Insert the bandwidth. For \(h=0.5\),
The true boundary density is \(f_X(0)=1\), so the expected estimate is about \(0.3496\), below the limiting half-density value \(0.5\). The difference from \(0.5\) at this bandwidth reflects the fact that the exponential density decreases as one moves into the positive-loss region. As \(h\to 0\), the exact expression tends to \(1/2\), as the boundary limit predicts. The common mistake avoided here is treating the limiting half-density result as the exact answer at a finite bandwidth.
Check. The value \(e^{0.125}\Phi(-0.5)\) is positive and less than \(0.5\), consistent with a decreasing density and the half-mass boundary limit.
Worked Example: A Flat Density Near Zero
A hypothetical loss \(X\) is uniform on \([0,2]\), so \(f_X(y)=1/2\) on that interval. Estimate the expected density at zero using the Epanechnikov kernel \(K(t)=\frac{3}{4}(1-t^2)\) for \(|t|\leq 1\), and \(K(t)=0\) otherwise, with bandwidth \(h=0.4\).
Method. Because the kernel is zero outside \([-1,1]\), only losses between zero and \(h=0.4\) contribute. The density is constant throughout that range, so the expectation is exactly half the true density.
Step 1: Rescale. The boundary expectation is
Step 2: Integrate the kernel over the negative half.
Step 3: Multiply by the density.
The true boundary density is \(0.5\), so the expected estimate is exactly half of it. The calculation is exact here because the density is constant over the kernel’s contributing range; it is not merely an approximation for small bandwidth. This example also checks that the Epanechnikov kernel has total mass one and negative-half mass \(1/2\).
Worked Example: A Density That Is Zero at the Boundary
Suppose hypothetical losses have the density \(f_X(y)=ye^{-y}\) for \(y\geq 0\), a gamma density with shape 2 and rate 1. Use the standard normal kernel and \(h=0.2\). Find the boundary expectation and explain why it cannot be described as asymptotic to \(f_X(0)/2\).
Method. The true boundary density is zero, so retain an additive expression and compute the leading order of the expectation instead of forming a ratio to \(f_X(0)\).
Step 1: Transform the boundary integral. Since \(f_X(-ht)=(-ht)e^{ht}\), and \(u=-t\),
Step 2: Evaluate the integral. Using \(\phi'(u)=-u\phi(u)\) and integration by parts,
The second equality follows by completing the square in the remaining normal integral. Therefore
Step 3: Evaluate at \(h=0.2\). Using \(\phi(0)=0.3989423\), \(e^{0.02}\approx1.0202013\), and \(\Phi(-0.2)\approx0.4207403\),
Here \(f_X(0)=0\), so \(f_X(0)/2=0\). The expectation is positive at \(h=0.2\), but it tends to zero as \(h\to0\); more specifically, \(E[\widehat f_h(0)]/h\to\phi(0)\). Thus the correct general statement is the additive limit \(E[\widehat f_h(0)]=f_X(0)/2+o(1)\). Writing a ratio equivalence to \(f_X(0)/2\) would be invalid because the comparison quantity is zero.
Check. The expression is positive for \(h=0.2\) and approaches zero with \(h\), which is consistent with the true boundary density being zero.
Common Mistakes and Interpretation
Boundary bias describes the expectation of an estimator over repeated samples. It does not require every individual estimate to be below the true density. A realized sample can produce a high boundary estimate if several observed losses lie close to zero.
For example, with the Epanechnikov kernel and bandwidth \(h=0.5\), consider the hypothetical observed losses \(0.1,0.3,0.8\). The scaled arguments at zero are \(-0.2,-0.6,-1.6\). Their kernel values are \(0.72,0.48,0\), respectively, so the estimate is
This estimate can exceed a model’s true boundary density even though the estimator has a downward boundary effect in expectation. A single realization and an expectation answer different questions.
When applying this result, identify the support, check whether the boundary density is positive or zero, and distinguish a finite-bandwidth calculation from a limiting statement. These checks prevent two opposite errors: claiming that every estimate is too low, and applying a ratio asymptotic when the boundary density vanishes.
Check Your Understanding
For each problem, identify the support and kernel contribution before calculating.
- A hypothetical loss is uniform on \([0,5/3]\). With the Epanechnikov kernel and bandwidth \(h=0.2\), what is the expected estimate at zero? (Answer: \(0.3000\))
- Losses have density \(e^{-x}\) for \(x\geq0\). With the standard normal kernel and \(h=1\), calculate the expected estimate at zero using \(e^{h^2/2}\Phi(-h)\). (Answer: \(0.2616\))
- A hypothetical loss density is \(f_X(x)=2(1-x)\) for \(0\leq x\leq1\), and zero otherwise. Using the Epanechnikov kernel with \(h=0.5\), calculate the expected estimate at zero and compare it with \(f_X(0)\). (Answer: \(0.8125\), compared with \(f_X(0)=2\))
- For \(f_X(x)=xe^{-x}\), \(x\geq0\), with a standard normal kernel, find \(\lim_{h\to0}E[\widehat f_h(0)]/h\). Should the expectation be written as asymptotic to \(f_X(0)/2\)? (Answer: \(1/\sqrt{2\pi}\approx0.3989\); no, because \(f_X(0)/2=0\))
- Three hypothetical losses are \(0.1,0.3,0.8\). Using the Epanechnikov kernel and \(h=0.5\), calculate the estimate at zero and explain whether it contradicts downward boundary bias in expectation. (Answer: \(0.8000\); no, a realized estimate may exceed the true density even when its expectation is biased downward.)