Why Use Higher-Order Kernels?
Kernel density estimation smooths the empirical distribution by replacing each observation with a rescaled kernel. For a conventional symmetric, nonnegative kernel, the leading smoothing bias is typically proportional to \(h^2\), where \(h\) is the bandwidth. If the density is sufficiently smooth, a kernel with additional vanishing moments can cancel that leading term and make the bias shrink faster as \(h\) decreases.
The cancellation has a cost. A nonnegative kernel with total integral one cannot have a zero second moment: its squared argument is nonnegative, so that moment can vanish only if all its mass is concentrated at zero. Higher-order kernels therefore must take negative values somewhere. Their kernel density estimates still integrate to one under ordinary conditions, but they can be negative at particular points and so need not be probability densities in the usual nonnegative sense.
Definition and Bias Expansion
Let \(X_1,\ldots,X_n\) be independent observations from a density \(f\). For a bandwidth \(h>0\) and an integrable kernel \(K\), define the kernel density estimator by
The \(j\)th kernel moment is \(\mu_j(K)=\int_{\mathbb R}u^jK(u)\,du\), when this integral exists. A kernel may be signed; its normalization condition is \(\mu_0(K)=\int K(u)\,du=1\). For an even integer \(p\geq 2\), the following definition describes a kernel whose first nonzero moment after normalization is of order \(p\).
For an order-\(p\) kernel, the vanishing moments remove the Taylor terms of degrees \(1\) through \(p-1\) from the expectation of the estimator. The next result makes that statement precise. The global derivative conditions are convenient sufficient conditions for justifying the remainder integral.
Proof. Since the observations have density \(f\), a change of variable gives
The integral is well-defined because \(f\) is bounded and \(K\) is absolutely integrable. Taylor's formula through order \(p\) gives
For each fixed \(u\), continuity of \(f^{(p)}\) at \(x\) implies \(R_h(u)/h^p\to0\). Boundedness of \(f^{(p)}\), using the integral form of the Taylor remainder, also gives \(|R_h(u)|/h^p\leq C|u|^p\) for a constant \(C\) independent of \(h\) and \(u\). Thus \(|K(u)R_h(u)|/h^p\) is bounded by an integrable function, \(C|u|^p|K(u)|\). The dominated convergence theorem therefore yields \(\int K(u)R_h(u)\,du=o(h^p)\). Integrating the Taylor polynomial, the \(j=0\) term is \(f(x)\); the terms for \(1\leq j<p\) vanish by the moment conditions; and the \(j=p\) term is \((-1)^ph^p\mu_p(K)f^{(p)}(x)/p!\). Since \(p\) is even, \((-1)^p=1\). This proves the expansion. \(\square\)
Worked Example: The Leading Bias With a Gaussian Kernel
Let both the kernel and the true density be the standard normal density \(\phi\), and evaluate the estimator's expectation at \(x=0\). The Gaussian kernel has \(\mu_2(K)=1\), and \(f''(0)=-\phi(0)\). The second-order bias expansion therefore gives
For a direct check, the expected estimator is the density at zero of a \(N(0,1+h^2)\) random variable: adding Gaussian smoothing with variance \(h^2\) to a \(N(0,1)\) density gives that convolution. Hence
At \(h=0.2\), \(h^2=0.04\), so the exact expectation is \(\phi(0)/\sqrt{1.04}\), while the target is \(\phi(0)\). The bias is \(\phi(0)(1/\sqrt{1.04}-1)\), approximately \(-0.00775\). The leading-term approximation is \(-\phi(0)(0.04)/2\), also approximately \(-0.00798\). The difference between these values is consistent with a leading expansion, not an exact equality at a fixed bandwidth.
Why Higher-Order Kernels Must Be Signed
The reason negative values arise is already contained in the second-moment condition. This fact does not depend on a particular kernel formula.
Proof. If \(K\geq0\), then \(u^2K(u)\geq0\), so its integral is nonnegative. If that integral were zero, the nonnegative function \(u^2K(u)\) would have to equal zero almost everywhere. Since \(u^2>0\) except at the single point \(u=0\), this would imply \(K(u)=0\) almost everywhere away from zero. A single point has Lebesgue measure zero, so an integrable function supported there almost everywhere has integral zero. That contradicts \(\int K(u)\,du=1\). Thus the second moment is strictly positive. Any order-four kernel must have zero second moment and consequently cannot be nonnegative almost everywhere. \(\square\)
Worked Example: Constructing a Fourth-Order Kernel
Let \(\phi\) denote the standard normal density and define
If \(Z\sim N(0,1)\), the moments of this kernel can be checked using \(E[Z^2]=1\), \(E[Z^4]=3\), and \(E[Z^6]=15\). First,
The kernel is symmetric, so \(\mu_1(K_4)=\mu_3(K_4)=0\). Its fourth moment is
Thus \(K_4\) is a fourth-order kernel. Its sign is visible from its formula: \(\phi(u)>0\), while \(3-u^2<0\) whenever \(|u|>\sqrt{3}\). The fourth-order bias expansion has leading term \(-3h^4 f^{(4)}(x)/4!= -h^4 f^{(4)}(x)/8\). The negative coefficient is not an error; it follows from the kernel's negative fourth moment.
A Normalized Estimate Can Be Negative
For any integrable kernel with \(\int K=1\), the estimator integrates to one. Indeed, each summand has integral one after rescaling. This property alone does not make the estimator a density: a density must also be nonnegative almost everywhere. Signed kernels preserve the integral but do not guarantee nonnegativity.
To verify the integral, use linearity and the change of variable \(u=(x-X_i)/h\), so \(dx=h\,du\). Absolute integrability justifies integrating each summand:
Worked Example: A Negative Fourth-Order Estimate
Take one observation \(X_1=0\), bandwidth \(h=1\), and the fourth-order kernel \(K_4\) above. At the evaluation point \(x=2\), the estimate is
The negative sign follows exactly from \(3-2^2=-1\); the displayed decimal is rounded to six places. Yet the estimate integrates to one, since it is a translated copy of a kernel with integral one. It is therefore a normalized signed estimate, not a nonnegative density. This example is a direct illustration of the distinction between preserving total integral and satisfying all the requirements of a density.
Trade-Offs and a Common Pitfall
The bias expansion explains the attraction of higher-order kernels: when the required derivatives exist and the relevant leading derivative is nonzero, an order-\(p\) kernel reduces the leading pointwise bias from order \(h^2\) to order \(h^p\). This does not by itself guarantee a smaller overall estimation error. The bandwidth also affects variance, and the kernel's shape affects the variance constant. The bias expansion is local and asymptotic; it is not a claim that the estimate is closer to the truth at every point or for every sample.
A common mistake is to reason, “The estimate integrates to one, so it is a density and cannot be negative.” The correction is that normalization and nonnegativity are separate conditions. The integral calculation only establishes total signed mass one. With a higher-order kernel, negative contributions are needed to cancel low-order moments, and those contributions can make the estimated value negative. Truncating negative estimates at zero or renormalizing them may be useful for some purposes, but it changes the estimator; it does not show that the original estimate was nonnegative or that the modified estimate has the same bias expansion.
Check Your Understanding
Use the definitions and calculations above to answer these questions.
- What moment conditions distinguish an order-four kernel from a normalized second-order kernel?
- Under the theorem's assumptions, what is the leading bias term for an order-\(p\) kernel at \(x\)?
- Why can a nonnegative integrable kernel with integral one not have a zero second moment?
- For \(K_4(u)=(3-u^2)\phi(u)/2\), identify the region where the kernel is negative.
- Why does an estimate that integrates to one still fail to be a density when it is negative on part of its domain?