When does the kernel fitdist function returns nan?

3 次查看(过去 30 天)
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.
Clarisha
I have the impression that it return a vector with missing values. Is that possible, pdLong = fitdist(NoAddLong,'Kernel','Kernel','epanechnikov');
  2 个评论
the cyclist
the cyclist 2018-12-24
Can you upload MAT file with an example of the vector x that exhibits this behavior?
Clarisha Nijman
Clarisha Nijman 2018-12-25
编辑:madhan ravi 2018-12-25
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:
x=[0.294117647058824;0.352941176470588;0.529411764705882;0.588235294117647;0.588235294117647;0.470588235294118;0.588235294117647;0.529411764705882;0.125000000000000;0.375000000000000;0.562500000000000;0.625000000000000;0.625000000000000;0.500000000000000;0.125000000000000]
M=1000;
U = -M:1:M; %lijst met alle overgangen
NoAdd=x;
pd = fitdist(x,'Kernel','Kernel','epanechnikov');
f = pdf(pd,U);
prob=f/sum(f);

请先登录,再进行评论。

回答(0 个)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by