Bernoulli Likelihood Ratio Test
Compare a null likelihood with its fitted alternative and build an exact LR-ordered test.
Free theory articleCompare a null likelihood with its fitted alternative and build an exact LR-ordered test.
Concept & interpretation
The likelihood ratio test (LRT) provides a general methodology for constructing hypothesis tests. It compares the maximum probability of the observed data under the null hypothesis to the maximum probability under the unrestricted alternative hypothesis. For a Bernoulli process, this leads to an exact test that ranks possible outcomes by their likelihood ratio, providing a distinct rejection ordering compared to a simple binomial test.
Reproduce the calculation in the module
Open the Bernoulli Likelihood Ratio Test module to interactively explore the exact LR-ordered p-value.
- Set Sample count to
10, Successes to2, and Null probability to0.5. - Verify the calculated Statistic is
3.85489514043515and the Exact LR p value is0.109375. - In the visualization, observe which bars are colored red. These correspond to the rejection region—outcomes whose likelihood ratio statistic is greater than or equal to the observed one. Because p0 = 0.5 is symmetric, the rejection region includes k ∈ {0, 1, 2, 8, 9, 10}.
- Change the Null probability to
0.25and the Successes to5. The MLE is now 0.5. Notice that the rejection region is no longer perfectly symmetric in k, because the underlying null distribution is skewed. The exact LR test naturally orders outcomes by their evidence against the null, avoiding arbitrary decisions about how to define two-sided tails for asymmetric discrete distributions. - Set Successes to
0(with n=10, p0=0.5). Notice the MLE probability drops to 0.0, and the exact p-value is 0.001953125. The test seamlessly handles boundary observations where the MLE is 0 or 1, calculating the limit 0 log 0 = 0.