statsmodels.stats.gof.gof_chisquare_discrete#

statsmodels.stats.gof.gof_chisquare_discrete(distfn, arg, rvs, alpha, msg)[source]#

Perform chisquare test for random sample of a discrete distribution

Parameters:
distfndistribution instance

Discrete distribution function to be tested; needs a, b and cdf attributes/methods.

argsequence

parameters of distribution

rvsarray_like

random sample from the distribution to be tested

alphafloat

significance level, threshold for p-value

msgstr

identifying message that is included in the returned result string

Returns:
chisfloat

chisquare statistic of the test

pvalfloat

p-value of the test based on the chisquare distribution

truefalsebool

True if the test passes (pval > alpha), False if it fails

outstrstr

summary string describing the test and its result

Notes

originally written for scipy.stats test suite, still needs to be checked for standalone usage, insufficient input checking may not run yet (after copy/paste)

refactor: maybe a class, check returns, or separate binning from

test results