Explore modules

Bernoulli Likelihood Ratio Test

Compare a null likelihood with its fitted alternative and build an exact LR-ordered test.

Free theory article

Compare 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.

  1. Set Sample count to 10, Successes to 2, and Null probability to 0.5.
  2. Verify the calculated Statistic is 3.85489514043515 and the Exact LR p value is 0.109375.
  3. 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}.
  4. Change the Null probability to 0.25 and the Successes to 5. 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.
  5. 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.
Read the full free theory article