Chi squared test to test if data is from same distribution
조회 수: 9 (최근 30일)
이전 댓글 표시
Hello,
I have recorded some discrete data with an unspecified distribution.
I have generated some discrete data from a model.
I looking to check to see if the generated data has the same distribution as the real data.
If the data was continious, I would use a Q-Q plot and a striaght line would indicate that it is true.
As the data is discrete, I need another test.
I was thinking a chi-squared test would be suitbale?
Would Matlab have such a function? I would be grateful if somebody could perhaps demonstrate an example?
kind regards
댓글 수: 0
채택된 답변
José-Luis
2013년 2월 8일
You could use a two-sample Kolmogorov-Smirnov test. This tests the hypothesis that the two samples come from the same distribution.
doc kstest2
댓글 수: 3
José-Luis
2013년 2월 8일
I am not sure I follow. It sounds like the KS test is what you are looking for. The documentation says that the sample comes from continous distributions. It says nothing about the sample themselves, which is what you are comparing. Or maybe I am missing something.
추가 답변 (1개)
Sean de Wolski
2013년 2월 8일
How abot anything here:
Or some of the anova tests:
doc anova1
doc anova2
doc anovan
댓글 수: 4
José-Luis
2013년 2월 8일
The KS test if for discrete data. What you assume is that the distribution they come from is continuous. That's a different thing.
참고 항목
카테고리
Help Center 및 File Exchange에서 Chi-Square Distribution에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!