필터 지우기
필터 지우기

chi2gof function combines bins even with EMin set to zero

조회 수: 3 (최근 30일)
Roberto Gargiulo
Roberto Gargiulo 2021년 3월 5일
댓글: Roberto Gargiulo 2021년 3월 29일
While running a chi-square test for certain data (with respect to the t-distribution) I set a certain number of bins as a standrd (5) and wanted to keep this despite low count in certain bins, which I did by setting EMin = 0 (as specified by the documentation). However even while doing this the function combines neighbouring bins from 5 to 2 (I assume due to the poor fit of the distribution to the data distibution).
This is what I wrote, given t a certain data set:
nparams = 0;
nbins = 5;
tdist = @(x) tpdf(x,n-2);
[H,p,stats] = chi2gof(t,'CDF',tdist,'nbins',nbins,'nparams',nparams,'emin',0);
disp(stats)
disp([H p])
This returns:
chi2stat: 103.7404
df: 1
edges: [-4.0438 0.9718 2.2257]
O: [47 11]
E: [13.8933 44.1067]
where data is divided in 2 bins, despite the fact that I set nbins = 5 and emin = 0. Why does this happen? Can I change it to do it the way I want to? (I know this won't change the result, i.e. the null hypothesis is rejected at the given confidence level, but I still would want it to give the result I expect)

답변 (1개)

Aditya Patil
Aditya Patil 2021년 3월 29일
I have brought this issue to the notice of concerned developers. It might be fixed in any of the upcoming releases.
  댓글 수: 1
Roberto Gargiulo
Roberto Gargiulo 2021년 3월 29일
Thanks a lot! I'm still very much interested in a fix (I had to do it "by hand" in this case, but it takes more time and lines to write the necessary code).

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by