MATLAB Answers


When does the kernel fitdist function returns nan?

Asked by Clarisha Nijman on 24 Dec 2018
Latest activity Edited by madhan ravi
on 25 Dec 2018
Dear all,
I am using the fitdist function in my code and notice that for some inputs I have a vector with nan entries.
This is the way I implement the code: pdf_x = fitdist(x,'Kernel','Kernel','epanechnikov');
So I wonder why? When does the a fitdistr kernel code return missing vallues? Can I have some feedback on this point?
thank you in advance.
I have the impression that it return a vector with missing values. Is that possible, pdLong = fitdist(NoAddLong,'Kernel','Kernel','epanechnikov');


Can you upload MAT file with an example of the vector x that exhibits this behavior?
Finally I was able to find one of the problematic situation: sum(f) equals zero, such that I cannot devide by zero. The sum of that probability distribution vector should equal one. So the question is now, why do I get a zero vector for pdf?
The code reads partially:
U = -M:1:M; %lijst met alle overgangen
pd = fitdist(x,'Kernel','Kernel','epanechnikov');
f = pdf(pd,U);

Sign in to comment.

0 Answers