gtest

mpsci.stats.gtest(observed, expected, sum_rel_tol=None)

G-test (likelihood-ratio test, maximum likelihood test).

Test whether the observed frequency distribution differs from the expected frequency distribution.

The G statistic is:

G = 2 * sum(observed*log(observed/expected))

or

\[G = 2\sum_{i=0}^{n-1} O_{i} \log(O_{i}/E_{i})\]