Week 09 · Likelihood ratios and multiple testing

Compare nested models and calculate the cost of searching many hypotheses.

← Week 8 · Subject contents · Week 10 →

Compare nested models and calculate the cost of searching many hypotheses.

Work through the problem

For 8 successes in 10 trials, compare p = 0.5 against an unrestricted p. The likelihood ratio statistic is 2[ℓ(0.8)−ℓ(0.5)] ≈ 3.855. It records twice the log likelihood gain from freeing one parameter. Small or boundary-heavy samples may need exact or simulated reference distributions.

With 20 independent true nulls and a per-test false-positive probability of 0.05, P(at least one false positive) = 1−0.95²⁰ ≈ 0.642. A Bonferroni threshold of 0.05/20 = 0.0025 controls the family-wise rate by the union bound even without independence.

Run the Python lab

from math import log
import numpy as np
def loglik(p):
    return 8*log(p) + 2*log(1-p)
print("LR statistic:", round(2*(loglik(.8)-loglik(.5)), 3))
rng = np.random.default_rng(4)
pvalues = rng.uniform(size=(30000, 20))
rates = [np.mean(np.any(pvalues <= t, axis=1)) for t in [.05, .0025]]
print("Any rejection:", np.round(rates, 3))
assert abs(rates[0] - (1-.95**20)) < .015

Output from the lab

LR statistic: 3.855
Any rejection: [0.641 0.048]

Practice

  1. Why can you use Bonferroni with correlated tests?

Check your reasoning

  1. The probability of a union is bounded by the sum of the marginal probabilities.

← Week 8 · Subject contents · Week 10 →

Further reading · MIT 18.650 · Statistics for Applications