Likelihood Ratio Tests
To compare two nested models, fit both and weigh the gap. Twice the log lift over the smaller model tells you whether the extra knobs earned it.
Why Does This Exist?
"Does this feature help?" means comparing a small model against one with extra knobs. The big model always fits training data at least as well, so raw fit cannot decide. You need the price of flexibility.
The likelihood ratio pays exactly that price. Wilks says tends to with extra parameters. It extends hypothesis testing with the workhorse behind ANOVA, deviance, and many A/B model checks, assuming the MLE machinery in maximum likelihood estimation.
The one idea you need first
Log-likelihood scores parameters by fit; its max is the MLE. The gap measures what the extra knobs bought. Doubling turns the gap into chi-square units.
Think of It Like This
Two tailors, one surcharge
Two tailors fit you a suit. The standard tailor uses your size; the bespoke tailor adds shoulder, drape, and cuff knobs and fits slightly better. The question is whether the better fit beats the bespoke surcharge.
Twice the log gap is the fit improvement in standard currency; the cutoff is the surcharge for knobs (3.84 for one at 5%). Where it stops: tailors can overfit fabric quirks, and so can models, which is why the cutoff grows with .
How It Actually Works
Fit full and constrained , compute , reject when . Needs nesting ( restricts ), interior optima, and enough data for asymptotics. Siblings: Wald uses distance over standard error; score uses slope at . All three agree asymptotically; LRT is the most invariant to parameterization.
Worked example
Hundred flips, 60 heads, test fair . Full MLE : . Null: . Gap , doubled : reject fair at 5%. Wald check: , borderline the same verdict. One extra parameter, one 3.84 bar, cleared by 0.19.
Code
import numpy as np
k, n = 60, 100ell1 = k * np.log(k / n) + (n - k) * np.log(1 - k / n)ell0 = n * np.log(0.5)print(round(float(2 * (ell1 - ell0)), 2)) # -> 4.03Doubled gap 4.03 clears 3.84. Same data, same verdict as the hand calculation.
Watch Out For
Testing non-nested models with Wilks
Comparing a Poisson against a negative binomial by cutoff misfires when neither nests the other: the limit law is not and the cutoff is fiction. Symptom: wildly significant verdicts that vanish under cross-validation.
Use Vuong, information criteria, or held-out likelihood for non-nested choices. Reserve Wilks for true nesting.
Testing on the boundary
Testing variance or mixture weight parks on the parameter edge, halving the limit law (e.g. ). Naive cutoffs run conservative and miss real effects.
Use boundary-corrected mixtures or bootstrap the null. If the null sits on an edge, distrust textbook cutoffs.
The Quick Version
- LRT doubles the log-likelihood gap between nested fits and compares to .
- One extra parameter at 5% means clearing 3.84.
- 60 of 100 heads gives 4.03 and rejects fair, matching the Wald .
- Wald and score are asymptotic siblings; LRT respects reparameterization best.
- Non-nested models need Vuong or held-out checks, not Wilks.
- Boundary nulls halve the limit law; correct or bootstrap.