The Neyman-Pearson Lemma
The answer to a very practical question: given a fixed budget of false alarms, which test catches the most real signals? Rank the evidence by a likelihood ratio and act on the top of the list — nothing else can do better.
Prerequisites: Hypothesis Testing, Type I and Type II Errors
Every test makes two kinds of mistake: it can shout when nothing is there, and stay quiet when something is. With a fixed amount of data you cannot drive both to zero — tightening one loosens the other. So the honest way to set a test up is to fix the false-alarm rate you can live with and then ask a sharper question: among all tests with that false-alarm rate, which one catches the most real signals? That question has an exact answer, and it is one formula: the Neyman-Pearson lemma.
An analogy: the customs officer
A customs officer can search 5% of arriving passengers. Not 6% — the queue would collapse. Within that budget she wants to find as much contraband as possible.
She could search every fifth passenger, or everyone whose surname begins with M. Both stay inside budget and both are terrible. What she actually does is score each passenger by a ratio: how likely is this behaviour if they are smuggling, divided by how likely if they are innocent? Then she sorts by that score and searches from the top until the budget runs out.
That is the entire lemma. The score is the likelihood ratio, the budget is the false-alarm rate, and the surprising claim is that no other rule with the same budget catches more. Not a cleverer rule, not a machine-learned one. This is optimal.
The pieces, one symbol at a time
The setting is deliberately narrow: two fully specified possibilities, no vagueness on either side. Call them the null (theta equals ) and the alternative (theta equals ).
Write for the likelihood — how probable the data you actually saw would be if were the truth. Then the likelihood ratio is
In plain English: how much better does the alternative explain what I saw than the null does? A value of 10 means the data are ten times more probable under the alternative. A value of 0.2 means the null explains them five times better.
Two more names. The size (alpha) is the false-alarm rate: the probability of rejecting the null when the null is in fact true. The power is the probability of rejecting the null when the alternative is true — the fraction of real signals you catch.
The lemma says: among all tests with size at most , the most powerful one rejects exactly when
with the cutoff set so that the false-alarm rate comes out at .
In plain English: compute the ratio and reject whenever it exceeds a threshold chosen to spend your whole false-alarm budget. Nothing else does better. This is where the The Likelihood Ratio Test comes from, and why likelihood sits at the centre of statistics — it is not a convention, it is provably the right thing to rank by.
Fix the false-alarm rate you can afford, then rank the evidence by the likelihood ratio and reject from the top down. Among every test with that same false-alarm rate, this one catches the most real signals. There is no cleverer rule waiting to be found.
Worked example 1: five coin flips
A counterparty claims a coin is fair; you suspect it is loaded toward heads. Test against with five flips, at a false-alarm budget of .
Step 1 — score every outcome. With heads out of 5, the likelihood ratio is
| heads | if fair | |
|---|---|---|
| 5 | 10.49 | 0.031 |
| 4 | 2.62 | 0.156 |
| 3 | 0.66 | 0.313 |
| 2 | 0.16 | 0.313 |
| 1 | 0.04 | 0.156 |
| 0 | 0.01 | 0.031 |
Step 2 — fill the budget from the top. The highest-ranked outcome is five heads, which happens of the time under a fair coin. That fits inside 0.05. Adding the next outcome down would take the total to , far over budget. So the test is: reject only on five heads.
Step 3 — measure the power. If the coin really is 80% heads, five heads happens with probability . So this test catches about a third of genuinely loaded coins.
Step 4 — see why the ranking matters. Take a different test with the same false-alarm rate: reject on zero heads. Its size is also , perfectly legitimate. Its power is — one loaded coin in three thousand instead of one in three. Both tests are valid; only one is sensible, and the likelihood ratio is what separates them.
In the explorer below, and shows how rare five heads is under the null; drag to 0.8 and the same bar becomes the most likely outcome. The ratio of those two bar heights is .
Worked example 2: a mean return, and the cost of hedging both sides
You have 25 daily returns with known standard deviation . Test against at .
Step 1 — reduce the ratio. For normal data the likelihood ratio increases whenever the sample mean increases, so "reject when " is the same rule as "reject when ". The messy ratio collapses to a threshold on a single familiar number.
Step 2 — find the cutoff. The standard error of the mean is
To leave 5% in the upper tail under the null, put the cutoff 1.645 standard errors above zero:
Step 3 — compute the power. If the truth is , the cutoff sits
standard errors from that mean, so the chance of landing above it is . The test catches 80% of real signals.
Step 4 — pay for a two-sided test. Suppose you had run the usual two-sided test instead, splitting the 5% across both tails. The cutoff moves out to , and the power drops to . Same data, same false-alarm budget, seven percentage points of power handed over — because half the budget was spent guarding a direction you never cared about. That is the price of not using the most powerful test for the alternative you actually face.
What this means in practice
- It explains why likelihood is everywhere. Generalised likelihood ratio tests, the chi-square tests inside every regression package, and the theory behind maximum likelihood all trace back here.
- Signal detection is the same problem. Radar, medical screening, fraud alerts and trade surveillance all rank cases by a likelihood ratio and act on the top. An ROC curve is exactly the power-versus-size trade-off in the figure above.
- It sharpens experiment design. If you know which alternative matters, a one-sided test aimed at it beats a two-sided test on the same data — worked example 2, in numbers.
- When it does not apply, it still guides. Real alternatives are usually composite ("the mean is some positive number"). Sometimes one test is optimal against all of them at once, a uniformly most powerful test; when none exists, the likelihood ratio remains the standard starting point.
The classic confusion is hearing "most powerful" as "good". The lemma is a relative statement: this test beats every other test of the same size, against that one specific alternative. It says nothing about whether the power is adequate — the coin test above is most powerful and still misses two loaded coins in three, because five flips is not enough data. Two traps follow. Optimality is tied to the alternative you named, so a test tuned for is not the best test for . And the lemma covers simple versus simple only; stretch into a range and a single most powerful test may not exist at all.
Related concepts
Practice in interviews
Further reading
- Neyman & Pearson, On the Problem of the Most Efficient Tests of Statistical Hypotheses (1933)
- Casella & Berger, Statistical Inference, sec. 8.3