Python - Exact Multinomial Goodness-of-Fit test

preview_player
Показать описание
Instructional video on how to perform an exact multinomial goodness-of-fit test with Python. This could be used as an exact version of the Pearson's chi-square GoF test, when analysing a nominal variable.

Рекомендации по теме
Комментарии
Автор

I think I know why the multinomial function is off a bit: according to the scipy documentation, if the sum of the expected probabilities is not one, it ignores the final probability and uses a value which will make the total one. Since 1/3 gets rounded down, the sum is ever-so-slightly less than one, and the last probability is replaced with one slightly larger. You will find: 1. if you swap the two frequencies in the last place, you get the same probability – it only matters if the frequency in the last position is changed; 2. if you use "exact" probabilities such as 4 x 1/4, it doesn't matter what order the frequencies are in. Unfortunately, even representing the probabilities in the np.array each as 1/3 doesn't help.

tedlorance
Автор

What is the purpose of computing the variable "c" in the combinations loop?

tedlorance
join shbcf.ru