🎰  Sequential Probability Ratio Test (SPRT)

Sequential Probability Ratio Test (SPRT)#

A sequential test that accumulates the likelihood ratio and stops when it crosses preset bounds.

Important

✨ AI-generated content. This page was written with the assistance of an AI language model and is provided as a learning aid. Despite careful review, it may still contain mistakes, omissions, or out-of-date information. Whether you are new to the topic, a team lead, or a senior practitioner, treat it as a starting point rather than an authoritative reference: read it critically and independently verify anything you act on (code, commands, figures, and factual claims) against official documentation and primary sources before relying on it.

What it is#

The sequential probability ratio test (SPRT), due to Abraham Wald, is a hypothesis test that evaluates data as it arrives rather than fixing the sample size in advance. It compares two simple hypotheses,

\[H_0 : \theta = \theta_0 \quad \text{vs} \quad H_1 : \theta = \theta_1,\]

and after each observation decides to accept \(H_0\), accept \(H_1\), or keep sampling.

The running likelihood ratio#

After \(n\) observations, accumulate the likelihood ratio

\[\Lambda_n = \frac{L(\text{data}_{1:n} \mid H_1)}{L(\text{data}_{1:n} \mid H_0)}.\]

Decision boundaries#

Two boundaries are set from the desired Type I (\(\alpha\)) and Type II (\(\beta\)) error rates:

\[A = \frac{1 - \beta}{\alpha}, \qquad B = \frac{\beta}{1 - \alpha}.\]

Then stop when \(\Lambda_n \ge A\) (accept \(H_1\)) or \(\Lambda_n \le B\) (accept \(H_0\)); while \(B < \Lambda_n < A\), continue.

Worked example#

For conversion rates \(H_0 : p = 0.10\) vs \(H_1 : p = 0.12\) with \(\alpha = 0.05, \beta = 0.20\),

\[A = \frac{1 - 0.20}{0.05} = 16, \qquad B = \frac{0.20}{0.95} \approx 0.21.\]

Update \(\Lambda_n\) as conversions come in; cross 16 → conclude \(H_1\), drop below 0.21 → conclude \(H_0\), otherwise keep going.

Strengths and limits#

On average the SPRT needs fewer samples than a fixed-horizon test, stops as soon as evidence is decisive, and holds the chosen \(\alpha\) and \(\beta\). The catch: it’s built for simple hypotheses (fixed \(\theta_0, \theta_1\)), is awkward for composite ones (e.g. \(p \le 0.10\)), and needs real-time monitoring. Wald introduced it for WWII quality control (accepting or rejecting munitions lots with fewer inspections); today it appears in clinical trials, sequential A/B testing and industrial QC. Versus group-sequential designs (which look at fixed checkpoints), the SPRT is genuinely continuous.


Theme: Sequential Methods & Bandits  ·  All terminology



See also

Source article Adapted (context, re-expressed) in our own words from: Sequential Probability Ratio Test (SPRT) (insightful-data-lab.com).

Tags: purpose: reference topic: terminology level: advanced