From Densities to a Rejection Region
For a continuous observation, a Neyman–Pearson test is built by comparing the likelihood of the observed data under two specified models. The calculation has several distinct parts: form the likelihood ratio, solve its inequality for the observation, choose the cutoff to give the required size under the null, and then calculate the rejection probability under the alternative. Keeping these steps separate helps prevent a common error: choosing a tail before checking how the likelihood ratio changes with the data.
The discussion here concerns simple hypotheses, which specify a complete probability model under each hypothesis. The Neyman–Pearson result identifies a most powerful test among tests with size no greater than a specified level. For composite hypotheses, this result does not by itself provide a uniformly most powerful test.
The likelihood ratio in this tutorial is \(f_1(x)/f_0(x)\), alternative density over null density. A large value means that the observation is relatively more likely under \(H_1\) than under \(H_0\). If \(f_0(x)=0\) and \(f_1(x)>0\), that observation has zero probability under the null and positive density under the alternative; the likelihood-ratio rule rejects there. The examples below have common support and positive null density throughout that support.
A Reliable Construction
Start from the density of the full observation under each hypothesis. For independent observations, this means using the joint densities, or equivalently the product of their individual densities. Constants that depend on the hypotheses must be retained; factors common to both densities can be canceled when forming the ratio. Then solve the likelihood-ratio inequality in terms of the observed data. Only after identifying which values lead to rejection should the size be calibrated under \(H_0\).
Specify the null and alternative densities, including their parameters and support.
Use \(L(x)=f_1(x)/f_0(x)\). Preserve the direction of this ratio throughout the calculation.
Find the observations for which \(L(x)>k\). The result may be an upper tail, a lower tail, or a disconnected region.
Choose the cutoff using the null probability of rejection, then evaluate the same rejection region under the alternative.
Why the Likelihood-Ratio Rule Is Most Powerful
The reason this construction works can be seen by comparing its test, \(\phi\), with any competing test, \(\psi\), of size at most \(\alpha\). At the threshold \(k\), the likelihood-ratio test rejects above the threshold and accepts below it. Consequently, at every observation, \((\phi(x)-\psi(x))(f_1(x)-k f_0(x))\geq 0\). Above the threshold, both factors are nonnegative; below it, both are nonpositive. On the boundary, the second factor is zero.
Rearranging this inequality gives \(E_1[\phi]-E_1[\psi]\geq k(E_0[\phi]-E_0[\psi])\). The likelihood-ratio test has size \(\alpha\), while the competing test has size at most \(\alpha\), so \(E_0[\phi]-E_0[\psi]\geq 0\). Since \(k\geq 0\), the right side is nonnegative. Therefore \(E_1[\phi]\geq E_1[\psi]\): the likelihood-ratio test has at least as much power as any competing test satisfying the size constraint. Randomization at a boundary can be chosen to attain the prescribed size when a nonrandomized cutoff cannot do so.
Worked Constructions
Worked Example: A Lower-Tail Test for Exponential Rates
A hypothetical sensor records one waiting time \(X\), in hours. Under \(H_0\), \(X\) is exponential with rate \(\lambda_0=1\) per hour; under \(H_1\), it is exponential with rate \(\lambda_1=2\) per hour. Construct a most powerful test of size \(\alpha=0.10\), and find its power. For an exponential distribution with rate \(\lambda\), the density is \(f(x)=\lambda e^{-\lambda x}\) for \(x\geq 0\).
Method and likelihood ratio. Both models have support \(x\geq0\). Their densities are \(f_0(x)=e^{-x}\) and \(f_1(x)=2e^{-2x}\). Thus
Since \(2e^{-x}\) decreases as \(x\) increases, the rule \(L(x)>k\) is a lower-tail rule. Write it as \(x<c\), where \(c\) is the critical waiting time. Under \(H_0\), the exponential distribution has \(P_0(X<c)=1-e^{-c}\), so size \(0.10\) requires
The test rejects \(H_0\) when \(X<0.1053605\) hours. Under \(H_1\), the power is
The size is \(0.1000\) and the power is \(0.1900\), both reported to four decimal places. The critical time is \(0.105361\) hours to six decimal places. Check: substituting \(e^{-c}=0.90\) into the null rejection probability gives \(1-0.90=0.10\). The key mistake avoided is assuming that a larger observation must favor the alternative: here, a short waiting time has a larger likelihood ratio.
Worked Example: An Upper-Tail Test for a Normal Mean
A hypothetical instrument produces one reading \(X\), measured in standard units. Under \(H_0\), \(X\sim N(0,1)\); under \(H_1\), \(X\sim N(1.5,1)\). Construct a most powerful test with size \(\alpha=P(Z>1)\), where \(Z\sim N(0,1)\), and calculate its power. The variance is known and equals 1 under both hypotheses.
Method and likelihood ratio. The two normal densities are \(f_0(x)=(2\pi)^{-1/2}e^{-x^2/2}\) and \(f_1(x)=(2\pi)^{-1/2}e^{-(x-1.5)^2/2}\). Their ratio simplifies to
This ratio increases with \(x\), so reject for \(X>c\). Under \(H_0\), \(P_0(X>1)=P(Z>1)=\alpha\), which sets \(c=1\) exactly for the specified size. Under \(H_1\), standardize by subtracting the mean 1.5 and dividing by the standard deviation 1:
Here \(\Phi\) is the standard normal cumulative distribution function; the probability is rounded to four decimal places. Check: the cutoff gives exactly the stipulated null upper-tail probability, and the alternative mean lies above the cutoff, so the power exceeds \(0.5\). The mistake avoided is using a two-tail test simply because the observation is normal: the likelihood ratio increases with \(x\), so the most powerful region is one-sided.
Worked Example: A Disconnected Rejection Region
A hypothetical quality-control score \(X\) lies between 0 and 1. Under \(H_0\), \(X\) is uniform on \((0,1)\), so \(f_0(x)=1\). Under \(H_1\), its density is \(f_1(x)=4|x-0.5|\) on \((0,1)\). Construct a most powerful test of size \(0.50\) and calculate its power.
Check the alternative density. Its total probability is
The density is therefore normalized. The likelihood ratio is \(L(x)=4|x-0.5|\). It is largest near either endpoint and smallest at the center. The likelihood-ratio rule rejects where \(4|x-0.5|>k\). Setting \(k=1\) gives
Under \(H_0\), the two intervals have total length \(0.25+0.25=0.50\), so this region has the required size. Under \(H_1\), symmetry gives equal probability to the two tails. The probability of the left tail is
The right tail also has probability \(0.375\), so the power is \(0.375+0.375=0.7500\), to four decimal places. Check: the null size is \(0.50\), and the alternative power is below 1. The mistake avoided is forcing the critical region to be one connected tail: solving the likelihood-ratio inequality produces two tails.
Cutoffs, Boundaries, and Checks
For a continuous observation, a cutoff often has null probability zero, so the test can be calibrated by an equality such as \(P_0(X>c)=\alpha\). However, continuity of \(X\) alone does not guarantee that every likelihood-ratio boundary has probability zero. If the ratio is constant over an interval, that interval can have positive probability. In that case, a nonrandomized threshold may not attain every desired size; randomization on the boundary may be needed.
The same distinction matters when translating the rule into data values. A likelihood ratio that increases with \(x\) produces an upper tail; one that decreases with \(x\) produces a lower tail. A ratio that increases and then decreases can produce a central interval, while a ratio that is large at separated parts of the support can produce disconnected tails. Derive the region from the inequality rather than relying on the labels “upper-tail” or “two-tail.”
| Construction step | Question to check |
|---|---|
| Model | Are the null and alternative densities correctly assigned, with their parameters and supports stated? |
| Ratio | Is the ratio alternative over null, with constants depending on the hypotheses retained? |
| Region | Has the inequality \(f_1(x)/f_0(x)>k\) actually been solved for \(x\)? |
| Size | Was the rejection probability calculated under \(H_0\), not under \(H_1\)? |
| Power | Was the same rejection region evaluated under \(H_1\)? |
A compact final check is to substitute the chosen cutoff back into the null rejection probability, confirm that the region corresponds to large likelihood ratios, and evaluate power under the alternative without changing the region. A test’s size and power use the same rejection event but different probability models.
Check Your Understanding
For each problem, identify the likelihood-ratio region, calibrate or apply its cutoff, and compute the requested power.
- Let \(X\) be exponential with rate 2 under \(H_0\) and rate 1 under \(H_1\), with rates per hour. A test has size \(0.20\). Find the critical value and power. (Answer: reject for \(X>\frac{\ln 5}{2}=0.8047\) hours; power \(1/\sqrt{5}=0.4472\).)
- Suppose \(X\sim N(0,4)\) under \(H_0\) and \(X\sim N(2,4)\) under \(H_1\). For size \(0.10\), find the upper-tail cutoff and power. (Answer: reject for \(X>2\Phi^{-1}(0.90)=2.5631\); power \(1-\Phi(\Phi^{-1}(0.90)-1)=0.3891\).)
- On \((0,1)\), let \(f_0(x)=1\) and \(f_1(x)=6x(1-x)\). Find the most powerful size-\(0.50\) region and its power. (Answer: reject for \(0.25<x<0.75\); power \(11/16=0.6875\).)
- On \((0,1)\), let \(f_0(x)=1\) and \(f_1(x)=2x\). A test rejects when the likelihood ratio exceeds the cutoff corresponding to \(X>0.75\). Find its size and power. (Answer: size \(0.25\); power \(0.4375\).)