Search Comments and Ratings

go

   
Date File Comment by Comment Rating
21 Jan 2011 Kernel Density Estimator Reliable and extremely fast kernel density estimator for one-dimensional data Author: Zdravko Botev

Zdravko Botev (view profile)

Zdravko Botev

Zdravko Botev (view profile)

Due to numerical round-off error from the fft.m function, it is possible to get density values of -1.38e-018 (instead of 0) and cdf values slightly larger than 1.
If this is a problem, one can correct the output from kde by overwriting:

density=max(density,0); cdf=min(1,cdf);

Comment only
15 Oct 2010 Kernel Density Estimator Reliable and extremely fast kernel density estimator for one-dimensional data Author: Zdravko Botev

Zdravko Botev (view profile)

Zdravko Botev

Zdravko Botev (view profile)

Dear George, the kde function works as it should. There is no problem with the kde. What you call a problem is actually one of the main strengths of the routine.

By typing data = [d1;d1;d1;d1;d1;d2;d3];
you are creating DISCRETE data, because you create ties (the same values appear multiple times). For a truly continuous data, there can be no ties or repeated values!!!
If you have ties, then the data CANNOT be continuous be definition.

The kde.m CORRECTLY recognizes that the data you have provided is perfectly discrete and since discrete data does not need smoothing, the selected bandwidth should be zero. kde.m is the only routine I am aware of that does this correctly, every other routine fails this BASIC theoretical test.

Comment only

Contact us