getting error Error using ==> ProbDistUnivParam.fit at 98 FREQUENCY values must be non-negative integers.
Show older comments
Error using ==> ProbDistUnivParam.fit at 98
FREQUENCY values must be non-negative integers.
Try to test hypothesis Goodness of fit while trying Poisson dist and getting error Error using ==> ProbDistUnivParam.fit at 98 FREQUENCY values must be non-negative integers.
Please guide
2 Comments
dpb
on 19 Aug 2014
Well, pretty clear error message. Whatever you used for the frequency counts as the input aren't counts (or integers, anyways).
W/o seeing anything else, what else can be said?
amberly hadden
on 19 Aug 2014
Answers (1)
dpb
on 20 Aug 2014
obsCounts = [2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9];
...
pd = fitdist(bins','Poisson','Frequency',obsCounts');
...
obsCounts values surely don't look like integers to me...
7 Comments
Image Analyst
on 20 Aug 2014
Perhaps he meant to take the histogram first
histogramCounts = histc(obsCounts, 2:4);
One thing is clear though, he hasn't read this http://www.mathworks.com/matlabcentral/answers/13205-tutorial-how-to-format-your-question-with-markup yet.
amberly hadden
on 20 Aug 2014
dpb
on 20 Aug 2014
Don't know where the numbers came from, but surely don't look like Poisson-distributed counts even if make integer. Just to solve the non-integer problem, try
round(obsCounts*10)
but still looks like uniform, not Poisson.
Think we need far more background about the problem to have any rational input.
amberly hadden
on 21 Aug 2014
dpb
on 21 Aug 2014
More to the point is where did the data come from and what do they represent? They certainly aren't counts from a Poisson; they appear to be simply a linear sequence. W/O any context, the question makes no sense.
amberly hadden
on 21 Aug 2014
dpb
on 21 Aug 2014
...this is a very complex data and a very important data set
Which still tells us precisely -- nothing useful.
Categories
Find more on Poisson Distribution in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!