MATLAB Answers

chi2gof with bionomial distribution

4 views (last 30 days)
Tobin on 17 Dec 2013
Hi everyone, I'd like to ask for help with this problem. I want to perform a goodness of fit test between binomial distribution and histogram with unknown parameters. My problem is, that chi2gof merges bins with count higher than 5, which should not be.
when performing goodness of fit test with other distributions than binomial everything fine. But binomial causes problems. Here is the code:
nelements=[13 18 31 32 51 52 55 53 63 38 35 24 17 17 5 11 4 4 1 2 1 0 1]; %frequencies in bins
hodnoty_hist=0:length(nelements); % bin definition;
pda=ProbDistUnivParam('Binomial',[528,0.0132]); % reference distribution
[h p stats]=chi2gof((0:(length(nelements)-1)),'NBins',length(nelements),'Frequency',nelements,'CDF',pda)
when looking at stats.O, one can see, that count at first bin is 62, but I entered 13 to the first bin and 18 to the second bin and 31 to the third bin. These three bins are merged. Similar situation is at the end, bins with count higher than 5 are merged. How to prevent this? Thank you!!!

Answers (0)

Community Treasure Hunt

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

Start Hunting!