Kernel for density estimation Created 2026-09-24 Updated 2026-10-14
A kernel for density estimation is an integrable function with unit integral. For an ordinary kernel density estimator that is itself a probability density function, take
Thus specifies the bump's shape and the smoothing bandwidth specifies its width. The factor preserves area: doubling the smoothing bandwidth doubles the width and halves the height. An even function is a common choice; when its absolute first moment is finite, its mean is zero. Symmetry is useful but is not required for normalization.
The Gaussian density kernel is the standard normal density, . Its rescaled translate is the normal probability density with mean and standard deviation . It is positive everywhere, whereas an Epanechnikov kernel has compact support. With the Gaussian density kernel, the smoothing bandwidth is a standard deviation, not a cutoff beyond which observations have no influence.
The broader convention also allows signed kernels of order ell, such as the flat-top kernel for density estimation, to cancel moments and reduce the bias of an estimator. Their unit integral still normalizes total area, but a resulting kernel density estimator can take negative values and need not be a probability density function. Nonnegativity is therefore an additional condition, not a consequence of unit integral.
Let a bounded probability density function have Fourier transform supported in the plateau of a flat-top kernel for density estimation. At fixed smoothing bandwidth one, the convolution theorem gives , so the kernel density estimator is pointwise unbiased. Its variance is at most , and the Cauchy-Schwarz inequality proves the displayed rate. An explicit example is , with value at zero and transform . Direct inverse Fourier integration gives the formula. The function is nonnegative, integrable and has integral one because its transform at zero is one. Compact frequency support also gives bounded derivatives of every order.
For a kernel for density estimation and smoothing bandwidth , the kernel density estimator is
We use the convention that a kernel of order ell has
The kernel for density estimation is integrable and can have negative values; requiring nonnegativity would prevent its second moment from vanishing. Some conventions additionally require a nonzero moment of order . The construction below covers that convention too.
The Legendre polynomial kernel construction uses the polynomial reproducing kernel at zero:
Every polynomial of degree at most has the expansion , since the displayed Legendre polynomials have those successive degrees and form an orthonormal basis of this polynomial space. Therefore
Taking proves all the required moment identities. Boundedness and compact support give every absolute moment and a finite L2 norm. If a nonzero moment of order is required, replace this kernel by
The lower moments are unchanged by orthogonality. If , then because otherwise would lie in the polynomial space of degree at most . Evaluating its full Legendre expansion at zero gives , so .
For instance, a simple kernel satisfying the moment conditions needed for three derivatives is
Its negative wings cancel its central contribution to the second moment.
Figure 1.
Signed kernel and cancellation of its second moment
. Details.
Here is the third-order pointwise kernel error bound. Write and , and use any square-integrable kernel with unit integral, first two moments zero and . A change of variables gives
By the Taylor theorem with Lagrange remainder,
The moment cancellations consequently give the uniform bias of a kernel density estimator bound
For the variance, independence and another change of variables give
The triangle inequality and Cauchy-Schwarz inequality now yield
Balancing against gives
The constant is independent of both and . The original PDF has exponent ; the converted TeX's is a transcription error.
To obtain the final parametric rate, we choose a flat-top kernel for density estimation. This kernel also satisfies all the preceding moment conditions, so a single kernel works for both constructions, with different bandwidth choices. With the Fourier transform convention , choose a real even function equal to one on and zero outside , and put
Such a cutoff is explicit: if for and zero otherwise, take . It is constant near zero, and its endpoint transitions are smooth. Repeated integration by parts shows that and all its derivatives decay faster than every power, so lies in the Schwartz space. The Fourier inversion and moment differentiation of the Fourier transform give
Thus this kernel can be used with for the preceding general bound.
For the sharper example choose the probability density function
To check this is a density and identify its Fourier transform, direct integration gives
The continuous value at zero is as displayed. This function is nonnegative and integrable, being bounded near zero and at infinity. Fourier inversion gives , and in particular . Differentiation of this compact frequency integral also shows that and are bounded. Since on the support of , the convolution theorem gives
Both sides are continuous, so the equality holds at every . There is therefore exactly zero bias of a kernel density estimator at bandwidth one, and the variance bound above gives
This is parametric-rate kernel estimation of a bandlimited density. A fixed bandwidth is appropriate because it reproduces this particular density exactly; a generic density would retain a nonzero smoothing bias.