JuliaStats / KernelDensity.jl

Kernel density estimators for Julia
Other
178 stars 40 forks source link

Epanechnikov kernel? #15

Open michaelstepner opened 9 years ago

michaelstepner commented 9 years ago

Doing kernel densities using the epanechnikov kernel is very common, but does not seem to be a built-in option. Perhaps because epanechnikov is not included in Distributions.jl.

I think it would be widely convenient as a built-in kernel: is that something you would consider adding? I'd submit a PR if my Julia skills were up to it.

simonbyrne commented 9 years ago

I have a pull request on Distributions.jl for this: I'll try to merge it today.

michaelstepner commented 9 years ago

That's fantastic! Thanks Simon.

Vgrunert commented 9 years ago

Are there any news on the subject? I run KD v 0.1.1 and Distr v 0.8.3 and I can't find the above mentioned kernel.

panlanfeng commented 9 years ago

Define the kernel as a distribution density may not be a good idea. Kernel may not be a density at all.

In density estimation, the kernel may not necessary be a density function neither. Kernel can even take negative values as long as it satisfies certain conditions. See "bias-reducing kernels".

When we want to do a kernel estimate on cumulative distribution function, the kernel should be a cumulative distribution. When we want to estimate some derivative of some function, the kernel should also be the corresponding derivative.

Epanechnikov kernel is the best kernel function under certain condition but itself is not an interesting distribution. Some other kernel like triangular, biweight are also very simple functions. It is not necessary to include them in Distributions.jl

Can we allow the kernel to be some user defined function?