The Neyman-Pearson lemma concerns testing a simple null density against a simple alternative . A test that rejects where , accepts where the ratio is below , and if necessary randomizes on the boundary to have null rejection probability , is a most powerful test among tests of size at most . Thus a likelihood-ratio threshold maximizes power at the specified simple alternative. The boundary randomization is relevant for discrete distributions.
For , the ratio of the two sample likelihood functions is
For it is strictly increasing in . The Neyman-Pearson lemma therefore selects an upper tail:
Under the null, , so choose with this upper-tail probability at most . If exact size is required, randomize at the adjacent boundary value as needed. The rejection rule is the same for every , giving a uniformly most powerful test for the one-sided alternative.
For a rejection function , its power is . A test has level at most if ; its size is that supremum. In a simple null the significance probability is just the rejection probability under that null.
For two simple hypotheses with joint sample densities , the Neyman–Pearson lemma states that a test rejecting where , accepting where , and randomizing if necessary on equality to have size , is most powerful among level- tests. Let be that test and any competitor. Pointwise,
Integration gives
since , the first test has size , and the other has size at most . This proves the claimed power bound, allowing null-density-zero regions as well. Equality implies agreement away from the likelihood-ratio boundary, up to null sets, when the inequalities are strict.
Put . For interior parameters , the alternative-to-null likelihood ratio is
The second base is greater than one, so this is strictly increasing in . The Neyman-Pearson lemma therefore gives an upper-tail rejection rule. Under the null hypothesis, , and an ordinary conservative threshold can be chosen as
There is an important discrete qualification: an integer cutoff need not have test size exactly . To obtain exact size, choose an integer with , reject certainly when , and at reject with probability
This randomized statistical test is a most powerful test at exact size ; when a binomial upper tail equals , no randomization is needed and the stated region is literal. Otherwise the unrandomized upper-tail region has size at most , and the exact-size result includes the boundary randomization. Endpoint parameter cases retain the same upper-tail ordering by taking limits, with ties resolved on the null-supported outcomes.
For two simple statistical hypotheses with joint probability density functions and , fix a significance level . A randomized statistical test is the conditional probability of rejection given the data. Choose and, if necessary, randomization on the equality set so that
The Neyman-Pearson lemma says that this is a most powerful test among all tests with test size at most :
Thus the optimal ordering rejects where the alternative-to-null likelihood ratio is largest. On null-impossible observations with , the rejection probability is one. Randomization is dispensable whenever an ordinary threshold already attains the required test size.
The Neyman-Pearson lemma concerns a simple hypothesis against another simple hypothesis . For a continuous statistical sample, put for the joint probability density functions, . A randomized statistical test is a measurable , the conditional probability of rejection after observing . Its test size is and its statistical power is .
Choose and boundary randomization so that
Then is most powerful among all tests of size at most . Thus one rejects for sufficiently large alternative-to-null likelihood ratio. If the equality set has zero probability under , the test needs no randomization. Continuous observations alone do not guarantee that their likelihood ratio has a continuous probability distribution.
For the proof, let be any competing test with . At every ,
Indeed, on the first factor is ; on it is ; and on equality the product is zero. Integration gives
which proves the claimed optimality. Moreover, when , equality of statistical power forces equality of test size and forces almost everywhere where : otherwise the nonnegative integrand would have positive integral. This proves the usual necessity assertion as well, up to equality sets and sets of zero probability under both hypotheses.
Let . For the exponential distribution with mean , the likelihood function is on positive observations. Fix any . The alternative-to-null likelihood ratio is
Since , this is strictly decreasing in . The Neyman-Pearson lemma says to reject for small . Under the null hypothesis, the given sum rule yields , where the second argument is a rate, and hence
Let be the lower quantile of this chi-squared distribution. The required critical region is
Its test size is exactly because the null distribution is continuous. Its cutoff is the same for every , so it is simultaneously most powerful against every such value: it is a uniformly most powerful test. Equivalently, reject if is below the lower quantile of the specified gamma distribution.
For any fixed , the alternative-to-null likelihood ratio is
which is strictly increasing in for . Consequently the Neyman-Pearson lemma selects the same upper-tail ordering for every such alternative hypothesis. At the null hypothesis value,
Therefore
is a uniformly most powerful test of the required exact test size. Its power function is . At its statistical power is one, so including that boundary alternative preserves the conclusion.
Let , which has a binomial distribution with parameters . For , the alternative-to-null likelihood ratio of the independent Bernoulli trials is
Since , this is strictly decreasing in . A threshold on large is therefore a lower-tail likelihood-ratio test, and a threshold between and gives the stated critical region . The Neyman-Pearson lemma also proves it is a most powerful test at its attained test size.
Using the binomial probability mass, its test size and statistical power are respectively
The associated power function is . These formulas hold for positive integer ; when the test always rejects and has size one. If the boundary value is admitted, all alternative probability is at ; the same test still has statistical power one and can be represented using a threshold with ties in the likelihood ratio.
Here the gamma distribution uses a rate statistical parameter , with known shape . Write and . For each fixed , the alternative-to-null likelihood ratio is
strictly decreasing in . The Neyman-Pearson lemma therefore gives the same lower-tail critical region for every larger rate. Since has a continuous gamma distribution under the null hypothesis, there is a unique positive satisfying
Thus reject when is a uniformly most powerful test of exact test size . If denotes the unit-rate gamma distribution cumulative distribution function with shape , then
This is the uniformly most powerful test for a gamma rate.
When , the sum has shape one and hence an exponential distribution with rate . Therefore
In particular , and the power function is strictly increasing, exceeding for and tending to one as .
The Neyman-Pearson lemma states that a test which rejects where the joint likelihood ratio is largest is a most powerful test of its size: its power is at least that of any test with no larger size. More precisely, choose a threshold and reject if , accept if it is smaller, and if necessary randomize on equality to attain the specified size.
For an independent and identically distributed statistical sample, take
The are independent and identically distributed random variables under either simple hypothesis, and the log joint ratio is their sum. Thus the nonrandomized threshold form can be written
with , using either strict or non-strict inequality when the boundary has probability zero. The usual finite-log expression assumes positive common support; zero densities can instead be handled by the extended likelihood ratio on the relevant supports. Continuous observations alone do not ensure a continuous likelihood-ratio statistic: ties may require the boundary randomization in the lemma. This qualification preserves the exact-size formulation.
The joint likelihood ratio in favor of the alternative is
It is increasing in the product, so the Neyman-Pearson lemma rejects for large product, equivalently small . Under , the transformation gives
Therefore the are independent exponential random variables of rate two, , and . An exact size- critical region is
Equivalently, reject when the geometric mean satisfies . The boundary distribution is continuous, so no randomization is needed here.
A randomized statistical test specifies a measurable rejection probability for each possible data value. It can be implemented by rejecting when an independent uniform random variable on satisfies . A deterministic test has only the values zero and one. Under a simple hypothesis , its rejection probability is , which is its test size for and its statistical power for .
The Neyman-Pearson lemma permits randomization on an equality set of the form to reach a prescribed test size. Continuous observations do not rule out an equality set of positive probability: if both hypotheses give the same probability density function, their likelihood ratio is identically one. This explains why a precise statement of the lemma includes boundary randomization even for continuous data.
Statistical test Created 2026-10-05 Updated 2026-10-14
A statistical test is a measurable rule for deciding whether to reject a null hypothesis. Allowing randomisation, it is represented by a function giving the conditional rejection probability after observing . A deterministic test takes only values zero and one. Under a simple null, is its size of a statistical test; under an alternative, is its statistical power. Randomisation on a likelihood ratio equality set allows a Neyman-Pearson lemma threshold test to attain a prescribed size even for discrete data.
Uniformly most powerful test for a gamma rate Created 2026-10-25 Updated 2026-10-31
For an independent statistical sample from a gamma distribution with known shape and unknown rate , test against . The alternative-to-null likelihood ratio for any larger rate is , where . This decreases in , so the Neyman-Pearson lemma gives one common lower-tail ordering for all alternatives.
Let be the unit-rate gamma distribution cumulative distribution function with shape . The uniformly most powerful test of exact test size rejects when , where . Its power function is displayed above. If , the sum has an exponential distribution, so and . Monotonicity of also makes this test valid and uniformly most powerful for the larger null hypothesis .