Skip to content

Sequential probability ratio test

A sequential probability ratio test stops when evidence crosses a boundary. Follow a Bernoulli example, first-stop semantics and exact versus nominal error rates.

A sequential probability ratio test (SPRT) compares two specified statistical models as observations arrive, stopping the first time their likelihood ratio crosses an upper or lower boundary. It can decide earlier than a fixed sample design when evidence accumulates quickly. For a quant monitoring a binary outcome stream, the useful change is that when to stop is part of the test, rather than an informal decision made after inspecting results.
The classical construction below tests two simple hypotheses: each fixes the entire distribution. It does not automatically answer an open-ended question such as whether a strategy has any positive edge. Perlman's sequential-testing notes, §19.1 introduce this model comparison.

Evidence has a direction—and a stopping rule

Let X1,X2,…X_1,X_2,\ldots be independent, identically distributed observations with probability mass function or density f0f_0 under the null hypothesis and f1f_1 under the alternative hypothesis. Define the likelihood ratio with the alternative in the numerator:
Λn=∏i=1nf1(Xi)f0(Xi),Zn=log⁡Λn=∑i=1nlog⁡f1(Xi)f0(Xi).\Lambda_n=\prod_{i=1}^n\frac{f_1(X_i)}{f_0(X_i)}, \qquad Z_n=\log\Lambda_n =\sum_{i=1}^n\log\frac{f_1(X_i)}{f_0(X_i)}.

Large values favour H1H_1; small values favour H0H_0. The log form accumulates evidence by addition. A source using L0/L1L_0/L_1 reverses the directions, so check the numerator before copying a decision rule.

Write α\alpha for the nominal Type I error target and β\beta for the nominal Type II error target. Wald's conventional boundaries are
A=1−βα,B=β1−α,0<B<1<A.A=\frac{1-\beta}{\alpha}, \qquad B=\frac{\beta}{1-\alpha}, \qquad 0<B<1<A.
After each observation, apply the following rule only if the test has not already stopped:
Current evidenceAction
Λn≥A\Lambda_n\ge A, or Zn≥log⁡AZ_n\ge\log AStop and choose H1H_1
Λn≤B\Lambda_n\le B, or Zn≤log⁡BZ_n\le\log BStop and choose H0H_0
B<Λn<AB<\Lambda_n<AContinue
Here “choose” means make the test's terminal decision between these two models; it does not prove that either model is literally true. These are approximate error-calibration formulas: an observation can carry the statistic past a boundary rather than exactly onto it. Stefan and coauthors, “Stopping rules and error rate control”, discuss this overshoot and the distinction between nominal and effective errors.

Eight successes, then stop

Consider a fictional monitoring experiment in which each observation records whether an execution meets a predeclared criterion: Xi=1X_i=1 for success and Xi=0X_i=0 otherwise. Assume independent Bernoulli outcomes with one constant success probability throughout the experiment. Compare
H0:p=0.4withH1:p=0.6,α=β=0.05.H_0:p=0.4 \qquad\text{with}\qquad H_1:p=0.6, \qquad \alpha=\beta=0.05.

The parameters are illustrative model values, not execution-quality targets. With sns_n successes and n−snn-s_n failures, the Bernoulli likelihood gives

Λn=(0.60.4)sn(0.40.6)n−sn,Zn=(2sn−n)log⁡(1.5).\Lambda_n =\left(\frac{0.6}{0.4}\right)^{s_n} \left(\frac{0.4}{0.6}\right)^{n-s_n}, \qquad Z_n=(2s_n-n)\log(1.5).
Each success adds log⁡(1.5)≈0.405465\log(1.5)\approx0.405465; each failure subtracts the same amount. This follows directly from the binary likelihood described in Penn State's likelihood-methods notes, using the reciprocal ratio convention here.

The boundaries are A=19A=19 and B=1/19B=1/19, or approximately ±2.944439\pm2.944439 on the log scale. Suppose the first eight outcomes are all successes:

ObservationLog likelihood ratioDecision
77log⁡(1.5)=2.8382567\log(1.5)=2.838256Continue
88log⁡(1.5)=3.2437218\log(1.5)=3.243721Stop; choose H1H_1
At the stop, Λ8=1.58=25.62890625\Lambda_8=1.5^8=25.62890625, beyond the threshold of 19. A hypothetical ninth failure is not processed by this completed test. Recomputing a running statistic after the stop and withdrawing the decision would define a different procedure.
Fictional iid Bernoulli SPRT comparing p 0.4 with p 0.6: seven successes give log likelihood ratio 2.838256 below the upper boundary 2.944439; eight give 3.243721 and stop the test. The lower boundary is minus 2.944439. Later observations are excluded.
Fictional iid Bernoulli SPRT comparing p 0.4 with p 0.6: seven successes give log likelihood ratio 2.838256 below the upper boundary 2.944439; eight give 3.243721 and stop the test. The lower boundary is minus 2.944439. Later observations are excluded.
Original model calculation. Each success adds log 1.5; the first crossing occurs at observation 8. The continuation region lies between the two dashed boundaries.

What “nominal 5%” means in this example

We can calculate the exact errors here without simulation. Let Dn=2sn−nD_n=2s_n-n, successes minus failures. Because 7log⁡(1.5)<log⁡19<8log⁡(1.5)7\log(1.5)<\log19<8\log(1.5), stopping occurs when DnD_n first hits +8+8 or −8-8.

Under H0H_0, let h(k)h(k) be the probability of eventually hitting +8+8 before −8-8, starting at D=kD=k. It obeys

h(k)=0.4h(k+1)+0.6h(k−1),h(−8)=0,h(8)=1.h(k)=0.4h(k+1)+0.6h(k-1), \qquad h(-8)=0,\quad h(8)=1.

Solving this recurrence gives the false-rejection probability from D0=0D_0=0:

h(0)=1−1.581−1.516=11+1.58=2566817≈3.7553%.h(0)=\frac{1-1.5^8}{1-1.5^{16}} =\frac{1}{1+1.5^8} =\frac{256}{6817} \approx3.7553\%.
Swapping success and failure gives the same probability of choosing H0H_0 under H1H_1. Both exact errors are therefore about 3.7553% for this infinite-horizon, iid design with no truncation. The nominal 5% inputs did not produce exact 5% errors. This calculation is specific to these Bernoulli models and boundaries.

Applying the idea to financial data

A live success stream can contain serial dependence, changing market conditions and delayed outcomes. Then the iid likelihood above is misspecified. A dependent-data model needs the correct joint or conditional likelihood; simply multiplying marginal Bernoulli probabilities does not fix the problem. Unknown nuisance parameters, composite alternatives, a maximum sample size or a changed observation schedule also require a design whose operating characteristics account for those choices.

Repeatedly checking an ordinary fixed sample hypothesis test and stopping when it rejects does not turn it into an SPRT. Likewise, the terminal likelihood ratio is neither a p-value nor a posterior probability; posterior odds additionally need prior odds. The assumptions and stopping rule jointly determine what the decision can support.
For the fixed sample foundations, The Hypothesis Testing Framework explains simple versus composite hypotheses and both error types. Its preview is public; the full lesson requires membership.

Sources

Last updated
  • sequential testing
  • likelihood ratio
  • stopping rules
  • bernoulli model
  • error calibration
← Back to the glossaryBack to top ↑