Wolfram Mathematica: Chi-Square Distribution and Chi-Square Test (die simulations)
HTML-код
- Опубликовано: 21 авг 2024
- This video continues a series that uses Mathematica/Wolfram-Cloud to explore the Chi-Square Distribution and Chi-Square Test. The video demonstrates that Mathematica's PearsonChiSquareTest method is not what I thought. First, it works with raw data rather than frequencies; and second, given raw data its determination of the "degrees of freedom" differed from my expectation. Next we showed how to get the p-value from the CDF (cumulative distribution function) of the Chi-Square Distribution. We showed for our dice simulation that the average frequency of rolling a 1 scaled with N the number of samples -- and that the standard-deviation (spread) scaled as N^0.5. In fact, the variance (standard deviation squared) divided by the average frequency appeared to be (SIDE -1)/SIDE where SIDE is the number of sides of the die in the simulation. Finally we looked at a sample of samples -- generating a set of p-values. Since by design the frequencies should be uniformly distributed, we expect the null hypothesis to be true. In our sample of samples, the Chi-Square Test suggests that our null hypothesis might be rejected about 5% of the time.
www1.lasalle.edu/~blum/c152wks/Die_Chi.pdf