How to calculate Chi-square statistic

조회 수: 5 (최근 30일)
Silas Adiko
Silas Adiko 2013년 5월 20일
Dear Support,
I am fitting a distribution to data and trying to perform chi-square goodness-of-fit test.
I have calculated the likelihood values and wanted to perform goodness-of-fit test
However, having read through the Help menus, I tried to run the script below but am getting error:
x=claims; [h,p,stats] = chi2gof(X,'cdf','weibull',nparams,2)
where claims is 1xn vector
I do not know where I have gone wrong and would appreciate anyone's assistance to resolve this.
Also, I needed the script to calculate chi-square test statistic for Negative Binomial distribution.
Much thanks in advance
  댓글 수: 1
the cyclist
the cyclist 2013년 5월 23일
What's the complete error message you are getting?

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

채택된 답변

Tom Lane
Tom Lane 2013년 5월 24일
I believe you got an answer separately on comp.soft-sys.matlab, but:
  • replace 'weibull' by @wblcdf (not in quotes)
  • replace nparams by 'nparams' (in quotes)
Try @nbincdf to use the negative binomial cdf.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by