Kernel Functions
Compare five kernels for kernel density estimation: Gaussian, Epanechnikov, quartic, tricube and uniform, on one graph. Edit any kernel's formula.
In 1969 V. A. Epanechnikov showed that, for the usual measure of error, the best kernel for estimating a probability density is a parabola. Yet the choice matters little: the Gaussian kernel, the textbook default, has 95.1% of the parabola's efficiency, the tricube 99.8%. A kernel is a weight function. Kernel density estimation, credited to Murray Rosenblatt (1956) and Emanuel Parzen (1962), puts one kernel on each sample and adds them, to give a smooth curve in place of a histogram; the Nadaraya-Watson regression smoother uses kernels too. The kernel sets how fast weight falls off with distance, and whether it is zero beyond some distance (compact support).
The plot compares five kernels: Gaussian, Epanechnikov 0.75(1 - t^2) , quartic \frac{15}{16}(1 - t^2)^2 , tricube \frac{70}{81}(1 - |t|^3)^3 and uniform 0.5 . The four compact kernels are drawn over -1 \le t \le 1 , the Gaussian over -3.5 to 3.5 because its tails never reach zero. Each has area 1 . The uniform kernel drops to zero at its edge; notice that the three smooth compact kernels look almost alike. Edit a formula, for example to the triweight \frac{35}{32}(1 - t^2)^3 , and compare.
JavaScript is required to view the interactive plot.