Sequential Hypothesis Testing: Wald's SPRT, Stopping Boundaries, OC & ASN Functions
Sequential sampling versus fixed-sample Neyman-Pearson designs and Abraham Wald's Sequential Probability Ratio Test (SPRT); Fundamental stopping inequalities and Wald's boundary approximations A approx (1 - beta)/alpha and B approx beta/(1 - alpha); Proof of finite termination with probability one (P(N < infinity) = 1) via Stein's Lemma; Wald's Fundamental Identity E[exp(t Z_N) (M(t))^(-N)] = 1 and Operating Characteristic (OC) curve L(theta) derivation; Average Sample Number (ASN) E_theta[N] for Bernoulli, Poisson, Normal, and Exponential sequential tests.
§5.1 Sequential Sampling Paradigms and Wald's Sequential Probability Ratio Test (SPRT)
| Structural Feature | Fixed-Sample Neyman-Pearson Test | Wald's Sequential Probability Ratio Test (SPRT) |
|---|---|---|
| Sample Size $N$ | Deterministic constant $n$ fixed before experiment | Random stopping time $N = \inf\{m \ge 1 : S_m \notin (b, a)\}$ |
| Primary Design Specification | Fix Type I error $\alpha$ and sample size $n$; minimize $\beta$ | Fix both Type I error $\alpha$ and Type II error $\beta$; minimize $\mathbb{E}[N]$ |
| Decision Space at Stage $m < n$ | No terminal decisions permitted until $m = n$ | Tripartite partition: Accept $H_0$, Reject $H_0$, or Continue |
| Expected Sample Size Savings | Baseline reference ($100\%$ of fixed $n$) | Typically $45\%$ to $60\%$ fewer observations under $H_0$ and $H_1$ |
§5.2 Fundamental Stopping Inequalities and Wald's Boundary Approximations
In practical statistical design, an investigator specifies the desired Type I error probability $\alpha = \mathbb{P}_{\theta_0}(\text{Reject } H_0)$ and Type II error probability $\beta = \mathbb{P}_{\theta_1}(\text{Accept } H_0)$ in advance, and seeks the exact numerical values of the stopping thresholds $A$ and $B$ that achieve $(\alpha, \beta)$. Unlike fixed-sample tests where exact quantile inversion of a single distribution suffices, exact determination of $A$ and $B$ in a discrete-time random walk requires tracking the distribution of the excess over the boundary at termination. Nevertheless, Abraham Wald discovered a pair of universal, distribution-free inequalities linking $(A, B)$ and $(\alpha, \beta)$ that hold across all probability distributions without any parametric assumptions.
Let $\mathcal{R}_m \subset \mathbb{R}^m$ denote the subset of sample paths $(x_1, \dots, x_m)$ for which the SPRT terminates at stage $N = m$ with rejection of $H_0$ ($\Lambda_m \ge A$), and let $\mathcal{A}_m \subset \mathbb{R}^m$ denote the subset of sample paths for which the SPRT terminates at stage $N = m$ with acceptance of $H_0$ ($\Lambda_m \le B$). Because the stopping events at distinct stages $m = 1, 2, \dots$ are mutually exclusive (a path can stop for the first time at most once), the overall probability of rejecting $H_0$ when $\theta = \theta_1$ is the countable sum of disjoint stage-wise rejection probabilities. Assuming the test terminates with probability one ($\mathbb{P}_\theta(N < \infty) = 1$, which we prove rigorously in Section 5.3), the probability of rejecting $H_0$ under $H_1$ is $1 - \beta$, while the probability of rejecting $H_0$ under $H_0$ is $\alpha$.
Theorem 5.1 (Wald's Fundamental Stopping Boundary Inequalities)
For any Sequential Probability Ratio Test with stopping boundaries $(B, A)$ that terminates with probability one under both $H_0$ and $H_1$, the true Type I error probability $\alpha$ and Type II error probability $\beta$ satisfy the exact inequalities:
Equivalently, solving for the error rates in terms of the boundaries yields:
Furthermore, the sum of the realized error probabilities if one sets the boundaries to the nominal Wald values $A_W = (1 - \beta_0)/\alpha_0$ and $B_W = \beta_0/(1 - \alpha_0)$ satisfies $\alpha + \beta \le \alpha_0 + \beta_0$.
Proof:
Consider the event of rejecting $H_0$, which is the disjoint union $\bigcup_{m=1}^\infty \mathcal{R}_m$. On every sample path $(x_1, \dots, x_m) \in \mathcal{R}_m$, the stopping rule requires that the likelihood ratio at termination satisfies $\Lambda_m(x_1, \dots, x_m) \ge A$, which is equivalent to the pointwise density inequality:
Integrating (or summing) both sides of this inequality over the rejection region $\mathcal{R}_m$ with respect to the product measure $d\mu^m$ and summing over all stages $m = 1, 2, \dots, \infty$, we obtain:
Dividing both sides of $1 - \beta \ge A \alpha$ by $\alpha > 0$ immediately yields the upper bound $A \le \frac{1 - \beta}{\alpha}$.
By completely symmetric reasoning, consider the event of accepting $H_0$, which is the disjoint union $\bigcup_{m=1}^\infty \mathcal{A}_m$. On every sample path $(x_1, \dots, x_m) \in \mathcal{A}_m$, termination at the lower boundary requires $\Lambda_m(x_1, \dots, x_m) \le B$, or equivalently:
Integrating over $\mathcal{A}_m$ and summing from $m = 1$ to $\infty$ yields:
Dividing by $1 - \alpha > 0$ establishes $B \ge \frac{\beta}{1 - \alpha}$.
Now suppose an investigator specifies target nominal error rates $(\alpha_0, \beta_0)$ and sets the boundaries using Wald's Boundary Approximations:
Let $\alpha_{\text{true}}$ and $\beta_{\text{true}}$ denote the actual Type I and Type II error probabilities induced by these boundaries $(B_W, A_W)$. Applying the two inequalities proven above to $(\alpha_{\text{true}}, \beta_{\text{true}})$ gives:
Adding these two cross-multiplied inequalities together yields:
Canceling the identical cross-product terms $-\alpha_{\text{true}}\beta_0 - \beta_{\text{true}}\alpha_0$ from both sides produces the celebrated conservation bound:
This proves that at least one of the true error probabilities $\alpha_{\text{true}}$ or $\beta_{\text{true}}$ must be less than or equal to its nominal target, and neither error rate can exceed its target by more than a negligible fraction $\alpha_0 \beta_0$: specifically, $\alpha_{\text{true}} \le \frac{\alpha_0}{1 - \beta_0} \approx \alpha_0(1 + \beta_0)$ and $\beta_{\text{true}} \le \frac{\beta_0}{1 - \alpha_0} \approx \beta_0(1 + \alpha_0)$. For instance, if $\alpha_0 = 0.05$ and $\beta_0 = 0.05$, then $\alpha_{\text{true}} \le 0.05/0.95 = 0.0526$.
Why are Wald's inequalities strict inequalities in discrete time rather than exact equalities? Because the random walk $S_m$ evolves in discrete steps $Z_m$, termination at stage $N$ almost always involves overshooting the boundary (the excess over the boundary): at the moment of rejection, $S_N$ does not hit $a = \ln A$ exactly on the nose, but rather jumps from $S_{N-1} < a$ to $S_N = a + R_+ > a$, where $R_+ = S_N - a > 0$ is the overshoot. In the continuous-time limit where individual increments $Z_i$ have infinitesimal variance (as when $\theta_1$ is close to $\theta_0$, leading to Brownian motion sample paths with continuous trajectories), the overshoot $R_+$ vanishes identically, and Wald's approximations $A = (1-\beta)/\alpha$ and $B = \beta/(1-\alpha)$ become exact equalities. Due to this slight overshoot in discrete time, using $(B_W, A_W)$ actually produces a slightly conservative test whose true error probabilities $\alpha_{\text{true}}$ and $\beta_{\text{true}}$ are typically smaller than $\alpha_0$ and $\beta_0$, at the slight expense of increasing the expected sample size by one or two observations.
§5.3 Proof of Finite Termination with Probability One via Stein's Lemma
A foundational prerequisite for any sequential procedure is that it must eventually terminate: if there were a positive probability $\mathbb{P}_\theta(N = \infty) > 0$ that the random walk $S_m$ wandered forever inside the open strip $(b, a)$ without ever crossing either threshold, the experiment could continue indefinitely. Charles Stein (1946) proved a remarkably strong theorem showing not only that $\mathbb{P}_\theta(N < \infty) = 1$ for every distribution where $Z_i$ is not identically zero, but also that the stopping time $N$ possesses an exponentially decaying tail, guaranteeing that all moments $\mathbb{E}_\theta[N^k]$ ($k = 1, 2, \dots$) and the moment generating function of $N$ around zero are strictly finite.
Theorem 5.2 (Stein's Lemma on Exponential Tail Decay and Almost-Sure Termination of the SPRT)
Let $Z_1, Z_2, \dots$ be i.i.d. random variables under probability measure $\mathbb{P}_\theta$ such that $\mathbb{P}_\theta(Z_1 = 0) < 1$. Let $N = \inf\{m \ge 1 : S_m \notin (b, a)\}$ be the stopping time of an SPRT with finite logarithmic boundaries $-\infty < b < 0 < a < \infty$. Then:
- There exist constants $C > 0$ and $\rho \in (0, 1)$ such that for all integers $n \ge 1$:
- Consequently, the SPRT terminates in a finite number of steps with probability one:
- All positive integer moments of the stopping time are finite: $\mathbb{E}_\theta[N^k] < \infty$ for all $k \ge 1$, and there exists $t_0 > 0$ such that the moment generating function $\mathbb{E}_\theta[e^{tN}] < \infty$ for all $t < t_0$.
Proof:
Let $L = a - b > 0$ denote the total width of the open continuation interval $(b, a)$. Because $\mathbb{P}_\theta(Z_1 = 0) < 1$, the distribution of $Z_1$ is non-degenerate at zero; hence either $\mathbb{P}_\theta(Z_1 > 0) > 0$ or $\mathbb{P}_\theta(Z_1 < 0) > 0$ (or both). Without loss of generality, suppose $\mathbb{P}_\theta(Z_1 > 0) > 0$. Then there exists a small positive threshold $\delta > 0$ and a strictly positive probability $\epsilon > 0$ such that:
Choose a fixed positive integer $r$ sufficiently large so that $r \delta > L = a - b$; specifically, let $r = \lfloor (a - b)/\delta \rfloor + 1$. Consider a block of $r$ consecutive increments $Z_{j+1}, Z_{j+2}, \dots, Z_{j+r}$ starting after any arbitrary stage $j \ge 0$. If each of these $r$ independent increments satisfies $Z_{j+i} \ge \delta$ for $i = 1, \dots, r$, then their block sum satisfies:
Because $Z_{j+1}, \dots, Z_{j+r}$ are independent and identically distributed, the probability of this block event is strictly positive:
Now observe that if the random walk is inside the continuation strip $(b, a)$ at stage $j$ (so $b < S_j < a$), and the subsequent $r$-step block sum exceeds $a - b$, then at stage $j + r$ the cumulative sum must satisfy:
Therefore, it is mathematically impossible for both $S_j \in (b, a)$ and $S_{j+r} \in (b, a)$ to occur simultaneously when $\sum_{i=1}^r Z_{j+i} > a - b$! Contrapositively, for the process to remain inside the continuation strip throughout the entire block from $j+1$ to $j+r$, the block sum cannot exceed $a - b$:
Now consider any arbitrary sample size $n \ge 1$, and divide the first $n$ observations into $k = \lfloor n / r \rfloor$ disjoint, independent blocks of length $r$ each. For the stopping time $N$ to exceed $n$, the random walk $S_m$ must remain strictly inside $(b, a)$ at the end of every single block $m = r, 2r, \dots, kr$. By the independence of disjoint blocks of i.i.d. increments:
Since $k = \lfloor n / r \rfloor > \frac{n}{r} - 1$, we can write $(1 - \epsilon^r)^k \le (1 - \epsilon^r)^{-1} \left[ (1 - \epsilon^r)^{1/r} \right]^n$. Defining the constants $C = (1 - \epsilon^r)^{-1} > 0$ and $\rho = (1 - \epsilon^r)^{1/r} \in (0, 1)$, we obtain the geometric tail bound:
Taking the limit as $n \to \infty$, since $0 < \rho < 1$:
Finally, for any $t > 0$ such that $e^t \rho < 1$ (i.e., $t < t_0 = -\ln \rho > 0$), the moment generating function of $N$ is bounded by a convergent geometric series:
Since the moment generating function $\mathbb{E}_\theta[e^{tN}]$ is finite in a neighborhood of $t = 0$, all moments $\mathbb{E}_\theta[N^k]$ are finite. This completes the proof of Stein's Lemma.
§5.4 Wald's Fundamental Identity and the Operating Characteristic (OC) Curve
To evaluate the performance of a sequential test across the entire parameter space $\Theta$—not merely at the two design points $\theta_0$ and $\theta_1$—we require the Operating Characteristic (OC) function, denoted $L(\theta)$, which gives the probability of accepting the null hypothesis $H_0$ as a function of the true parameter $\theta$:
Note that the power function of the sequential test is simply the complement of the OC function: $\text{Power}(\theta) = 1 - L(\theta) = \mathbb{P}_\theta(S_N \ge a)$. To compute $L(\theta)$ analytically, Abraham Wald proved one of the most powerful martingale identities in stochastic processes: Wald's Fundamental Identity in sequential analysis.
Let $M_\theta(t) = \mathbb{E}_\theta[e^{t Z_1}]$ denote the moment generating function (MGF) of a single log-likelihood ratio increment $Z_1 = \ln[f_1(X_1)/f_0(X_1)]$ when the true parameter is $\theta$. Define the discrete-time stochastic process $\{W_m(t)\}_{m \ge 0}$ by:
Observe that $\{W_m(t)\}_{m \ge 0}$ is a positive martingale with respect to the filtration $\{\mathcal{F}_m\}$, because for every $m \ge 0$:
By Doob's Optional Stopping Theorem ( combined with Stein's exponential tail bound on $N$ and the uniform boundedness of $S_{m \wedge N}$ inside $(b, a)$ prior to stopping), the expected value of the martingale at the stopping time $N$ equals its initial value $W_0(t) = 1$.
Theorem 5.3 (Wald's Fundamental Identity of Sequential Analysis)
Let $Z_1, Z_2, \dots$ be i.i.d. increments with moment generating function $M_\theta(t) = \mathbb{E}_\theta[e^{t Z_1}]$ finite in an open interval containing $t$, and let $N$ be the stopping time of an SPRT with finite boundaries $(b, a)$. Then for all $t$ in the domain of $M_\theta(t)$ such that $|M_\theta(t)| \ge 1$ (or within a neighborhood of the roots of $M_\theta(t) = 1$):
How does Wald's Fundamental Identity unlock the Operating Characteristic function $L(\theta)$? Suppose that for a given parameter value $\theta$ (with $\mathbb{E}_\theta[Z_1] \ne 0$), we can find a non-zero real root $t = h(\theta) \ne 0$ of the characteristic equation:
Because $M_\theta(t)$ is strictly convex ($M_\theta''(t) = \mathbb{E}_\theta[Z_1^2 e^{t Z_1}] > 0$), satisfies $M_\theta(0) = 1$, and has derivative $M_\theta'(0) = \mathbb{E}_\theta[Z_1] \ne 0$ at the origin, convexity guarantees that there exists at most one non-zero real root $h(\theta) \ne 0$ such that $M_\theta(h(\theta)) = 1$ (specifically, if $\mathbb{E}_\theta[Z_1] < 0$, then $h(\theta) > 0$; if $\mathbb{E}_\theta[Z_1] > 0$, then $h(\theta) < 0$). Notice that at the two design parameters $\theta_0$ and $\theta_1$, we can verify the root $h(\theta)$ by direct inspection:
- When $\theta = \theta_0$: $\mathbb{E}_{\theta_0}\left[\left(\frac{f_1(X)}{f_0(X)}\right)^1\right] = \int \frac{f_1(x)}{f_0(x)} f_0(x) \, d\mu(x) = \int f_1(x) \, d\mu(x) = 1$, so $h(\theta_0) = +1$.
- When $\theta = \theta_1$: $\mathbb{E}_{\theta_1}\left[\left(\frac{f_1(X)}{f_0(X)}\right)^{-1}\right] = \int \frac{f_0(x)}{f_1(x)} f_1(x) \, d\mu(x) = \int f_0(x) \, d\mu(x) = 1$, so $h(\theta_1) = -1$.
Now substitute $t = h(\theta) \ne 0$ into Wald's Fundamental Identity. Since $M_\theta(h(\theta)) = 1$, the random factor $[M_\theta(h(\theta))]^{-N} = 1^{-N} = 1$ drops out completely, leaving the remarkably clean identity:
Splitting this expectation across the two mutually exclusive terminal events—acceptance of $H_0$ ($S_N \le b$, which occurs with probability $L(\theta)$) and rejection of $H_0$ ($S_N \ge a$, which occurs with probability $1 - L(\theta)$)—and neglecting the boundary overshoot (so that $S_N \approx b = \ln B$ upon acceptance and $S_N \approx a = \ln A$ upon rejection), we obtain:
Solving this linear equation for $L(\theta)$ gives Wald's Operating Characteristic (OC) Formula:
What happens at the singular intermediate parameter value $\theta = \theta^*$ where the drift is zero ($\mathbb{E}_{\theta^*}[Z_1] = 0$, which corresponds to the confluent root $h(\theta^*) = 0$)? Applying L'Hôpital's rule to the OC formula as $h \to 0$:
This provides a complete parametric representation of the OC curve $(\theta(h), L(h))$ across the entire real line!
§5.5 Average Sample Number (ASN) Function and Parametric Derivations
| Parametric Family | Single Increment $Z_i = \ln[f_1(X_i)/f_0(X_i)]$ | Continue Sampling Inequality for $\sum_{i=1}^m X_i$ | Indifference Parameter $\theta^*$ ($\mathbb{E}_{\theta^*}[Z_i] = 0$) |
|---|---|---|---|
| Normal $\mathcal{N}(\theta, \sigma^2)$ | $\frac{\theta_1 - \theta_0}{\sigma^2} X_i - \frac{\theta_1^2 - \theta_0^2}{2\sigma^2}$ | $\frac{\sigma^2 b}{\theta_1 - \theta_0} + m\frac{\theta_0 + \theta_1}{2} < \sum X_i < \frac{\sigma^2 a}{\theta_1 - \theta_0} + m\frac{\theta_0 + \theta_1}{2}$ | $\theta^* = \frac{\theta_0 + \theta_1}{2}$ |
| Bernoulli $(p)$ | $X_i \ln\frac{p_1 q_0}{p_0 q_1} + \ln\frac{q_1}{q_0}$ | $\frac{b - m \ln(q_1/q_0)}{\ln(p_1 q_0 / p_0 q_1)} < \sum X_i < \frac{a - m \ln(q_1/q_0)}{\ln(p_1 q_0 / p_0 q_1)}$ | $p^* = \frac{\ln(q_0 / q_1)}{\ln(p_1 q_0 / p_0 q_1)}$ |
| Poisson $(\lambda)$ | $X_i \ln\frac{\lambda_1}{\lambda_0} - (\lambda_1 - \lambda_0)$ | $\frac{b + m(\lambda_1 - \lambda_0)}{\ln(\lambda_1 / \lambda_0)} < \sum X_i < \frac{a + m(\lambda_1 - \lambda_0)}{\ln(\lambda_1 / \lambda_0)}$ | $\lambda^* = \frac{\lambda_1 - \lambda_0}{\ln(\lambda_1 / \lambda_0)}$ |
| Exponential $(\theta)$ | $\ln\frac{\theta_1}{\theta_0} - (\theta_1 - \theta_0) X_i$ | $\frac{m \ln(\theta_1/\theta_0) - a}{\theta_1 - \theta_0} < \sum X_i < \frac{m \ln(\theta_1/\theta_0) - b}{\theta_1 - \theta_0}$ | $\theta^* = \frac{\theta_1 - \theta_0}{\ln(\theta_1 / \theta_0)}$ |
§5.6 The Wald-Wolfowitz Optimality Theorem and Truncated Sequential Designs
Why did Abraham Wald select constant horizontal boundaries $(b, a)$ for the cumulative log-likelihood ratio $S_m$ rather than curved or time-varying boundaries $(b_m, a_m)$? In 1948, Abraham Wald and Jacob Wolfowitz proved one of the deepest theorems in mathematical statistics: among all sequential and fixed-sample tests whose error probabilities do not exceed those of the SPRT, the SPRT simultaneously minimizes the expected sample size under both $H_0$ and $H_1$!
Theorem 5.5 (Wald-Wolfowitz Optimality Theorem for the SPRT)
Let $\mathcal{T}^*$ be a Sequential Probability Ratio Test with stopping time $N^*$ and terminal decision $\delta^*$ having error probabilities $\alpha(\mathcal{T}^*) = \alpha$ and $\beta(\mathcal{T}^*) = \beta$. Let $\mathcal{T} = (N, \delta)$ be any other sequential or fixed-sample test such that:
Then the expected sample size of $\mathcal{T}^*$ is simultaneous smaller than or equal to that of $\mathcal{T}$ under both hypotheses:
Sketch of Proof via Bayesian Sequential Decision Theory and Kullback-Leibler Divergence:
Consider a Bayesian sequential decision problem where $\theta \in \{\theta_0, \theta_1\}$ is assigned prior probability $\pi = \mathbb{P}(\theta = \theta_1) \in (0, 1)$, let $c > 0$ be the cost per observation, and let $w_0, w_1 > 0$ be the terminal losses for Type I and Type II errors. The total Bayes risk of any test $\mathcal{T} = (N, \delta)$ is:
By backward induction and Bellman's optimality equation for Markov decision processes, since the posterior probability $\pi_m = \mathbb{P}(\theta = \theta_1 \mid X_1, \dots, X_m)$ is a monotone function of the likelihood ratio $\Lambda_m$ via Bayes' rule:
and the future observation dynamics are time-homogeneous, the optimal Bayes continuation region in terms of $\pi_m$ is a time-invariant open interval $(\pi_L, \pi_U)$, which transforms via Bayes' rule into a time-invariant interval $B < \Lambda_m < A$, i.e., an SPRT! By varying the prior $\pi$ and loss weights $(w_0, w_1)$ to match the given boundaries $(B, A)$, if any competing test $\mathcal{T}$ had $\alpha(\mathcal{T}) \le \alpha(\mathcal{T}^*)$, $\beta(\mathcal{T}) \le \beta(\mathcal{T}^*)$, and strictly smaller $\mathbb{E}_{\theta_0}[N] < \mathbb{E}_{\theta_0}[N^*]$ (or $\mathbb{E}_{\theta_1}[N] < \mathbb{E}_{\theta_1}[N^*]$), it would achieve a strictly smaller Bayes risk than the Bayes-optimal SPRT $\mathcal{T}^*$, which is a contradiction.
We can also derive a universal Information-Theoretic Lower Bound on $\mathbb{E}_{\theta_0}[N]$ and $\mathbb{E}_{\theta_1}[N]$ directly from Wald's Equation and the data-processing inequality for Kullback-Leibler divergence. Note that $\mathbb{E}_{\theta_0}[Z_1] = -D_{\text{KL}}(f_0 \parallel f_1)$. Applying Jensen's inequality conditionally on the terminal decision $\delta_N \in \{0, 1\}$ to $\mathbb{E}_{\theta_0}[S_N] = \mathbb{E}_{\theta_0}[\ln \Lambda_N]$ yields:
Thus, for any test $\mathcal{T} = (N, \delta)$ with error probabilities $(\alpha, \beta)$:
Comparing the numerator of this universal lower bound with Wald's ASN formula at $\theta_0$ and $\theta_1$ using $\ln A \approx \ln\left(\frac{1-\beta}{\alpha}\right)$ and $\ln B \approx \ln\left(\frac{\beta}{1-\alpha}\right)$, we see that Wald's SPRT attains the exact information-theoretic lower bound up to the negligible boundary overshoot!
In clinical trials and industrial applications, one practical concern with the open-ended SPRT is that if the true parameter happens to lie near the indifference point $\theta^*$, the sample size $N$, though finite with probability one, has a positively skewed distribution and may occasionally exceed the fixed-sample size $n_{\text{fixed}}$. Furthermore, budgeting and hospital logistics require a hard upper bound $N_{\max}$ on the number of patients enrolled. This motivates Truncated Sequential Designs and Group Sequential Designs:
- Wald's Truncated SPRT: If the SPRT has not terminated by a pre-specified maximum stage $N_{\max}$, sampling is forcibly stopped at $N_{\max}$, and $H_0$ is accepted if $S_{N_{\max}} \le 0$ and rejected if $S_{N_{\max}} > 0$.
- Group Sequential Clinical Trials (Pocock, O'Brien-Fleming, and Lan-DeMets $\alpha$-Spending Boundaries): Rather than monitoring after every single patient, data are analyzed at $K$ interim looks (e.g., $K = 4$ or $5$ stages of $m$ patients each). Pocock (1977) proposed constant standardized $Z$-thresholds across all looks, whereas O'Brien and Fleming (1979) proposed conservative early thresholds $c_k = c_{\text{OBF}} \sqrt{K/k}$ that make early stopping very stringent unless the treatment effect is dramatic, while preserving a final critical value $c_K$ nearly identical to the fixed-sample test.
Step-by-Step Hypothesis Testing & Nonparametric Solutions
Three original questions connect calculations, definitions and interpretation. Open each solution to follow the reasoning.
A semiconductor wafer fabrication plant monitors the oxide layer thickness $X$ (in nanometers) of silicon wafers, where $X_i \stackrel{\text{i.i.d.}}{\sim} \mathcal{N}(\theta, \sigma^2)$ with known process standard deviation $\sigma = 2.0\text{ nm}$. A quality control engineer designs a Wald Sequential Probability Ratio Test (SPRT) to test the simple null hypothesis $H_0 : \theta = 10.0\text{ nm}$ against the simple alternative hypothesis $H_1 : \theta = 11.0\text{ nm}$, with nominal Type I error probability $\alpha = 0.01$ and Type II error probability $\beta = 0.05$.
- Calculate Wald's stopping boundaries $A$ and $B$, and derive the explicit stage-$m$ continuation inequalities in terms of the cumulative sample sum $\sum_{i=1}^m X_i$.
- Derive the exact formula for the non-zero root $h(\theta)$ of $\mathbb{E}_\theta[e^{h Z_1}] = 1$, and evaluate the Operating Characteristic $L(\theta)$ and Average Sample Number $\mathbb{E}_\theta[N]$ at the four parameter values $\theta \in \{10.0, 11.0, 10.5, 10.25\}$.
- Compute the required sample size $n_{\text{fixed}}$ of the Most Powerful fixed-sample Neyman-Pearson test achieving the exact same $(\alpha = 0.01, \beta = 0.05)$, and determine the percentage sample size reduction achieved by the SPRT under $H_0$, $H_1$, and at the worst-case indifference midpoint $\theta^* = 10.5$.
Given nominal error probabilities $\alpha = 0.01$ and $\beta = 0.05$, Wald's boundary approximations are:
Taking natural logarithms gives the logarithmic thresholds $a = \ln A$ and $b = \ln B$:
For $X_i \sim \mathcal{N}(\theta, \sigma^2)$ with $\theta_0 = 10.0$, $\theta_1 = 11.0$, and $\sigma^2 = 4.0$, the single-observation log-likelihood ratio increment $Z_i$ is:
Notice that $0.25 X_i - 2.625 = 0.25(X_i - 10.5)$. Summing over the first $m$ observations gives the cumulative log-likelihood ratio:
The SPRT continuation condition $b < S_m < a$ is therefore $-2.985682 < 0.25 \sum_{i=1}^m X_i - 2.625 m < 4.553877$. Multiplying through by $4$ and adding $10.5 m$ yields the explicit linear stopping boundaries for the cumulative sum $\sum_{i=1}^m X_i$:
At stage $m$, we accept $H_0$ if $\sum_{i=1}^m X_i \le 10.5 m - 11.9427$, reject $H_0$ if $\sum_{i=1}^m X_i \ge 10.5 m + 18.2155$, and continue sampling otherwise. Notice that both boundary lines have identical slope $\frac{\theta_0 + \theta_1}{2} = 10.5\text{ nm}$ and parallel vertical intercepts $-11.9427$ and $+18.2155$.
When the true parameter is $\theta$, $X_i \sim \mathcal{N}(\theta, 4)$, so $Z_i = 0.25(X_i - 10.5)$ is normally distributed with mean and variance:
The moment generating function of $Z_1 \sim \mathcal{N}(\mu_Z(\theta), \sigma_Z^2)$ is $M_\theta(h) = \exp\left( h \mu_Z(\theta) + \frac{1}{2} h^2 \sigma_Z^2 \right)$. Setting $M_\theta(h) = 1$ for $h \ne 0$ requires the exponent to vanish:
Let us now evaluate $L(\theta)$ and $\mathbb{E}_\theta[N]$ across the four specified values of $\theta$:
- Case 1 ($\theta = \theta_0 = 10.0$): Here $h(10.0) = 21 - 20 = +1$, $L(10.0) = 1 - \alpha = 0.99$, and $\mathbb{E}_{10.0}[Z_1] = 0.25(10.0 - 10.5) = -0.125$. By Wald's ASN formula:
- Case 2 ($\theta = \theta_1 = 11.0$): Here $h(11.0) = 21 - 22 = -1$, $L(11.0) = \beta = 0.05$, and $\mathbb{E}_{11.0}[Z_1] = 0.25(11.0 - 10.5) = +0.125$. By Wald's ASN formula:
- Case 3 (Indifference midpoint $\theta^* = 10.5$): Here $h(10.5) = 0$ and $\mathbb{E}_{10.5}[Z_1] = 0$, with $\mathbb{E}_{10.5}[Z_1^2] = \sigma_Z^2 = 0.25$. Applying the L'Hôpital zero-drift formulas:
- Case 4 (Intermediate point $\theta = 10.25$): Here $h(10.25) = 21 - 20.5 = +0.5$, and $\mathbb{E}_{10.25}[Z_1] = 0.25(10.25 - 10.5) = -0.0625$. Computing the OC value:
Substituting $L(10.25) = 0.9186$ into the ASN equation:
For a fixed-sample Neyman-Pearson test of $H_0 : \theta = 10.0$ against $H_1 : \theta = 11.0$ with $\sigma = 2.0$, $\alpha = 0.01$ ($z_{0.01} = 2.32635$), and $\beta = 0.05$ ($z_{0.05} = 1.64485$), the required fixed sample size is:
Comparing the expected sample sizes of the SPRT against $n_{\text{fixed}} = 63.08$:
- Under $H_0$ ($\theta = 10.0$): $\mathbb{E}_{10.0}[N] = 23.28$ vs. $63.08$, yielding a $63.1\%$ reduction in average sample size!
- Under $H_1$ ($\theta = 11.0$): $\mathbb{E}_{11.0}[N] = 33.42$ vs. $63.08$, yielding a $47.0\%$ reduction in average sample size!
- Even at the absolute worst-case zero-drift midpoint $\theta^* = 10.5$, $\mathbb{E}_{10.5}[N] = 54.39 < 63.08$, which is still $13.8\%$ smaller than the fixed-sample test!
An aerospace defense contractor inspects incoming lots of titanium fasteners for microscopic fatigue cracks. Each inspected fastener is classified as defective ($X_i = 1$, with probability $p$) or non-defective ($X_i = 0$, with probability $q = 1 - p$). A lot is considered acceptable (Producer's Quality Level) if $H_0 : p = p_0 = 0.02$ and unacceptable (Consumer's Rejectable Quality Level) if $H_1 : p = p_1 = 0.10$. The sequential inspection plan is designed with Producer's Risk $\alpha = 0.05$ and Consumer's Risk $\beta = 0.10$.
- Derive the stage-$m$ acceptance number $c_{\text{acc}}(m)$ and rejection number $c_{\text{rej}}(m)$ for the cumulative number of defectives $D_m = \sum_{i=1}^m X_i$, and determine the minimum possible number of fasteners required to accept a defect-free lot or reject a purely defective lot.
- Find the exact indifference defect rate $p^*$ where the log-likelihood drift vanishes ($\mathbb{E}_{p^*}[Z_1] = 0$), and calculate the Operating Characteristic $L(p^*)$ and Average Sample Number $\mathbb{E}_{p^*}[N]$ at $p^*$.
- Calculate the ASN $\mathbb{E}_p[N]$ when the lot is perfectly defect-free ($p = 0$), at the acceptable quality level ($p = 0.02$), and at the rejectable quality level ($p = 0.10$).
With $\alpha = 0.05$ and $\beta = 0.10$, Wald's boundaries and their natural logarithms are:
For $X_i \sim \text{Bernoulli}(p)$ with $p_0 = 0.02$ ($q_0 = 0.98$) and $p_1 = 0.10$ ($q_1 = 0.90$), the single-step log-likelihood increment is:
Evaluating the logarithms numerically gives $\ln(49/9) \approx 1.694596$ and $\ln(49/45) \approx 0.085158$, so:
where $D_m = \sum_{i=1}^m X_i$ is the cumulative count of defective fasteners in the first $m$ inspections. Dividing $b < S_m < a$ by $1.694596$ gives the linear continuation region $c_{\text{acc}}(m) < D_m < c_{\text{rej}}(m)$:
- Minimum sample size to accept $H_0$ (when zero defectives are found, $D_m = 0$): Setting $c_{\text{acc}}(m) \ge 0$ requires $-1.3285 + 0.05025 m \ge 0 \implies m \ge 26.44$, so at least $m = 27$ consecutive non-defective fasteners must be inspected before a lot can be accepted!
- Minimum sample size to reject $H_0$ (when every inspected fastener is defective, $D_m = m$): Setting $m \ge c_{\text{rej}}(m) = 1.7056 + 0.05025 m \implies 0.94975 m \ge 1.7056 \implies m \ge 1.796$, so if the first $m = 2$ fasteners are both defective ($D_2 = 2 > 1.806$), the lot is rejected immediately at stage $2$!
The expected increment under true defect rate $p$ is $\mathbb{E}_p[Z_1] = 1.694596 p - 0.085158$. Setting $\mathbb{E}_{p^*}[Z_1] = 0$ yields the indifference proportion $p^*$ (which equals the common slope of the boundary lines!):
At $p = p^* = 0.050253$, since $\mathbb{E}_{p^*}[Z_1] = 0$, the second moment $\mathbb{E}_{p^*}[Z_1^2]$ equals the variance of $Z_1 = 1.694596 X_1 - 0.085158$:
Therefore, the Operating Characteristic and Average Sample Number at $p^* = 0.050253$ are:
- When $p = 0$ (perfectly defect-free lot): Every $X_i = 0$ deterministically, so $L(0) = 1$ and $\mathbb{E}_0[Z_1] = -0.085158$. By Wald's approximation $\mathbb{E}_0[N] \approx \frac{b}{-0.085158} = \frac{-2.251292}{-0.085158} = 26.44$ (exact integer termination occurs at $N = \lceil 26.44 \rceil = 27$ fasteners).
- When $p = p_0 = 0.02$: Here $L(0.02) = 1 - \alpha = 0.95$ and $\mathbb{E}_{0.02}[Z_1] = 1.694596(0.02) - 0.085158 = -0.051266$:
- When $p = p_1 = 0.10$: Here $L(0.10) = \beta = 0.10$ and $\mathbb{E}_{0.10}[Z_1] = 1.694596(0.10) - 0.085158 = +0.084302$:
Suppose that under a sequential test of $H_0$ vs. $H_1$, the single-observation log-likelihood ratio increment $Z_i = \ln[f_1(X_i)/f_0(X_i)]$ takes only values on the integer lattice $\{-1, +1\}$ (scaled in units of $c > 0$), or more generally let $Y_i = Z_i / c \in \{-1, +1\}$ with $\mathbb{P}_\theta(Y_i = +1) = p$ and $\mathbb{P}_\theta(Y_i = -1) = q = 1 - p$ ($p \ne 1/2$). Suppose the logarithmic stopping boundaries are exact integer multiples of the step size $c$: $b = -M c$ and $a = +K c$ for positive integers $M, K \ge 1$.
- Show that on this discrete lattice, the boundary overshoot at termination is identically zero ($S_N = b$ or $S_N = a$ exactly), and use Wald's Fundamental Identity $\mathbb{E}_\theta[e^{h S_N}] = 1$ to derive the exact Operating Characteristic $L(p)$ without any approximation.
- Assuming $Z_i = \pm c$ is a true log-likelihood ratio increment under $H_0$ ($p = p_0$) and $H_1$ ($p = p_1$), prove that $p_1 = 1 - p_0 = q_0$ and $c = \ln(p_1 / p_0)$, and verify that Wald's boundary formulas $A = (1 - \beta)/\alpha$ and $B = \beta/(1 - \alpha)$ hold with exact equality.
- Derive the exact closed-form expression for the Average Sample Number $\mathbb{E}_p[N]$ for both $p \ne 1/2$ and the symmetric fair-coin case $p = 1/2$.
Let $U_m = S_m / c = \sum_{i=1}^m Y_i$ denote the integer-valued simple random walk starting at $U_0 = 0$ with absorption barriers at $-M$ and $+K$. Because each step $Y_i \in \{-1, +1\}$ changes $U_m$ by exactly $\pm 1$, the walk cannot jump over the integer boundaries $-M$ or $+K$ without landing directly on them! Hence at the stopping time $N$, the overshoot is identically zero:
Let us find the non-zero root $h \ne 0$ of the moment generating function $M_p(h) = \mathbb{E}_p[e^{h c Y_1}] = p e^{hc} + q e^{-hc} = 1$. Setting $u = e^{hc}$, the equation $p u + q u^{-1} = 1$ becomes the quadratic $p u^2 - u + q = (u - 1)(p u - q) = 0$. Since $h \ne 0 \implies u \ne 1$, the unique non-trivial root is:
Substituting $e^{h S_N} = \left(e^{hc}\right)^{U_N} = \left(\frac{q}{p}\right)^{U_N}$ into Wald's Fundamental Identity $\mathbb{E}_p\left[e^{h S_N}\right] = 1$, and noting that $U_N$ equals $-M$ or $+K$ with zero overshoot, gives the exact equation:
For $Z_i = \ln[f_1(X_i)/f_0(X_i)]$ to take only the two values $+c$ (when $Y_i = +1$) and $-c$ (when $Y_i = -1$), the likelihood ratios on the two outcomes must satisfy:
Solving $p_1 = p_0 e^c$ and $1 - p_1 = (1 - p_0) e^{-c}$ yields $p_0 e^c + (1 - p_0) e^{-c} = 1 \implies e^c = \frac{1 - p_0}{p_0} = \frac{q_0}{p_0}$. Therefore, $p_1 = p_0 \left(\frac{q_0}{p_0}\right) = q_0 = 1 - p_0$, and $q_1 = 1 - p_1 = p_0$, with $c = \ln(q_0 / p_0) = \ln(p_1 / p_0) > 0$ (for $p_1 > 1/2 > p_0$). Furthermore, the original likelihood boundaries are $A = e^a = e^{Kc} = (q_0/p_0)^K$ and $B = e^b = e^{-Mc} = (q_0/p_0)^{-M}$.
- Under $H_0$ ($p = p_0$): $\frac{q_0}{p_0} = e^c$, so our exact OC formula gives $1 - \alpha = L(p_0) = \frac{e^{Kc} - 1}{e^{Kc} - e^{-Mc}} = \frac{A - 1}{A - B}$, and $\alpha = 1 - L(p_0) = \frac{1 - B}{A - B}$.
- Under $H_1$ ($p = p_1 = q_0$): $\frac{q_1}{p_1} = \frac{p_0}{q_0} = e^{-c}$, so $\beta = L(p_1) = \frac{e^{-Kc} - 1}{e^{-Kc} - e^{Mc}} = \frac{A^{-1} - 1}{A^{-1} - B^{-1}} = \frac{B(1 - A)}{B - A} = \frac{B(A - 1)}{A - B}$, and $1 - \beta = \frac{A(1 - B)}{A - B}$.
Dividing $1 - \beta$ by $\alpha$ and $\beta$ by $1 - \alpha$ immediately confirms exact equality:
For $p \ne 1/2$, the single-step drift of $U_m = S_m / c$ is $\mathbb{E}_p[Y_1] = p - q = 2p - 1 \ne 0$, and the exact terminal expectation is $\mathbb{E}_p[U_N] = -M L(p) + K[1 - L(p)]$. By Wald's First Equation:
For the symmetric zero-drift case $p = q = 1/2$, $\mathbb{E}_{1/2}[Y_1] = 0$, $\mathbb{E}_{1/2}[Y_1^2] = 1$, and $L(1/2) = \frac{K}{K + M}$. By Wald's Second Equation $\mathbb{E}_{1/2}[N] = \frac{\mathbb{E}_{1/2}[U_N^2]}{\mathbb{E}_{1/2}[Y_1^2]}$, since $U_N^2$ equals $M^2$ with probability $\frac{K}{K+M}$ and $K^2$ with probability $\frac{M}{K+M}$:
This reproduces the exact classic Gambler's Ruin expected duration $MK$ with zero approximation error!