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, with Wilks turning the gap into chi-square units. It extends hypothesis testing with the workhorse behind ANOVA, deviance, and many model checks, assuming the MLE machinery in maximum likelihood estimation. Interval reading of the same uncertainty lives in confidence intervals.
The prerequisite is one idea: log-likelihood scores parameters by fit with the parameters, and its maximum is the MLE. The gap measures what the extra knobs bought, and doubling turns that 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, and 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, and the chi-square cutoff is the surcharge for knobs, which is 3.84 for one knob at 5 percent. Clear the surcharge and the knobs earned it, otherwise keep the standard suit.
Where it stops: tailors can overfit fabric quirks and models can overfit noise, which is why the cutoff grows with . The analogy also hides nesting: the standard pattern must be a restricted bespoke pattern, or the surcharge table does not apply.
How It Actually Works
Fit the full estimate and the constrained estimate , where the hat marks maxima of the log-likelihood, then compute with the log-likelihood. Reject the null when , where counts extra parameters and is the error rate. Wilks says tends to under nesting, interior optima, and enough data.
Siblings agree asymptotically: Wald standardises the estimate distance over its standard error, and the score test uses the slope at . All three match on large samples, and the likelihood ratio respects reparameterisation best.
Worked example
One hundred flips land 60 heads, testing fair . The full MLE is with . The null gives . The gap is , doubled to , so reject fair at 5 percent by 0.19. A Wald check agrees: , borderline the same verdict with one extra parameter against the same 3.84 bar.
Code
The snippet recomputes the coin verdict with only the standard library.
import math
k, n = 60, 100ell1 = k * math.log(k / n) + (n - k) * math.log(1 - k / n)ell0 = n * math.log(0.5)print(round(ell1, 2)) # -> -67.3print(round(ell0, 2)) # -> -69.31print(round(2 * (ell1 - ell0), 2)) # -> 4.03print(round((0.6 - 0.5) / 0.05, 2)) # -> 2.0Doubled gap 4.03 clears 3.84 while Wald reports 2.0, the same data and the same verdict as the hand calculation.
Watch Out For
Testing non-nested models with Wilks
Comparing a Poisson against a negative binomial by a chi-square cutoff misfires when neither nests the other: the limit law is not chi-square and the cutoff is fiction. The symptom is 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 where restricts .
Testing on the boundary
Testing variance equal to 0 or mixture weight equal to 0 parks on the parameter edge, halving the limit law toward a mixture such as one half chi-square zero plus one half chi-square one. Naive chi-square cutoffs run conservative and miss real effects.
Use boundary-corrected mixtures or bootstrap the null. When the null sits on an edge, distrust textbook cutoffs.
The Quick Version
- The likelihood ratio test doubles the log-likelihood gap between nested fits and compares to chi-square with extra parameters.
- One extra parameter at 5 percent means clearing 3.84.
- Sixty of 100 heads gives 4.03 and rejects fair, matching the Wald value 2.0.
- Wald and score are asymptotic siblings, and the ratio respects reparameterisation best.
- Non-nested models need Vuong or held-out checks, not Wilks.
- Boundary nulls halve the limit law, so correct the mixture or bootstrap.