Thanks, very useful. Strangely I get very different results on Matlab 2011b and 2013b with the same data. On the recent version, the density distribution is more smooth and has a stronger tendency to not go to 0 at the ends of the distribution. I'm guessing this is due to changes in a Matlab function. Any ideas?

5

11 Aug 2014

Kernel Density Estimator
Reliable and extremely fast kernel density estimator for one-dimensional data

Dear Botev,
my data does not have meaning on negative values, but constructing histograms using kde returns frequencies on negative values and even if I determine the lower limit of x on zero, it returns on zero a big value. (i expect my histogram to start like x^2).
Thanks

Comment only

13 Nov 2013

Kernel Density Estimator
Reliable and extremely fast kernel density estimator for one-dimensional data

Dear Botev,
I have encountered a problem with your implementation and seeking your help. The PDFs obtained using translated versions of the signal (image histogram, in this case) is not the same.
data = [23 23 23 22 22 22 21 22 23];
data = [53 53 53 52 52 52 51 52 53];
MIN = 0
MAX = 255
n = 256;
[bandwidth,density,xmesh,cdf]=kde(data,256,MIN,MAX)
This gives a good uni-modal estimate, whereas the second one is incomprehensible.
[bandwidth,density,xmesh,cdf]=kde(data2,256,MIN,MAX)
Please take a look at the density plots in each case.
This might be a problem with the bandwidth estimation but I don't know how to solve it.
Any help is appreciated.
Bharath
For e.g:

Comment only