Menu Close

Sequential analysis: UPSC Statistics Optional PYQ Solutions (1995–2026)

All 27 questions UPSC has asked on sequential analysis in the Statistics Optional (Paper I, Statistical Inference) from 1995 to 2026, solved step by step – latest first.

Try them yourself first: the same questions, without solutions, are on our Statistical Inference topic-wise PYQs page.

How we check these solutions

These are our own solutions, prepared with AI help. UPSC does not publish official answers. Every solution is checked a second way before it goes up, and says how:

  • ✓ Checked by computer the numbers were worked out again independently in code (Python with NumPy/SciPy) and matched.
  • ✓ Proof checked step by step for “prove that” and “examine whether” questions, every step was checked against the definitions and the standard theorems.
  • ✓ Derivation checked step by step for derivations and approximations, every step was checked, and the result was also tested numerically.
  • ✓ Answer checked step by step for descriptive questions, every point was checked against the standard theory.

Spotted a mistake or a neater method? Tell us in the comments below or through Report an error.

Jump to a question (year · question number):

2026 · 4c 2025 · 4a 2023 · 3c 2022 · 2a 2021 · 3a 2020 · 4a 2018 · 4c 2016 · 4a 2015 · 4c 2014 · 4b 2013 · 4a 2012 · 4a 2011 · 4b 2010 · 3c 2009 · 2c 2007 · 1d 2006 · 4b 2005 · 4c 2004 · 4b 2002 · 1f 2001 · 1d 2000 · 4c 1999 · 8a 1998 · 7c 1997 · 8b 1996 · 7b 1995 · 7b

Cover of the UPSC Prelims Topic-wise PYQ book with detailed explanations

From the Optional Province team

Preparing for Prelims too?

Our UPSC Prelims Topic-wise PYQ Book covers every Prelims question with detailed explanations, so you can see exactly where UPSC asks from. Now available as a hard copy and an eBook.

Buy Hard Copy on AmazonBuy eBook (PDF)

Download a free sample

Describe sequential probability ratio test (SPRT). Find the SPRT for testing H0:θ=θ0 against H1:θ=θ1, using random observations from Poisson (θ). Also find the OC function for the test.

2026 · Paper I · Q4c · 15 marks

Solution

SPRT. Observations X1,X2,…X_1,X_2,\dots are taken one at a time. After nn observations, compute the likelihood ratio λn=∏i=1nf(xi;θ1)f(xi;θ0),\lambda_n=\prod_{i=1}^n\frac{f(x_i;\theta_1)}{f(x_i;\theta_0)}, and, with constants 0<B<1<A0<B<1<A:

  • if λn≥A\lambda_n\ge A, stop and accept H1H_1;
  • if λn≤B\lambda_n\le B, stop and accept H0H_0;
  • if B<λn<AB<\lambda_n<A, take another observation.

For strength (α,β)(\alpha,\beta), Wald’s approximations are A≈1−βαA\approx\frac{1-\beta}\alpha and B≈β1−αB\approx\frac\beta{1-\alpha}.

Poisson case (θ1>θ0\theta_1>\theta_0). With Tn=∑i=1nxiT_n=\sum_{i=1}^nx_i, logλn=Tnlogθ1θ0−n(θ1−θ0).\log\lambda_n=T_n\log\frac{\theta_1}{\theta_0}-n(\theta_1-\theta_0). Continue sampling while logB+n(θ1−θ0)log(θ1/θ0)<Tn<logA+n(θ1−θ0)log(θ1/θ0).\frac{\log B+n(\theta_1-\theta_0)}{\log(\theta_1/\theta_0)}<T_n<\frac{\log A+n(\theta_1-\theta_0)}{\log(\theta_1/\theta_0)}. Accept H1H_1 when TnT_n reaches the upper line, and H0H_0 when it reaches the lower line. Both lines have slope θ1−θ0log(θ1/θ0)\frac{\theta_1-\theta_0}{\log(\theta_1/\theta_0)}.

OC function. L(θ)=Pθ(accept H0)≈Ah−1Ah−BhL(\theta)=P_\theta(\text{accept }H_0)\approx\dfrac{A^h-1}{A^h-B^h}, where h=h(θ)≠0h=h(\theta)\ne0 solves Eθ[(f(X;θ1)f(X;θ0))h]=1.E_\theta\Big[\Big(\frac{f(X;\theta_1)}{f(X;\theta_0)}\Big)^h\Big]=1 . For the Poisson, Eθ[(θ1θ0)hXe−h(θ1−θ0)]=exp{θ[(θ1θ0)h−1]−h(θ1−θ0)}=1,E_\theta\Big[\Big(\frac{\theta_1}{\theta_0}\Big)^{hX}e^{-h(\theta_1-\theta_0)}\Big]=\exp\Big\{\theta\Big[\Big(\frac{\theta_1}{\theta_0}\Big)^h-1\Big]-h(\theta_1-\theta_0)\Big\}=1, which gives θ(h)=h(θ1−θ0)(θ1/θ0)h−1.\theta(h)=\frac{h(\theta_1-\theta_0)}{(\theta_1/\theta_0)^h-1}. So the OC curve is traced by the points (θ(h),Ah−1Ah−Bh)\Big(\theta(h),\ \dfrac{A^h-1}{A^h-B^h}\Big) as hh runs over the real line. Check: h=1h=1 gives θ=θ0\theta=\theta_0 and L=1−αL=1-\alpha; h=−1h=-1 gives θ=θ1\theta=\theta_1 and L=βL=\beta.

✓ Derivation checked step by step Every step was checked: the log-likelihood ratio of a Poisson sample, the continuation band, and the OC function from E[(f₁/f₀)^h] = 1 (which gives θ₀ at h = 1 and θ₁ at h = −1).

↑ Back to the question list

Let X1,X2,… be a sequence of random variables from Bernoulli distribution with mean θ,0<θ<1. Derive SPRT for testing H0:θ=θ0 versus H1:θ=θ1=1−θ0,0<θ0<1. Also obtain expressions for OC function and ASN function.

2025 · Paper I · Q4a · 20 marks

Solution

SPRT. With θ1=1−θ0\theta_1=1-\theta_0, the log-likelihood ratio for one observation is z=xlogθ1θ0+(1−x)log1−θ11−θ0=xc−(1−x)c=(2x−1)c,c=log1−θ0θ0.z=x\log\frac{\theta_1}{\theta_0}+(1-x)\log\frac{1-\theta_1}{1-\theta_0}=x\,c-(1-x)\,c=(2x-1)c,\qquad c=\log\frac{1-\theta_0}{\theta_0}. With m=∑i=1nxim=\sum_{i=1}^nx_i, logλn=(2m−n)c\ \log\lambda_n=(2m-n)c.

Take θ0<12\theta_0<\frac12, so c>0c>0. With A=1−βαA=\frac{1-\beta}\alpha and B=β1−αB=\frac\beta{1-\alpha}:

  • accept H1H_1 if 2m−n≥logAc2m-n\ge\dfrac{\log A}c;
  • accept H0H_0 if 2m−n≤logBc2m-n\le\dfrac{\log B}c;
  • otherwise continue.

So the test simply watches the difference between the numbers of successes and failures.

OC function. Let r=1−θ0θ0r=\frac{1-\theta_0}{\theta_0}. The equation Eθ[(f1/f0)h]=1E_\theta[(f_1/f_0)^h]=1 is θrh+(1−θ)r−h=1⇒θ(h)=11+rh.\theta r^h+(1-\theta)r^{-h}=1\quad\Longrightarrow\quad\theta(h)=\frac1{1+r^h}. L(θ(h))=Ah−1Ah−Bh(h≠0),L(12)=logAlogA−logB(h=0).L(\theta(h))=\frac{A^h-1}{A^h-B^h}\qquad(h\ne0),\qquad L(\tfrac12)=\frac{\log A}{\log A-\log B}\ \ (h=0).

00.30.50.7100.51θP(accept H₀)OC: L(θ)
OC curve for θ₀ = 0.3, θ₁ = 0.7, α = β = 0.05 (Wald approximation). It passes through 1 − α at θ₀, ½ at θ = ½ (h = 0), and β at θ₁.

ASN function. By Wald’s equation, Eθ(N)Eθ(z)=Eθ(logλN)≈LlogB+(1−L)logAE_\theta(N)\,E_\theta(z)=E_\theta(\log\lambda_N)\approx L\log B+(1-L)\log A, with Eθ(z)=(2θ−1)cE_\theta(z)=(2\theta-1)c. So Eθ(N)≈L(θ)logB+{1−L(θ)}logA(2θ−1)c(θ≠12),E_\theta(N)\approx\frac{L(\theta)\log B+\{1-L(\theta)\}\log A}{(2\theta-1)c}\qquad(\theta\ne\tfrac12), E1/2(N)≈−logAlogBc2(using E(z2)=c2 at θ=12).E_{1/2}(N)\approx\frac{-\log A\,\log B}{c^2}\qquad(\text{using }E(z^2)=c^2\text{ at }\theta=\tfrac12).

Example: θ0=0.3\theta_0=0.3, α=β=0.05\alpha=\beta=0.05: c=0.847c=0.847, logA=2.944\log A=2.944. Wald’s approximations give E(N)≈7.8E(N)\approx7.8 at θ=0.3\theta=0.3 or 0.70.7, and 12.112.1 at θ=0.5\theta=0.5. Simulation gives 9.3 and 16.0, because the path overshoots the boundary.

✓ Checked by computer We checked the OC formula θ(h) = 1/(1 + rʰ) at h = 1, 0, −1, and simulated the SPRT for θ₀ = 0.3, α = β = 0.05 (20,000 runs). The acceptance probabilities were 0.967, 0.497, 0.033 against Wald’s 0.95, 0.5, 0.05, and the average sample sizes were a little above Wald’s values (because of overshoot).

↑ Back to the question list

Define Sequential Probability Ratio Test (SPRT) along with its operating characteristic function and average sample number. Determine SPRT for testing H0:θ=4 against H1:θ=5 in N(θ,1) with α=0.5 and β=0.2.

2023 · Paper I · Q3c · 15 marks

Solution

Note on the question. “α=0.5\alpha=0.5” is almost certainly a misprint for α=0.05\alpha=0.05: a test that wrongly rejects H0H_0 half the time is of no use. We solve with α=0.05\alpha=0.05, and also give the bounds for α=0.5\alpha=0.5.

SPRT. After each observation, compute λn=∏i=1nf(xi;θ1)/f(xi;θ0)\lambda_n=\prod_{i=1}^n f(x_i;\theta_1)/f(x_i;\theta_0). Accept H1H_1 if λn≥A\lambda_n\ge A, accept H0H_0 if λn≤B\lambda_n\le B, and otherwise continue. For strength (α,β)(\alpha,\beta), A=1−βαA=\frac{1-\beta}\alpha and B=β1−αB=\frac\beta{1-\alpha}.

OC function. L(θ)=Pθ(accept H0)≈Ah−1Ah−BhL(\theta)=P_\theta(\text{accept }H_0)\approx\frac{A^h-1}{A^h-B^h}, where h(θ)h(\theta) solves Eθ[(f1/f0)h]=1E_\theta[(f_1/f_0)^h]=1.

ASN function. Eθ(N)≈L(θ)logB+{1−L(θ)}logAEθ(z)E_\theta(N)\approx\dfrac{L(\theta)\log B+\{1-L(\theta)\}\log A}{E_\theta(z)}, with z=logf(X;θ1)f(X;θ0)z=\log\frac{f(X;\theta_1)}{f(X;\theta_0)}.

The normal case (θ0=4\theta_0=4, θ1=5\theta_1=5, σ=1\sigma=1). logλn=∑i=1n[(xi−4)2−(xi−5)2]/2=∑i=1nxi−4.5n.\log\lambda_n=\sum_{i=1}^n\Big[(x_i-4)^2-(x_i-5)^2\Big]\Big/2=\sum_{i=1}^nx_i-4.5n .

Bounds (α=0.05\alpha=0.05, β=0.2\beta=0.2): A=0.80.05=16,logA=2.773;B=0.20.95=0.2105,logB=−1.558.A=\frac{0.8}{0.05}=16,\quad\log A=2.773;\qquad B=\frac{0.2}{0.95}=0.2105,\quad\log B=-1.558 .

The test. Continue sampling while 4.5n−1.558<∑i=1nxi<4.5n+2.773.4.5n-1.558<\sum_{i=1}^nx_i<4.5n+2.773 .

  • Accept H1:θ=5H_1:\theta=5 as soon as ∑xi≥4.5n+2.773\sum x_i\ge4.5n+2.773.
  • Accept H0:θ=4H_0:\theta=4 as soon as ∑xi≤4.5n−1.558\sum x_i\le4.5n-1.558.

(With α=0.5\alpha=0.5 as printed: A=1.6A=1.6, B=0.4B=0.4, and the band is 4.5n−0.916<∑xi<4.5n+0.4704.5n-0.916<\sum x_i<4.5n+0.470.)

✓ Checked by computer We computed A = 16, B = 0.2105, log A = 2.773, log B = −1.558 for α = 0.05, β = 0.2 (and A = 1.6, B = 0.4 for α = 0.5 as printed).

↑ Back to the question list

Let a random variable X have exponential distribution with mean 1θ,θ>0. To test H0:θ=3 against H1:θ=2, construct sequential probability ratio test. Show that probability of terminating the test at the first stage when null hypothesis is true is 1−827(A−BAB), where B and A, B<A, are stopping bounds.

2022 · Paper I · Q2a · 20 marks

Solution

SPRT. f(x;θ)=θe−θxf(x;\theta)=\theta e^{-\theta x}. For one observation, λ1=f(x;2)f(x;3)=23ex,logλn=nlog23+∑i=1nxi.\lambda_1=\frac{f(x;2)}{f(x;3)}=\frac23e^{x},\qquad\log\lambda_n=n\log\frac23+\sum_{i=1}^nx_i . With bounds B<AB<A: accept H1H_1 if λn≥A\lambda_n\ge A, accept H0H_0 if λn≤B\lambda_n\le B, and otherwise continue. In terms of the sum, continue while logB+nlog32<∑i=1nxi<logA+nlog32.\log B+n\log\tfrac32<\sum_{i=1}^nx_i<\log A+n\log\tfrac32 .

Stopping at the first stage, under H0H_0 (XX exponential with rate 3, P(X>c)=e−3cP(X>c)=e^{-3c}). The test continues if B<23eX1<A⇔log3B2<X1<log3A2.B<\tfrac23e^{X_1}<A\iff\log\tfrac{3B}2<X_1<\log\tfrac{3A}2 . If B≥23B\ge\frac23 (so both limits are ≥0\ge0): P(continue)=e−3log(3B/2)−e−3log(3A/2)=827(1B3−1A3),P(\text{continue})=e^{-3\log(3B/2)}-e^{-3\log(3A/2)}=\frac8{27}\Big(\frac1{B^3}-\frac1{A^3}\Big), P(stop at stage 1∣H0)=1−827⋅A3−B3A3B3.P(\text{stop at stage 1}\mid H_0)=1-\frac8{27}\cdot\frac{A^3-B^3}{A^3B^3}.

Note on the question. The printed result has A−BAB\frac{A-B}{AB} where it should have A3−B3A3B3\frac{A^3-B^3}{A^3B^3}. The cubes come from the rate θ=3\theta=3 under H0H_0. (Our simulation confirms the cube form.) Also, if B<23B<\frac23, which is the usual case since B≈β1−αB\approx\frac\beta{1-\alpha}, then 23eX1>B\frac23e^{X_1}>B always: the test can never accept H0H_0 at the first stage, and P(stop at stage 1∣H0)=P(23eX1≥A)=(23A)3=827A3.P(\text{stop at stage 1}\mid H_0)=P\big(\tfrac23e^{X_1}\ge A\big)=\Big(\frac2{3A}\Big)^3=\frac8{27A^3}.

✓ Checked by computer We simulated the first stage under H₀ (rate 3, 10⁶ draws). For A = 5, B = 0.8 the stopping probability was 0.4234, against 1 − (8/27)(1/B³ − 1/A³) = 0.4237. The printed formula gives 0.689.

↑ Back to the question list

Let X and Y be two independent random variables following exponential distribution with mean 1λ and 1μ respectively, λ>0,μ>0. Suppose that (X1,X2,…,Xn) and (Y1,Y2,…,Yn) are sequences of observations on X and Y respectively. A random variable Ui is defined as Ui={1,if Xi≥Yi,i=1,2,…,n0,otherwise Construct Wald’s SPRT procedure based on Ui’s for testing H:λ=μ versus K:λ=2μ with strength (α,β).

2021 · Paper I · Q3a · 20 marks

Solution

Distribution of UiU_i. XX has rate λ\lambda and YY has rate μ\mu, so p=P(Ui=1)=P(Xi≥Yi)=∫0∞μe−μye−λydy=μλ+μ.p=P(U_i=1)=P(X_i\ge Y_i)=\int_0^\infty\mu e^{-\mu y}e^{-\lambda y}dy=\frac\mu{\lambda+\mu}.

  • Under H:λ=μH:\lambda=\mu: p0=12p_0=\frac12.
  • Under K:λ=2μK:\lambda=2\mu: p1=13p_1=\frac13.

So the UiU_i are Bernoulli, and the problem becomes testing p=12p=\frac12 against p=13p=\frac13, whatever the value of μ\mu.

SPRT. With m=∑i=1nUim=\sum_{i=1}^nU_i, logλn=mlogp1p0+(n−m)log1−p11−p0=mlog23+(n−m)log43=nlog43−mlog2.\log\lambda_n=m\log\frac{p_1}{p_0}+(n-m)\log\frac{1-p_1}{1-p_0}=m\log\frac23+(n-m)\log\frac43=n\log\frac43-m\log2 . With A=1−βαA=\frac{1-\beta}\alpha and B=β1−αB=\frac\beta{1-\alpha}, continue sampling while logB<nlog43−mlog2<logA\log B<n\log\frac43-m\log2<\log A, that is, while nlog(4/3)−logAlog2<m<nlog(4/3)−logBlog2.\frac{n\log(4/3)-\log A}{\log2}<m<\frac{n\log(4/3)-\log B}{\log2}.

Decision.

  • If m≤nlog(4/3)−logAlog2m\le\dfrac{n\log(4/3)-\log A}{\log2} (few cases with X≥YX\ge Y): stop and accept K:λ=2μK:\lambda=2\mu.
  • If m≥nlog(4/3)−logBlog2m\ge\dfrac{n\log(4/3)-\log B}{\log2}: stop and accept H:λ=μH:\lambda=\mu.

Numerically, both lines have slope log(4/3)log2=0.415\frac{\log(4/3)}{\log2}=0.415 in the (n,m)(n,m) plane.

✓ Checked by computer We checked by simulation that P(X ≥ Y) is 1/2 when λ = μ and 1/3 when λ = 2μ.

↑ Back to the question list

To test sequentially the hypothesis H0 for which the distribution is given by P(X=−1)=P(X=1)=P(X=2)=13 against the alternative H1 that is given by P(X=−1)=P(X=1)=14,P(X=2)=12 it is decided to continue sampling as long as −(n+12)<Sn<(n+22) where Sn=∑i=1nXi, and Xi’s are successive observations. Compute the probability under H0 and H1 that the procedure will terminate with the 2nd observation or earlier.

2020 · Paper I · Q4a · 20 marks

Solution

The rule. Continue while −n+12<Sn<n+22-\frac{n+1}2<S_n<\frac{n+2}2.

Stage 1 (−1<S1<1.5-1<S_1<1.5). S1=X1∈{−1,1,2}S_1=X_1\in\{-1,1,2\}. Only X1=1X_1=1 continues; X1=−1X_1=-1 or 22 stops.

Stage 2 (−1.5<S2<2-1.5<S_2<2). Starting from S1=1S_1=1, S2=1+X2∈{0,2,3}S_2=1+X_2\in\{0,2,3\}. Only X2=−1X_2=-1 continues; X2=1X_2=1 or 22 stops.

Probability of stopping at or before the 2nd observation. P=P(X1∈{−1,2})+P(X1=1)P(X2∈{1,2}).P=P(X_1\in\{-1,2\})+P(X_1=1)\,P(X_2\in\{1,2\}).

  • Under H0H_0: P=23+13⋅23=89=0.889\ P=\dfrac23+\dfrac13\cdot\dfrac23=\dfrac89=0.889.
  • Under H1H_1: P=(14+12)+14(14+12)=34+316=1516=0.9375\ P=\Big(\dfrac14+\dfrac12\Big)+\dfrac14\Big(\dfrac14+\dfrac12\Big)=\dfrac34+\dfrac3{16}=\dfrac{15}{16}=0.9375.

✓ Checked by computer We enumerated all outcomes of the first two observations exactly: the probabilities are 8/9 under H₀ and 15/16 under H₁.

↑ Back to the question list

(i) For testing a simple hypothesis H0:θ=θ0 against simple alternative H1:θ=θ1, prove that the Sequential Probability Ratio Test (SPRT) terminates with probability one. (ii) Let X1,X2,… be random observations from the Bernoulli distribution with P(X=1)=p and P(X=0)=1−p. Obtain a sequential probability ratio test for H0:p=p0 against H1:p=p1.

2018 · Paper I · Q4c · 15 marks

Solution

(i) The SPRT terminates with probability one.

Let Zi=logf(Xi;θ1)f(Xi;θ0)Z_i=\log\dfrac{f(X_i;\theta_1)}{f(X_i;\theta_0)}, i.i.d., and Sn=Z1+…+ZnS_n=Z_1+\dots+Z_n. The SPRT continues while b<Sn<ab<S_n<a, where a=logA>0>b=logBa=\log A>0>b=\log B. Let NN be the stopping time. Assumption: P(Z=0)<1P(Z=0)<1 (the two densities differ), under whichever distribution generates the data.

Step 1. Since P(Z≠0)>0P(Z\ne0)>0, there is δ>0\delta>0 with P(Z>δ)>0P(Z>\delta)>0 or P(Z<−δ)>0P(Z<-\delta)>0. Say P(Z>δ)=π>0P(Z>\delta)=\pi>0 (the other case is the same). Choose an integer rr with rδ>a−br\delta>a-b.

Step 2. Split the observations into blocks of rr. For block jj, let Wj=Z(j−1)r+1+…+ZjrW_j=Z_{(j-1)r+1}+\dots+Z_{jr}. Then q=P(Wj>a−b)≥P(all r of the Z’s in the block exceed δ)=πr>0.q=P(W_j>a-b)\ge P(\text{all }r\text{ of the }Z\text{'s in the block exceed }\delta)=\pi^r>0 .

Step 3. If N>krN>kr, then every partial sum up to krkr stayed inside (b,a)(b,a), an interval of length a−ba-b. So no block sum among the first kk blocks can exceed a−ba-b. The blocks are independent, so P(N>kr)≤(1−q)k→0as k→∞.P(N>kr)\le(1-q)^k\to0\quad\text{as }k\to\infty .

Hence P(N<∞)=1P(N<\infty)=1. Moreover, P(N>n)P(N>n) decreases geometrically, so NN has finite moments of all orders. ◼\blacksquare

(ii) SPRT for Bernoulli pp. With m=∑i=1nxim=\sum_{i=1}^nx_i, logλn=mlogp1p0+(n−m)log1−p11−p0.\log\lambda_n=m\log\frac{p_1}{p_0}+(n-m)\log\frac{1-p_1}{1-p_0}. Take p1>p0p_1>p_0, and let g1=logp1p0>0,g2=log1−p01−p1>0.g_1=\log\frac{p_1}{p_0}>0,\qquad g_2=\log\frac{1-p_0}{1-p_1}>0 . Then logλn=m(g1+g2)−ng2\log\lambda_n=m(g_1+g_2)-ng_2. With A=1−βαA=\frac{1-\beta}\alpha and B=β1−αB=\frac\beta{1-\alpha}, continue while logB+ng2g1+g2<m<logA+ng2g1+g2.\frac{\log B+ng_2}{g_1+g_2}<m<\frac{\log A+ng_2}{g_1+g_2}. Accept H1:p=p1H_1:p=p_1 when mm reaches the upper line, and H0:p=p0H_0:p=p_0 when it reaches the lower line. Both lines have slope g2g1+g2\frac{g_2}{g_1+g_2}, which lies between p0p_0 and p1p_1.

✓ Proof checked step by step Every step was checked: (i) the block argument gives P(N > kr) ≤ (1 − q)ᵏ → 0; (ii) the Bernoulli log-likelihood ratio and the linear continuation band.

↑ Back to the question list

Derive the sequential probability ratio test (SPRT) for variance of a normal population when mean is known.

2016 · Paper I · Q4a · 20 marks

Solution

Set-up. X∼N(μ,σ2)X\sim N(\mu,\sigma^2) with μ\mu known. Test H0:σ2=σ02H_0:\sigma^2=\sigma_0^2 against H1:σ2=σ12H_1:\sigma^2=\sigma_1^2, with σ1>σ0\sigma_1>\sigma_0.

Log-likelihood ratio. With Qn=∑i=1n(xi−μ)2Q_n=\sum_{i=1}^n(x_i-\mu)^2, logλn=nlogσ0σ1+Qn2(1σ02−1σ12).\log\lambda_n=n\log\frac{\sigma_0}{\sigma_1}+\frac{Q_n}2\Big(\frac1{\sigma_0^2}-\frac1{\sigma_1^2}\Big).

SPRT. Let A=1−βαA=\frac{1-\beta}\alpha, B=β1−αB=\frac\beta{1-\alpha}, and k=12(1σ02−1σ12)>0k=\frac12\Big(\frac1{\sigma_0^2}-\frac1{\sigma_1^2}\Big)>0. Continue sampling while logB+nlog(σ1/σ0)k<∑i=1n(xi−μ)2<logA+nlog(σ1/σ0)k.\frac{\log B+n\log(\sigma_1/\sigma_0)}k<\sum_{i=1}^n(x_i-\mu)^2<\frac{\log A+n\log(\sigma_1/\sigma_0)}k .

  • Accept H1H_1 (larger variance) when QnQ_n reaches the upper line.
  • Accept H0H_0 when QnQ_n reaches the lower line.

Both lines have slope s=log(σ1/σ0)k=σ02σ12log(σ12/σ02)σ12−σ02,s=\frac{\log(\sigma_1/\sigma_0)}k=\frac{\sigma_0^2\sigma_1^2\log(\sigma_1^2/\sigma_0^2)}{\sigma_1^2-\sigma_0^2}, which lies between σ02\sigma_0^2 and σ12\sigma_1^2. So the test can be carried out graphically, plotting QnQ_n against nn.

OC function. Solving Eσ2[(f1/f0)h]=1E_{\sigma^2}[(f_1/f_0)^h]=1: (σ0σ1)h(1−2hkσ2)−1/2=1⇒σ2(h)=1−(σ0/σ1)2h2hk,\Big(\frac{\sigma_0}{\sigma_1}\Big)^h\Big(1-2hk\sigma^2\Big)^{-1/2}=1\quad\Longrightarrow\quad\sigma^2(h)=\frac{1-(\sigma_0/\sigma_1)^{2h}}{2hk}, and L(σ2(h))=Ah−1Ah−BhL(\sigma^2(h))=\frac{A^h-1}{A^h-B^h}. (At h=1h=1, σ2=σ02\sigma^2=\sigma_0^2; at h=−1h=-1, σ2=σ12\sigma^2=\sigma_1^2.)

ASN. E(z)=logσ0σ1+kσ2E(z)=\log\frac{\sigma_0}{\sigma_1}+k\sigma^2, and Eσ2(N)≈LlogB+(1−L)logAlog(σ0/σ1)+kσ2E_{\sigma^2}(N)\approx\dfrac{L\log B+(1-L)\log A}{\log(\sigma_0/\sigma_1)+k\sigma^2}.

✓ Derivation checked step by step Every step was checked: the normal log-likelihood ratio in Σ(x − μ)², the continuation band, and the OC parameter σ²(h).

↑ Back to the question list

Consider observations from Poisson distribution with parameter λ. Develop a Sequential Probability Ratio Test (SPRT) to test H0:λ=λ0 against H1:λ=kλ0, k>1. Obtain OC and ASN functions.

2015 · Paper I · Q4c · 15 marks

Solution

SPRT. With Tn=∑i=1nxiT_n=\sum_{i=1}^nx_i, logλn=Tnlogk−nλ0(k−1).\log\lambda_n=T_n\log k-n\lambda_0(k-1). Let A=1−βαA=\frac{1-\beta}\alpha and B=β1−αB=\frac\beta{1-\alpha}. Continue sampling while logB+nλ0(k−1)logk<Tn<logA+nλ0(k−1)logk.\frac{\log B+n\lambda_0(k-1)}{\log k}<T_n<\frac{\log A+n\lambda_0(k-1)}{\log k}. Accept H1:λ=kλ0H_1:\lambda=k\lambda_0 at the upper line, and H0H_0 at the lower line.

OC function. Solve Eλ[(kXe−λ0(k−1))h]=1E_\lambda\big[(k^Xe^{-\lambda_0(k-1)})^h\big]=1: exp{λ(kh−1)−hλ0(k−1)}=1⇒λ(h)=hλ0(k−1)kh−1.\exp\big\{\lambda(k^h-1)-h\lambda_0(k-1)\big\}=1\quad\Longrightarrow\quad\lambda(h)=\frac{h\lambda_0(k-1)}{k^h-1}. L(λ(h))=Ah−1Ah−Bh.L(\lambda(h))=\frac{A^h-1}{A^h-B^h}. As hh runs over the real line, (λ(h),L)\big(\lambda(h),L\big) traces the OC curve. At h=1h=1: λ=λ0\lambda=\lambda_0, L=1−αL=1-\alpha. At h=−1h=-1: λ=kλ0\lambda=k\lambda_0, L=βL=\beta. At h=0h=0: λ=λ0(k−1)logk\lambda=\frac{\lambda_0(k-1)}{\log k}, L=logAlogA−logBL=\frac{\log A}{\log A-\log B}.

ASN function. Eλ(z)=λlogk−λ0(k−1)E_\lambda(z)=\lambda\log k-\lambda_0(k-1), so Eλ(N)≈L(λ)logB+{1−L(λ)}logAλlogk−λ0(k−1).E_\lambda(N)\approx\frac{L(\lambda)\log B+\{1-L(\lambda)\}\log A}{\lambda\log k-\lambda_0(k-1)}. At λ=λ0(k−1)logk\lambda=\frac{\lambda_0(k-1)}{\log k}, where E(z)=0E(z)=0: E(N)≈−logAlogBE(z2)=−logAlogBλ(logk)2E(N)\approx\dfrac{-\log A\log B}{E(z^2)}=\dfrac{-\log A\log B}{\lambda(\log k)^2}.

✓ Checked by computer We checked the OC parameter λ(h) = hλ₀(k − 1)/(kʰ − 1): it equals λ₀ at h = 1 and kλ₀ at h = −1 (λ₀ = 2, k = 2 gives 2 and 4).

↑ Back to the question list

Prove the following results: (i) A sequential probability ratio test (SPRT) always terminates with probability one. (ii) For a SPRT with Z=logf(x∣H1)f(x∣H0) such that Pr{|Z|>0∣H}>0, then prove that EH{etSN[M(t)]−N}=1 when SN=∑i=1NZi.

2014 · Paper I · Q4b · 15 marks

Solution

Set-up. Zi=logf(Xi∣H1)f(Xi∣H0)Z_i=\log\frac{f(X_i\mid H_1)}{f(X_i\mid H_0)} are i.i.d. under the true distribution HH, with PH(|Z|>0)>0P_H(|Z|>0)>0. Sn=∑i=1nZiS_n=\sum_{i=1}^nZ_i, and the SPRT stops at the first nn with Sn∉(b,a)S_n\notin(b,a), b<0<ab<0<a.

(i) Termination with probability one. Since P(|Z|>0)>0P(|Z|>0)>0, there are δ>0\delta>0 and π>0\pi>0 with P(Z>δ)≥πP(Z>\delta)\ge\pi (or P(Z<−δ)≥πP(Z<-\delta)\ge\pi; the argument is the same). Take rr with rδ>a−br\delta>a-b. In each block of rr consecutive observations, the block sum exceeds a−ba-b with probability q≥πr>0q\ge\pi^r>0. If the test has not stopped by n=krn=kr, none of the first kk block sums can have exceeded a−ba-b. So P(N>kr)≤(1−q)k→0.P(N>kr)\le(1-q)^k\to0 . Hence P(N<∞)=1P(N<\infty)=1, and P(N>n)≤CρnP(N>n)\le C\rho^n for some ρ<1\rho<1. ◼\blacksquare

(ii) Wald’s fundamental identity. Let M(t)=EH(etZ)M(t)=E_H(e^{tZ}), finite for tt in an interval. Claim: for such tt with M(t)≥1M(t)\ge1, EH{etSN[M(t)]−N}=1.E_H\big\{e^{tS_N}[M(t)]^{-N}\big\}=1 .

Step 1: a martingale. Let Yn=etSnM(t)−nY_n=e^{tS_n}M(t)^{-n}, with Y0=1Y_0=1. Since Zn+1Z_{n+1} is independent of the past, E(Yn+1∣Z1,…,Zn)=Yn⋅E(etZn+1)M(t)=Yn.E(Y_{n+1}\mid Z_1,\dots,Z_n)=Y_n\cdot\frac{E(e^{tZ_{n+1}})}{M(t)}=Y_n . So {Yn}\{Y_n\} is a martingale with E(Yn)=1E(Y_n)=1.

Step 2: stop at min(N,n)\min(N,n). NN is a stopping time, so by the optional stopping theorem for bounded times, E(Ymin(N,n))=1for every n,E\big(Y_{\min(N,n)}\big)=1\quad\text{for every }n, that is, E(YNI(N≤n))+E(YnI(N>n))=1.E\big(Y_NI(N\le n)\big)+E\big(Y_nI(N>n)\big)=1 .

Step 3: the remainder vanishes. On {N>n}\{N>n\}, b<Sn<ab<S_n<a, so etSn≤e|t|max(a,|b|)=C′e^{tS_n}\le e^{|t|\max(a,|b|)}=C'. With M(t)≥1M(t)\ge1, E(YnI(N>n))≤C′P(N>n)→0,E\big(Y_nI(N>n)\big)\le C'\,P(N>n)\to0, by part (i).

Step 4: the limit. By monotone convergence, E(YNI(N≤n))→E(YN)E(Y_NI(N\le n))\to E(Y_N), since N<∞N<\infty almost surely. Hence EH{etSN[M(t)]−N}=1.◼E_H\big\{e^{tS_N}[M(t)]^{-N}\big\}=1 .\qquad\blacksquare

Differentiating the identity at t=0t=0 gives Wald’s equation E(SN)=E(N)E(Z)E(S_N)=E(N)E(Z), the basis of the ASN formula.

✓ Proof checked step by step Every step was checked: (i) the block argument for termination; (ii) the martingale e{tS_n}M(t){−n} and the optional stopping argument justified by the geometric tail of N.

↑ Back to the question list

Let N be the number of observations required by the sequential probability ratio test (SPRT) for testing H0:X∼f(x,θ0) against H1:X∼f(x,θ1), θ1≠θ0. Stating appropriate assumptions, show that P(N<∞)=1 at θ=θ0,θ1. When X∼N(θ,1), for testing H0:θ=0 against H1:θ=1, derive the expression of the percentage saving in sample sizes under H0 based on SPRT over the fixed sample size based MP test. Take the strength of each procedure as (α,β).

2013 · Paper I · Q4a · 20 marks

Solution

P(N<∞)=1P(N<\infty)=1.

Assumption: Z=logf(X,θ1)f(X,θ0)Z=\log\frac{f(X,\theta_1)}{f(X,\theta_0)} satisfies Pθ(Z=0)<1P_\theta(Z=0)<1 for θ=θ0,θ1\theta=\theta_0,\theta_1. This holds whenever f(⋅,θ0)f(\cdot,\theta_0) and f(⋅,θ1)f(\cdot,\theta_1) are different densities.

Proof. Let Sn=∑i≤nZiS_n=\sum_{i\le n}Z_i. The SPRT continues while logB<Sn<logA\log B<S_n<\log A. Choose δ>0\delta>0 with P(|Z|>δ)>0P(|Z|>\delta)>0. Then, say, P(Z>δ)=π>0P(Z>\delta)=\pi>0. Choose rr with rδ>logA−logBr\delta>\log A-\log B. Each block of rr observations has a block sum exceeding logA−logB\log A-\log B with probability at least q=πrq=\pi^r. Continuing beyond krkr observations requires none of the first kk independent blocks to do so: P(N>kr)≤(1−q)k→0.P(N>kr)\le(1-q)^k\to0 . So P(N<∞)=1P(N<\infty)=1, at both θ0\theta_0 and θ1\theta_1. ◼\blacksquare

Saving in sample size for N(θ,1)N(\theta,1), θ0=0\theta_0=0, θ1=1\theta_1=1.

Fixed-sample MP test. It rejects H0H_0 if x‾>c\bar x>c. Size α\alpha and power 1−β1-\beta need c=zαn,1−zβn=c⇒n=(zα+zβ)2.c=\frac{z_\alpha}{\sqrt n},\qquad1-\frac{z_\beta}{\sqrt n}=c\quad\Longrightarrow\quad n=(z_\alpha+z_\beta)^2 .

SPRT. z=x−12z=x-\frac12, so E0(z)=−12E_0(z)=-\frac12. With A=1−βαA=\frac{1-\beta}\alpha and B=β1−αB=\frac\beta{1-\alpha}, and L(θ0)=1−αL(\theta_0)=1-\alpha, Wald’s equation gives E0(N)≈(1−α)logB+αlogA−1/2=2[(1−α)log1−αβ−αlog1−βα].E_0(N)\approx\frac{(1-\alpha)\log B+\alpha\log A}{-1/2}=2\Big[(1-\alpha)\log\frac{1-\alpha}\beta-\alpha\log\frac{1-\beta}\alpha\Big].

Percentage saving under H0H_0: 100(1−E0(N)n)=100[1−2[(1−α)log1−αβ−αlog1−βα](zα+zβ)2]%.100\Big(1-\frac{E_0(N)}n\Big)=100\left[1-\frac{2\big[(1-\alpha)\log\frac{1-\alpha}\beta-\alpha\log\frac{1-\beta}\alpha\big]}{(z_\alpha+z_\beta)^2}\right]\%.

(α,β)(\alpha,\beta) nn E0(N)E_0(N) Saving
(0.05, 0.05) 10.82 5.30 51%
(0.05, 0.10) 8.56 3.99 53%
(0.01, 0.05) 15.77 5.82 63%

The SPRT needs, on average, roughly half the observations of the equally strong fixed-sample test.

✓ Checked by computer We checked the termination argument step by step, and computed the savings: for α = β = 0.05, n = 10.82 and E₀(N) = 5.30, a 51% saving.

↑ Back to the question list

Comment on the validity of the statement “the S.P.R.T. terminates with probability one”. For the geometric distribution with parameter p, derive the S.P.R.T. for testing H0:p=p0 against H1:p=p1. Also obtain the O.C. function.

2012 · Paper I · Q4a · 20 marks

Solution

“The SPRT terminates with probability one.” This is true, under a mild condition: the log-likelihood ratio Z=logf1(X)f0(X)Z=\log\frac{f_1(X)}{f_0(X)} must not be 0 with probability 1, that is, f0f_0 and f1f_1 must be different distributions. Then, whatever the true distribution (not only H0H_0 or H1H_1), P(N<∞)=1P(N<\infty)=1, and NN even has finite moments of all orders. (Proof: blocks of rr observations each have a fixed positive chance of a jump larger than the width of the continuation band, so P(N>kr)≤(1−q)k→0P(N>kr)\le(1-q)^k\to0.) If P(Z=0)=1P(Z=0)=1, the statement fails: logλn\log\lambda_n stays at 0 and sampling never stops.

SPRT for the geometric distribution. P(X=x)=pqxP(X=x)=pq^x, x=0,1,2,…x=0,1,2,\dots (q=1−pq=1-p). With Tn=∑xiT_n=\sum x_i, logλn=nlogp1p0+Tnlogq1q0.\log\lambda_n=n\log\frac{p_1}{p_0}+T_n\log\frac{q_1}{q_0}. Take p1<p0p_1<p_0 (so q1>q0q_1>q_0). Let A=1−βαA=\frac{1-\beta}\alpha and B=β1−αB=\frac\beta{1-\alpha}. Continue while logB+nlog(p0/p1)log(q1/q0)<Tn<logA+nlog(p0/p1)log(q1/q0).\frac{\log B+n\log(p_0/p_1)}{\log(q_1/q_0)}<T_n<\frac{\log A+n\log(p_0/p_1)}{\log(q_1/q_0)}. Accept H1:p=p1H_1:p=p_1 when TnT_n reaches the upper line; accept H0:p=p0H_0:p=p_0 at the lower line. (If p1>p0p_1>p_0, the inequalities reverse.)

OC function. Solve Ep[(f1/f0)h]=1E_p[(f_1/f_0)^h]=1: ∑x=0∞pqx(p1p0)h(q1q0)hx=p(p1/p0)h1−q(q1/q0)h=1.\sum_{x=0}^\infty pq^x\Big(\frac{p_1}{p_0}\Big)^h\Big(\frac{q_1}{q_0}\Big)^{hx}=\frac{p(p_1/p_0)^h}{1-q(q_1/q_0)^h}=1 . p(h)=1−(q1/q0)h(p1/p0)h−(q1/q0)h,L(p(h))=Ah−1Ah−Bh.p(h)=\frac{1-(q_1/q_0)^h}{(p_1/p_0)^h-(q_1/q_0)^h},\qquad L(p(h))=\frac{A^h-1}{A^h-B^h}. At h=1h=1, p=p0p=p_0 and L=1−αL=1-\alpha. At h=−1h=-1, p=p1p=p_1 and L=βL=\beta.

✓ Derivation checked step by step Every step was checked: the geometric log-likelihood ratio, the continuation band, and the OC parameter p(h), which gives p₀ at h = 1 and p₁ at h = −1.

↑ Back to the question list

Define Wald’s SPRT of strength (α,β) for a simple hypothesis against a simple alternative. Derive the SPRT procedure of strength (α,β) for H0:μ=μ0 against H1:μ=μ1, based on successive observations from N(μ,σ2), σ2 known. Indicate how the test can be carried out graphically.

2011 · Paper I · Q4b · 20 marks

Solution

Wald’s SPRT of strength (α,β)(\alpha,\beta). To test H0:θ=θ0H_0:\theta=\theta_0 against H1:θ=θ1H_1:\theta=\theta_1, observe X1,X2,…X_1,X_2,\dots one at a time. After nn observations compute λn=∏i=1nf(xi;θ1)/f(xi;θ0)\lambda_n=\prod_{i=1}^nf(x_i;\theta_1)/f(x_i;\theta_0), and:

  • accept H1H_1 if λn≥A\lambda_n\ge A;
  • accept H0H_0 if λn≤B\lambda_n\le B;
  • otherwise continue.

The constants AA and BB are chosen so that P(reject H0∣H0)=αP(\text{reject }H_0\mid H_0)=\alpha and P(accept H0∣H1)=βP(\text{accept }H_0\mid H_1)=\beta. In practice, A=1−βαA=\frac{1-\beta}\alpha and B=β1−αB=\frac\beta{1-\alpha}.

Normal mean, σ2\sigma^2 known (μ1>μ0\mu_1>\mu_0). logλn=μ1−μ0σ2∑i=1nxi−n(μ12−μ02)2σ2.\log\lambda_n=\frac{\mu_1-\mu_0}{\sigma^2}\sum_{i=1}^nx_i-\frac{n(\mu_1^2-\mu_0^2)}{2\sigma^2}. Continue sampling while σ2logBμ1−μ0+nμ0+μ12⏟lower line an<∑i=1nxi<σ2logAμ1−μ0+nμ0+μ12⏟upper line rn.\underbrace{\frac{\sigma^2\log B}{\mu_1-\mu_0}+n\,\frac{\mu_0+\mu_1}2}_{\text{lower line }a_n}\ <\ \sum_{i=1}^nx_i\ <\ \underbrace{\frac{\sigma^2\log A}{\mu_1-\mu_0}+n\,\frac{\mu_0+\mu_1}2}_{\text{upper line }r_n}.

  • Accept H1H_1 as soon as ∑xi≥rn\sum x_i\ge r_n.
  • Accept H0H_0 as soon as ∑xi≤an\sum x_i\le a_n.

Graphical procedure.

  1. Take nn on the horizontal axis and ∑i=1nxi\sum_{i=1}^nx_i on the vertical axis.
  2. Draw two parallel straight lines with common slope μ0+μ12\frac{\mu_0+\mu_1}2 and intercepts σ2logAμ1−μ0>0\frac{\sigma^2\log A}{\mu_1-\mu_0}>0 (upper) and σ2logBμ1−μ0<0\frac{\sigma^2\log B}{\mu_1-\mu_0}<0 (lower).
  3. After each observation, plot the point (n,∑xi)(n,\sum x_i).
  4. Continue while the point is between the lines. Stop and accept H1H_1 when it reaches or crosses the upper line, or accept H0H_0 when it reaches or crosses the lower line.
05101520-404812n (observations so far)Σ xᵢcontinue samplingupper line: accept H₁lower line: accept H₀Σx (one sample path)
μ₀ = 0, μ₁ = 1, σ = 1, α = β = 0.05. The lines are Σx = n/2 ± 2.944 (slope (μ₀+μ₁)/2). We plot Σx after each observation and stop when the path leaves the band; this path crosses the upper line at n = 10.

(If μ1<μ0\mu_1<\mu_0, the inequalities reverse: crossing the lower line then favours H1H_1.)

✓ Derivation checked step by step Every step was checked: the normal log-likelihood ratio, the two parallel lines, and the plotted example with μ₀ = 0, μ₁ = 1, σ = 1, α = β = 0.05.

↑ Back to the question list

Cover of the UPSC Mains Topic-wise and Year-wise PYQs book (2013–2026)

From the Optional Province team

Strengthen your GS papers

Our UPSC Mains Topic-wise & Year-wise PYQ Book (2013–2026) maps every GS question to the syllabus, so you know what UPSC asks and how often. Now available as a hard copy and an eBook.

Buy Hard Copy on AmazonBuy eBook (PDF)

Download a free sample

State and prove Wald’s fundamental identity of sequential analysis.

2010 · Paper I · Q3c · 20 marks

Solution

Statement (Wald’s fundamental identity). Let Z1,Z2,…Z_1,Z_2,\dots be i.i.d. with P(Z=0)<1P(Z=0)<1 and moment generating function M(t)=E(etZ)M(t)=E(e^{tZ}). Let Sn=Z1+…+ZnS_n=Z_1+\dots+Z_n, and let NN be the first nn with Sn∉(b,a)S_n\notin(b,a), b<0<ab<0<a (the SPRT stopping time). Then, for every real tt with M(t)M(t) finite and M(t)≥1M(t)\ge1, E{etSN[M(t)]−N}=1.E\Big\{e^{tS_N}\,[M(t)]^{-N}\Big\}=1 .

Proof.

Step 1: N<∞N<\infty and has a geometric tail. Since P(Z≠0)>0P(Z\ne0)>0, choose δ>0\delta>0 and rr with P(Z>δ)=π>0P(Z>\delta)=\pi>0 (or Z<−δZ<-\delta) and rδ>a−br\delta>a-b. Any block of rr consecutive ZZ’s has sum above a−ba-b with probability at least πr=q\pi^r=q. If N>krN>kr, none of the first kk blocks did so. So P(N>kr)≤(1−q)kP(N>kr)\le(1-q)^k. Hence P(N<∞)=1P(N<\infty)=1.

Step 2: a martingale. Let Yn=etSnM(t)−nY_n=e^{tS_n}M(t)^{-n}, Y0=1Y_0=1. Then E(Yn+1∣Z1,…,Zn)=YnEetZn+1M(t)=Yn,E(Y_{n+1}\mid Z_1,\dots,Z_n)=Y_n\,\frac{E e^{tZ_{n+1}}}{M(t)}=Y_n, so {Yn}\{Y_n\} is a martingale with mean 1.

Step 3: optional stopping at a bounded time. min(N,n)\min(N,n) is a bounded stopping time, so EYmin(N,n)=1E\,Y_{\min(N,n)}=1: E[YNI(N≤n)]+E[YnI(N>n)]=1.E\big[Y_N\,I(N\le n)\big]+E\big[Y_n\,I(N>n)\big]=1 .

Step 4: let n→∞n\to\infty. On {N>n}\{N>n\}, b<Sn<ab<S_n<a, so Yn≤e|t|max(a,−b)M(t)−n≤e|t|max(a,−b)Y_n\le e^{|t|\max(a,-b)}M(t)^{-n}\le e^{|t|\max(a,-b)} (as M(t)≥1M(t)\ge1). Therefore E[YnI(N>n)]≤e|t|max(a,−b)P(N>n)→0.E\big[Y_nI(N>n)\big]\le e^{|t|\max(a,-b)}P(N>n)\to0 . And E[YNI(N≤n)]↑E[YN]E[Y_NI(N\le n)]\uparrow E[Y_N] by monotone convergence, since N<∞N<\infty. Hence E(YN)=1E(Y_N)=1. ◼\blacksquare

Uses.

  • At h≠0h\ne0 with M(h)=1M(h)=1, the identity gives E(ehSN)=1E(e^{hS_N})=1. Ignoring overshoot (SN≈logAS_N\approx\log A or logB\log B), this gives the OC function: LBh+(1−L)Ah≈1L\,B^h+(1-L)A^h\approx1, so L≈Ah−1Ah−BhL\approx\frac{A^h-1}{A^h-B^h}.
  • Differentiating at t=0t=0 gives Wald’s equation E(SN)=E(N)E(Z)E(S_N)=E(N)E(Z), hence the ASN formula E(N)≈LlogB+(1−L)logAE(Z)E(N)\approx\frac{L\log B+(1-L)\log A}{E(Z)}.

✓ Proof checked step by step Every step was checked: the martingale property of e{tS_n}M(t){−n}, optional stopping at min(N, n), and the vanishing of the remainder term using the boundedness of S_n before stopping.

↑ Back to the question list

Discuss how you would graphically perform the sequential probability ratio test for a simple hypothesis regarding the mean of a normal population with known standard deviation against a simple alternative.

2009 · Paper I · Q2c · 20 marks

Solution

Set-up. X∼N(μ,σ2)X\sim N(\mu,\sigma^2) with σ\sigma known. Test H0:μ=μ0H_0:\mu=\mu_0 against H1:μ=μ1H_1:\mu=\mu_1 (μ1>μ0\mu_1>\mu_0), with strength (α,β)(\alpha,\beta): A=1−βα,B=β1−α.A=\frac{1-\beta}\alpha,\qquad B=\frac\beta{1-\alpha}.

The SPRT in terms of ∑xi\sum x_i. logλn=μ1−μ0σ2[∑i=1nxi−nμ0+μ12].\log\lambda_n=\frac{\mu_1-\mu_0}{\sigma^2}\Big[\sum_{i=1}^nx_i-n\,\frac{\mu_0+\mu_1}2\Big]. So B<λn<AB<\lambda_n<A is equivalent to h0+sn<∑i=1nxi<h1+sn,h_0+sn<\sum_{i=1}^nx_i<h_1+sn, with s=μ0+μ12,h1=σ2logAμ1−μ0>0,h0=σ2logBμ1−μ0<0.s=\frac{\mu_0+\mu_1}2,\qquad h_1=\frac{\sigma^2\log A}{\mu_1-\mu_0}>0,\qquad h_0=\frac{\sigma^2\log B}{\mu_1-\mu_0}<0 .

Graphical procedure.

  1. On graph paper, mark the number of observations nn along the xx-axis and the cumulative total ∑i=1nxi\sum_{i=1}^nx_i along the yy-axis.
  2. Draw the acceptance line y=h0+sny=h_0+sn and the rejection line y=h1+sny=h_1+sn. They are parallel, with slope ss = the midpoint of μ0\mu_0 and μ1\mu_1.
  3. After each observation, plot the point (n,∑i=1nxi)\big(n,\sum_{i=1}^nx_i\big) and join it to the previous one.
  4. While the path stays between the lines, take another observation.
  5. The first time the path touches or crosses the upper line, stop and reject H0H_0 (accept μ=μ1\mu=\mu_1). If it touches or crosses the lower line, stop and accept H0H_0.
05101520-404812n (observations so far)Σ xᵢcontinue samplingupper line: accept H₁lower line: accept H₀Σx (one sample path)
μ₀ = 0, μ₁ = 1, σ = 1, α = β = 0.05. The lines are Σx = n/2 ± 2.944 (slope (μ₀+μ₁)/2). We plot Σx after each observation and stop when the path leaves the band; this path crosses the upper line at n = 10.

The band has constant vertical width h1−h0=σ2μ1−μ0logABh_1-h_0=\frac{\sigma^2}{\mu_1-\mu_0}\log\frac AB. It is narrower when the two means are far apart (relative to σ\sigma), so the test tends to stop sooner.

✓ Derivation checked step by step Every step was checked: the continuation band for the normal mean, the slope (μ₀ + μ₁)/2, the intercepts σ² log A/(μ₁ − μ₀) and σ² log B/(μ₁ − μ₀), and the plotted example.

↑ Back to the question list

Explain the difference between classical estimation and sequential estimation. Describe SPRT.

2007 · Paper I · Q1d · 12 marks

Solution

Classical vs sequential estimation.

Classical (fixed-sample) Sequential
Sample size fixed in advance, nn a random variable NN, decided by the data as they arrive
Procedure collect all nn observations, then estimate after each observation, decide whether to stop or continue
Precision variance depends on unknown parameters, so the precision achieved is not controlled sampling continues until the required precision is reached (for example, a confidence interval of given width)
Efficiency may waste observations when the answer is clear early on average fewer observations for the same accuracy
Example X‾\bar X from nn fixed observations Stein’s two-stage procedure; sampling until ∑xi\sum x_i reaches a target (inverse binomial sampling)

For example, a confidence interval of fixed width 2d2d for a normal mean with unknown σ\sigma is impossible with a fixed sample size, but possible sequentially (Stein’s two-stage method).

SPRT (Wald). To test H0:θ=θ0H_0:\theta=\theta_0 against H1:θ=θ1H_1:\theta=\theta_1:

  1. Fix constants 0<B<1<A0<B<1<A.
  2. After each observation, compute λn=∏i=1nf(xi;θ1)f(xi;θ0)\lambda_n=\prod_{i=1}^n\frac{f(x_i;\theta_1)}{f(x_i;\theta_0)}.
  3. If λn≥A\lambda_n\ge A, stop and accept H1H_1; if λn≤B\lambda_n\le B, stop and accept H0H_0; if B<λn<AB<\lambda_n<A, take one more observation.
  4. For strength (α,β)(\alpha,\beta), use A=1−βαA=\frac{1-\beta}\alpha and B=β1−αB=\frac\beta{1-\alpha}.

The SPRT terminates with probability one. Its performance is described by the OC function L(θ)≈Ah−1Ah−BhL(\theta)\approx\frac{A^h-1}{A^h-B^h} and the ASN function Eθ(N)≈LlogB+(1−L)logAEθ(Z)E_\theta(N)\approx\frac{L\log B+(1-L)\log A}{E_\theta(Z)}. On average it needs about half as many observations as the fixed-sample test of the same strength.

✓ Answer checked step by step Every point was checked against the standard description of sequential procedures and Wald’s SPRT.

↑ Back to the question list

Describe briefly the Wald’s sequential probability ratio test. If for the choice A=1−βα,B=β1−α the SPRT terminates with probability 1 and is of strength (α′,β′), then prove that α′≤α1−β,β′≤β1−α and (α′+β′)≤α+β

2006 · Paper I · Q4b · 20 marks

Solution

Wald’s SPRT. Observe X1,X2,…X_1,X_2,\dots one at a time. At stage nn, compute λn=∏i=1nf1(xi)/f0(xi)\lambda_n=\prod_{i=1}^nf_1(x_i)/f_0(x_i), stop and accept H1H_1 if λn≥A\lambda_n\ge A, stop and accept H0H_0 if λn≤B\lambda_n\le B, and otherwise continue.

Set-up. Let RnR_n be the set of sample points (x1,…,xn)(x_1,\dots,x_n) at which the test stops at stage nn and accepts H1H_1, and AnA_n the set where it stops at stage nn and accepts H0H_0. These are disjoint across nn. The test terminates with probability 1, so α′=∑nP0(Rn),1−β′=∑nP1(Rn),β′=∑nP1(An),1−α′=∑nP0(An).\alpha'=\sum_nP_0(R_n),\qquad1-\beta'=\sum_nP_1(R_n),\qquad\beta'=\sum_nP_1(A_n),\qquad1-\alpha'=\sum_nP_0(A_n).

Step 1. On RnR_n, ∏f1≥A∏f0\prod f_1\ge A\prod f_0. So 1−β′=∑n∫Rn∏f1≥A∑n∫Rn∏f0=Aα′.1-\beta'=\sum_n\int_{R_n}\prod f_1\ \ge\ A\sum_n\int_{R_n}\prod f_0=A\alpha' . With A=1−βαA=\frac{1-\beta}\alpha: α′α≤1−β′1−β≤11−β⇒α′≤α1−β.\frac{\alpha'}\alpha\le\frac{1-\beta'}{1-\beta}\le\frac1{1-\beta}\quad\Longrightarrow\quad\alpha'\le\frac\alpha{1-\beta}.

Step 2. On AnA_n, ∏f1≤B∏f0\prod f_1\le B\prod f_0. So β′=∑n∫An∏f1≤B∑n∫An∏f0=B(1−α′).\beta'=\sum_n\int_{A_n}\prod f_1\ \le\ B\sum_n\int_{A_n}\prod f_0=B(1-\alpha'). With B=β1−αB=\frac\beta{1-\alpha}: β′β≤1−α′1−α≤11−α⇒β′≤β1−α.\frac{\beta'}\beta\le\frac{1-\alpha'}{1-\alpha}\le\frac1{1-\alpha}\quad\Longrightarrow\quad\beta'\le\frac\beta{1-\alpha}.

Step 3. From Step 1, α′(1−β)≤α(1−β′)\alpha'(1-\beta)\le\alpha(1-\beta'). From Step 2, β′(1−α)≤β(1−α′)\beta'(1-\alpha)\le\beta(1-\alpha'). Adding: α′−α′β+β′−αβ′≤α−αβ′+β−α′β,\alpha'-\alpha'\beta+\beta'-\alpha\beta'\le\alpha-\alpha\beta'+\beta-\alpha'\beta, which simplifies to α′+β′≤α+β.◼\alpha'+\beta'\le\alpha+\beta .\qquad\blacksquare

Meaning. With Wald’s approximate bounds, one actual error probability may exceed its nominal value slightly (by at most a factor 11−β\frac1{1-\beta} or 11−α\frac1{1-\alpha}), but the total error α′+β′\alpha'+\beta' never exceeds α+β\alpha+\beta. For small α,β\alpha,\beta the approximation is very good.

✓ Proof checked step by step Every step was checked: the two inequalities from the decision regions, and their sum.

↑ Back to the question list

Briefly explain Wald’s SPRT. Also state its merits and disadvantages.

2005 · Paper I · Q4c · 20 marks

Solution

Wald’s SPRT. For testing a simple H0:θ=θ0H_0:\theta=\theta_0 against a simple H1:θ=θ1H_1:\theta=\theta_1, observations are taken one at a time. After the nn-th, compute the likelihood ratio λn=∏i=1nf(xi;θ1)f(xi;θ0).\lambda_n=\prod_{i=1}^n\frac{f(x_i;\theta_1)}{f(x_i;\theta_0)}.

  • λn≥A\lambda_n\ge A: stop, accept H1H_1.
  • λn≤B\lambda_n\le B: stop, accept H0H_0.
  • B<λn<AB<\lambda_n<A: continue.

For prescribed strength (α,β)(\alpha,\beta), Wald’s bounds are A=1−βαA=\frac{1-\beta}\alpha and B=β1−αB=\frac\beta{1-\alpha}. In practice we work with logλn=∑Zi\log\lambda_n=\sum Z_i, which for exponential families is a linear function of a sufficient statistic, giving two parallel straight lines.

Merits.

  1. Economy: on average it needs far fewer observations (often about half) than the fixed-sample test with the same α\alpha and β\beta.
  2. Optimality: among all tests (sequential or not) with error probabilities at most α,β\alpha,\beta, the SPRT minimises E(N)E(N) under both H0H_0 and H1H_1 (Wald–Wolfowitz).
  3. Simplicity: AA and BB depend only on α,β\alpha,\beta, not on the distribution. The test can be carried out graphically.
  4. Termination: it stops with probability 1, and NN has finite moments.
  5. Natural for sequential data: inspection of items as they come off a line, clinical trials, acceptance sampling.
  6. Control of both errors: both α\alpha and β\beta are fixed in advance.

Disadvantages.

  1. Random sample size: NN is not known in advance and can occasionally be very large, which makes planning (time, cost) difficult. Truncation is often needed.
  2. Simple hypotheses only: for composite hypotheses or parameters between θ0\theta_0 and θ1\theta_1, E(N)E(N) can be large (largest near the point where E(Z)=0E(Z)=0).
  3. Approximate bounds: α,β\alpha,\beta are only approximately attained because of overshoot.
  4. Practicality: observations must be available one at a time with quick feedback. Not suitable when measurements take a long time or must be made in batches.
  5. Estimation after testing is complicated by the random stopping.

✓ Answer checked step by step Every point was checked against the standard properties of Wald’s SPRT.

↑ Back to the question list

State and prove a result which shows that, compared to any other sequential test procedure, the SPRT has the least ASN.

2004 · Paper I · Q4b · 20 marks

Solution

Theorem (Wald–Wolfowitz optimality of the SPRT). Let S0S_0 be an SPRT for H0:f=f0H_0:f=f_0 against H1:f=f1H_1:f=f_1, with error probabilities α,β\alpha,\beta and average sample numbers E0(N)E_0(N), E1(N)E_1(N). Let SS be any other sequential (or fixed-sample) test with error probabilities α′≤α\alpha'\le\alpha and β′≤β\beta'\le\beta, and with E0(N′)E_0(N'), E1(N′)E_1(N') finite. Then E0(N)≤E0(N′)andE1(N)≤E1(N′).E_0(N)\le E_0(N')\qquad\text{and}\qquad E_1(N)\le E_1(N'). So, among all tests with the same (or smaller) error probabilities, the SPRT has the smallest ASN under both hypotheses.

Proof (outline of the Bayes argument).

Step 1: Bayes sequential problem. Put prior probabilities π\pi and 1−π1-\pi on H0H_0 and H1H_1. Let wrong decisions cost w0w_0 (rejecting H0H_0 when true) and w1w_1 (accepting H0H_0 when false), and let each observation cost cc. The Bayes risk of a test δ\delta is r(δ)=π[w0α(δ)+cE0(Nδ)]+(1−π)[w1β(δ)+cE1(Nδ)].r(\delta)=\pi\big[w_0\alpha(\delta)+cE_0(N_\delta)\big]+(1-\pi)\big[w_1\beta(\delta)+cE_1(N_\delta)\big].

Step 2: the Bayes procedure is an SPRT. After nn observations, the posterior probability of H0H_0 is a decreasing function of λn\lambda_n. The minimal posterior expected cost of stopping now, and the expected cost of continuing optimally, depend on the data only through this posterior. Comparing them (by dynamic programming), the optimal rule is: stop and accept H1H_1 when the posterior of H0H_0 is small enough, stop and accept H0H_0 when it is large enough, and continue in between. In terms of λn\lambda_n, this is exactly an SPRT with some bounds B′<1<A′B'<1<A'.

Step 3: matching the given SPRT. For the given bounds B<1<AB<1<A of S0S_0, and for every prior π∈(0,1)\pi\in(0,1) (with c=1c=1), one can choose costs w0,w1>0w_0,w_1>0 so that the Bayes procedure of Step 2 is S0S_0 itself. (This is the technical heart of the Wald–Wolfowitz proof; we quote it.)

Step 4: comparison. Fix π\pi and the matching costs. Since S0S_0 is Bayes, r(S)≥r(S0)r(S)\ge r(S_0): πw0(α′−α)+(1−π)w1(β′−β)+π[E0(N′)−E0(N)]+(1−π)[E1(N′)−E1(N)]≥0.\pi w_0(\alpha'-\alpha)+(1-\pi)w_1(\beta'-\beta)+\pi\big[E_0(N')-E_0(N)\big]+(1-\pi)\big[E_1(N')-E_1(N)\big]\ \ge\ 0 . The first two terms are ≤0\le0 (because α′≤α\alpha'\le\alpha and β′≤β\beta'\le\beta). So, for every π∈(0,1)\pi\in(0,1), π[E0(N′)−E0(N)]+(1−π)[E1(N′)−E1(N)]≥0.\pi\big[E_0(N')-E_0(N)\big]+(1-\pi)\big[E_1(N')-E_1(N)\big]\ \ge\ 0 . Letting π→1\pi\to1 gives E0(N)≤E0(N′)E_0(N)\le E_0(N'), and letting π→0\pi\to0 gives E1(N)≤E1(N′)E_1(N)\le E_1(N'). ◼\blacksquare

Remarks. The result is exact, not approximate. It does not say the SPRT minimises Eθ(N)E_\theta(N) for θ\theta between θ0\theta_0 and θ1\theta_1; there, other tests (such as truncated or Kiefer–Weiss procedures) can do better.

✓ Proof checked step by step Every step was checked: the Bayes-risk representation, the optimality of SPRTs as Bayes sequential procedures for suitable priors and costs, and the contradiction argument. The proof follows Wald and Wolfowitz (1948); the existence of the matching prior and cost is quoted.

↑ Back to the question list

If (α,β) is the strength of a Sequential Probability Ratio Test with boundary points (A, B), prove that A≤1−βα and B≥β1−α

2002 · Paper I · Q1f · 12 marks

Solution

Set-up. In the SPRT with bounds A>1>BA>1>B, let RnR_n be the set of (x1,…,xn)(x_1,\dots,x_n) where sampling stops at stage nn with λn≥A\lambda_n\ge A (reject H0H_0), and AnA_n the set where it stops with λn≤B\lambda_n\le B (accept H0H_0). The sets for different nn are disjoint. The test terminates with probability 1 under H0H_0 and H1H_1, so with strength (α,β)(\alpha,\beta): ∑nP0(Rn)=α,∑nP1(Rn)=1−β,∑nP0(An)=1−α,∑nP1(An)=β.\sum_nP_0(R_n)=\alpha,\quad\sum_nP_1(R_n)=1-\beta,\quad\sum_nP_0(A_n)=1-\alpha,\quad\sum_nP_1(A_n)=\beta .

A≤1−βαA\le\frac{1-\beta}\alpha. On RnR_n, p1n≥Ap0np_{1n}\ge A\,p_{0n}, where pjn=∏i≤nfj(xi)p_{jn}=\prod_{i\le n}f_j(x_i). Integrating over RnR_n and summing over nn: 1−β=∑n∫Rnp1n≥A∑n∫Rnp0n=Aα.1-\beta=\sum_n\int_{R_n}p_{1n}\ \ge\ A\sum_n\int_{R_n}p_{0n}=A\alpha . So A≤1−βαA\le\dfrac{1-\beta}\alpha.

B≥β1−αB\ge\frac\beta{1-\alpha}. On AnA_n, p1n≤Bp0np_{1n}\le B\,p_{0n}. So β=∑n∫Anp1n≤B∑n∫Anp0n=B(1−α).\beta=\sum_n\int_{A_n}p_{1n}\ \le\ B\sum_n\int_{A_n}p_{0n}=B(1-\alpha). So B≥β1−αB\ge\dfrac\beta{1-\alpha}. ◼\blacksquare

Consequence. The inequalities are not equalities only because λn\lambda_n can overshoot the bounds. Ignoring the overshoot, Wald took A=1−βαA=\frac{1-\beta}\alpha and B=β1−αB=\frac\beta{1-\alpha}. With these bounds the actual error probabilities α′,β′\alpha',\beta' satisfy α′≤α1−β\alpha'\le\frac\alpha{1-\beta}, β′≤β1−α\beta'\le\frac\beta{1-\alpha} and α′+β′≤α+β\alpha'+\beta'\le\alpha+\beta.

✓ Proof checked step by step Every step was checked: the inequalities come from integrating the stopping conditions over the decision regions, using termination with probability one.

↑ Back to the question list

(i) Obtain the probability generating function of the Poisson distribution. (ii) Write the probability mass function of the negative binomial distribution. (iii) Define a Uniformly Most Powerful Test (UMPT). (iv) Write the expression for ASN function in sequential probability ratio test (SPRT).

2001 · Paper I · Q1d · 12 marks

Solution

(i) PGF of the Poisson distribution. G(s)=E(sX)=∑x=0∞sxe−λλxx!=e−λeλs=eλ(s−1).G(s)=E(s^X)=\sum_{x=0}^\infty s^x\frac{e^{-\lambda}\lambda^x}{x!}=e^{-\lambda}e^{\lambda s}=e^{\lambda(s-1)}.

(ii) Negative binomial pmf. The number of failures XX before the rr-th success, with success probability pp (q=1−pq=1-p): P(X=x)=(x+r−1x)prqx,x=0,1,2,…P(X=x)=\binom{x+r-1}{x}p^rq^x,\qquad x=0,1,2,\dots

(iii) UMP test. A test ϕ*\phi^* of size α\alpha for H0:θ∈Θ0H_0:\theta\in\Theta_0 against H1:θ∈Θ1H_1:\theta\in\Theta_1 is uniformly most powerful if, for every other test ϕ\phi with supΘ0Eθϕ≤α\sup_{\Theta_0}E_\theta\phi\le\alpha, Eθϕ*≥Eθϕfor every θ∈Θ1.E_\theta\phi^*\ge E_\theta\phi\qquad\text{for every }\theta\in\Theta_1 .

(iv) ASN of the SPRT. With Z=logf(X;θ1)f(X;θ0)Z=\log\frac{f(X;\theta_1)}{f(X;\theta_0)} and OC function L(θ)L(\theta): Eθ(N)≈L(θ)logB+{1−L(θ)}logAEθ(Z),Eθ(Z)≠0.E_\theta(N)\approx\frac{L(\theta)\log B+\{1-L(\theta)\}\log A}{E_\theta(Z)},\qquad E_\theta(Z)\ne0 . In particular, Eθ0(N)≈(1−α)logB+αlogAEθ0(Z)E_{\theta_0}(N)\approx\dfrac{(1-\alpha)\log B+\alpha\log A}{E_{\theta_0}(Z)} and Eθ1(N)≈βlogB+(1−β)logAEθ1(Z)E_{\theta_1}(N)\approx\dfrac{\beta\log B+(1-\beta)\log A}{E_{\theta_1}(Z)}.

✓ Answer checked step by step Every item was checked against the standard definitions and formulas.

↑ Back to the question list

Let X1,X2,… be i.i.d. N(θ,1) random variables and suppose that we want to test H0:θ=θ0 against H1:θ=θ1(>θ0). Determine the size n of the fixed sample of the most powerful test of size-α and power 1−β. Determine also average sample number under H0Eθ0(N). of the SPRT of the same problem with strength (α,β)

2000 · Paper I · Q4c · 20 marks

Solution

Fixed-sample MP test. It rejects H0H_0 if x‾>c\bar x>c. Write Δ=θ1−θ0\Delta=\theta_1-\theta_0.

  • Size α\alpha: c=θ0+zαnc=\theta_0+\dfrac{z_\alpha}{\sqrt n}.
  • Power 1−β1-\beta: Pθ1(X‾>c)=1−β⇔c=θ1−zβnP_{\theta_1}(\bar X>c)=1-\beta\iff c=\theta_1-\dfrac{z_\beta}{\sqrt n}.

Equating the two expressions for cc: zα+zβn=Δ⇒n=(zα+zβθ1−θ0)2\frac{z_\alpha+z_\beta}{\sqrt n}=\Delta\quad\Longrightarrow\quad n=\Big(\frac{z_\alpha+z_\beta}{\theta_1-\theta_0}\Big)^2 (rounded up to an integer).

SPRT of strength (α,β)(\alpha,\beta). Z=logf(X;θ1)f(X;θ0)=Δ(X−θ0+θ12),Eθ0(Z)=−Δ22.Z=\log\frac{f(X;\theta_1)}{f(X;\theta_0)}=\Delta\Big(X-\frac{\theta_0+\theta_1}2\Big),\qquad E_{\theta_0}(Z)=-\frac{\Delta^2}2 . With A=1−βαA=\frac{1-\beta}\alpha, B=β1−αB=\frac\beta{1-\alpha} and L(θ0)=1−αL(\theta_0)=1-\alpha: Eθ0(N)≈(1−α)logB+αlogA−Δ2/2=2(θ1−θ0)2[(1−α)log1−αβ−αlog1−βα].E_{\theta_0}(N)\approx\frac{(1-\alpha)\log B+\alpha\log A}{-\Delta^2/2}=\frac2{(\theta_1-\theta_0)^2}\Big[(1-\alpha)\log\frac{1-\alpha}\beta-\alpha\log\frac{1-\beta}\alpha\Big].

Example (Δ=1\Delta=1, α=β=0.05\alpha=\beta=0.05): n=(1.645+1.645)2=10.82n=(1.645+1.645)^2=10.82, so n=11n=11, while Eθ0(N)=2×0.9×log19=5.30E_{\theta_0}(N)=2\times0.9\times\log19=5.30. The SPRT needs about half as many observations on average.

✓ Checked by computer We computed n and E₀(N) for several (α, β) in Python. For α = β = 0.05 and θ₁ − θ₀ = 1: n = 10.82 and E₀(N) = 5.30.

↑ Back to the question list

Prove that under certain conditions, to be stated, Wald’s PRT for testing a simple hypothesis against a simple alternative terminates with probability one.

1999 · Paper I · Q8a · 30 marks

Solution

Conditions.

  1. X1,X2,…X_1,X_2,\dots are i.i.d. (under whatever distribution is true).
  2. Z=logf(X;θ1)f(X;θ0)Z=\log\dfrac{f(X;\theta_1)}{f(X;\theta_0)} is not 0 with probability 1, that is, P(Z=0)<1P(Z=0)<1. (This holds when f0f_0 and f1f_1 are different densities.)
  3. The bounds are finite: 0<B<1<A<∞0<B<1<A<\infty.

Theorem. Under these conditions, the SPRT terminates with probability one: P(N<∞)=1P(N<\infty)=1. Moreover, P(N>n)≤CρnP(N>n)\le C\rho^n for some ρ<1\rho<1, so E(Nk)<∞E(N^k)<\infty for all kk.

Proof. Let Sn=Z1+…+ZnS_n=Z_1+\dots+Z_n, a=logA>0a=\log A>0 and b=logB<0b=\log B<0. The test continues while b<Sn<ab<S_n<a, an interval of length c=a−bc=a-b.

Step 1: a block with a big jump. By condition 2, there is δ>0\delta>0 with P(|Z|>δ)>0P(|Z|>\delta)>0. Suppose P(Z>δ)=π>0P(Z>\delta)=\pi>0 (if only P(Z<−δ)>0P(Z<-\delta)>0, use that instead). Choose an integer rr with rδ>cr\delta>c. For any block of rr consecutive observations, P(block sum>c)≥P(each Z in the block>δ)=πr=q>0.P(\text{block sum}>c)\ge P(\text{each }Z\text{ in the block}>\delta)=\pi^r=q>0 .

Step 2: such a jump forces stopping. If the walk is still inside (b,a)(b,a) at the start of a block, and the block sum exceeds cc, then the walk must leave (b,a)(b,a) during that block. So {N>kr}⊆{none of the first k block sums exceeds c}.\{N>kr\}\subseteq\{\text{none of the first }k\text{ block sums exceeds }c\}.

Step 3: geometric bound. The blocks are independent, so P(N>kr)≤(1−q)k→0(k→∞).P(N>kr)\le(1-q)^k\longrightarrow0\quad(k\to\infty). Hence P(N<∞)=1P(N<\infty)=1. Also P(N>n)≤(1−q)⌊n/r⌋P(N>n)\le(1-q)^{\lfloor n/r\rfloor}, a geometric tail, so all moments of NN are finite. ◼\blacksquare

(The result holds whatever the true distribution is, not only under H0H_0 or H1H_1, as long as condition 2 holds under it.)

✓ Proof checked step by step Every step was checked: the condition P(Z = 0) < 1, the choice of block length r, and the geometric bound on P(N > kr).

↑ Back to the question list

Consider a sequence of i.i.d variable with pdf f(x,θ)=θe−θx,x≥0,θ>0. Derive SPRT of strength (α,β) for testing H0:θ=θ0 against H1:θ=θ1. Also obtain its OC function.

1998 · Paper I · Q7c · 20 marks

Solution

SPRT. f(x;θ)=θe−θxf(x;\theta)=\theta e^{-\theta x}. With Tn=∑i=1nxiT_n=\sum_{i=1}^nx_i, logλn=nlogθ1θ0−(θ1−θ0)Tn.\log\lambda_n=n\log\frac{\theta_1}{\theta_0}-(\theta_1-\theta_0)T_n . Take θ1>θ0\theta_1>\theta_0. With A=1−βαA=\frac{1-\beta}\alpha and B=β1−αB=\frac\beta{1-\alpha}, continue sampling while logB<logλn<logA\log B<\log\lambda_n<\log A, that is, while nlog(θ1/θ0)−logAθ1−θ0<Tn<nlog(θ1/θ0)−logBθ1−θ0.\frac{n\log(\theta_1/\theta_0)-\log A}{\theta_1-\theta_0}<T_n<\frac{n\log(\theta_1/\theta_0)-\log B}{\theta_1-\theta_0}.

  • If TnT_n falls to the lower line (short lifetimes, high failure rate): accept H1:θ=θ1H_1:\theta=\theta_1.
  • If TnT_n rises to the upper line: accept H0:θ=θ0H_0:\theta=\theta_0.

(For θ1<θ0\theta_1<\theta_0, the inequalities reverse.)

OC function. Solve Eθ[(f1/f0)h]=1E_\theta[(f_1/f_0)^h]=1: (θ1θ0)h∫0∞θe−θxe−h(θ1−θ0)xdx=(θ1θ0)hθθ+h(θ1−θ0)=1,\Big(\frac{\theta_1}{\theta_0}\Big)^h\int_0^\infty\theta e^{-\theta x}e^{-h(\theta_1-\theta_0)x}dx=\Big(\frac{\theta_1}{\theta_0}\Big)^h\frac\theta{\theta+h(\theta_1-\theta_0)}=1, θ(h)=h(θ1−θ0)(θ1/θ0)h−1,L(θ(h))=Ah−1Ah−Bh.\theta(h)=\frac{h(\theta_1-\theta_0)}{(\theta_1/\theta_0)^h-1},\qquad L(\theta(h))=\frac{A^h-1}{A^h-B^h}. Plotting (θ(h),L)(\theta(h),L) for real hh gives the OC curve. At h=1h=1: θ0\theta_0 and 1−α1-\alpha. At h=−1h=-1: θ1\theta_1 and β\beta. At h→0h\to0: θ=θ1−θ0log(θ1/θ0)\theta=\frac{\theta_1-\theta_0}{\log(\theta_1/\theta_0)} and L=logAlogA−logBL=\frac{\log A}{\log A-\log B}.

✓ Derivation checked step by step Every step was checked: the exponential log-likelihood ratio, the continuation band, and the OC parameter θ(h), which gives θ₀ at h = 1 and θ₁ at h = −1.

↑ Back to the question list

Consider a sequence of i.i.d. N(μ,σ2) σ2 known, random variables. Derive SPRT of strength (α,β) for testing H0:μ=μ0 against H1:μ=μ1(<μ0). Also obtain its OC function.

1997 · Paper I · Q8b · 20 marks

Solution

SPRT. With μ1<μ0\mu_1<\mu_0 and Tn=∑xiT_n=\sum x_i, logλn=μ1−μ0σ2[Tn−nμ0+μ12].\log\lambda_n=\frac{\mu_1-\mu_0}{\sigma^2}\Big[T_n-n\frac{\mu_0+\mu_1}2\Big]. Since μ1−μ0<0\mu_1-\mu_0<0, dividing by it reverses the inequalities. With A=1−βαA=\frac{1-\beta}\alpha and B=β1−αB=\frac\beta{1-\alpha}, continue while nμ0+μ12−σ2logAμ0−μ1<Tn<nμ0+μ12−σ2logBμ0−μ1.n\frac{\mu_0+\mu_1}2-\frac{\sigma^2\log A}{\mu_0-\mu_1}<T_n<n\frac{\mu_0+\mu_1}2-\frac{\sigma^2\log B}{\mu_0-\mu_1}.

  • Accept H1:μ=μ1H_1:\mu=\mu_1 (smaller mean) when TnT_n reaches the lower line.
  • Accept H0:μ=μ0H_0:\mu=\mu_0 when TnT_n reaches the upper line.

OC function. Let Z=μ1−μ0σ2(X−μ0+μ12)Z=\frac{\mu_1-\mu_0}{\sigma^2}\big(X-\frac{\mu_0+\mu_1}2\big). Under N(μ,σ2)N(\mu,\sigma^2), ZZ is normal with mean μ1−μ0σ2(μ−μ0+μ12)\frac{\mu_1-\mu_0}{\sigma^2}\big(\mu-\frac{\mu_0+\mu_1}2\big) and variance (μ1−μ0)2σ2\frac{(\mu_1-\mu_0)^2}{\sigma^2}. The condition Eμ(ehZ)=1E_\mu(e^{hZ})=1 (with h≠0h\ne0) gives hμ1−μ0σ2(μ−μ0+μ12)+h2(μ1−μ0)22σ2=0⇒μ(h)=(1+h)μ0+(1−h)μ12.h\frac{\mu_1-\mu_0}{\sigma^2}\Big(\mu-\frac{\mu_0+\mu_1}2\Big)+\frac{h^2(\mu_1-\mu_0)^2}{2\sigma^2}=0\quad\Longrightarrow\quad\mu(h)=\frac{(1+h)\mu_0+(1-h)\mu_1}2 . Equivalently, h=μ0+μ1−2μμ1−μ0h=\dfrac{\mu_0+\mu_1-2\mu}{\mu_1-\mu_0}. Then L(μ)≈Ah−1Ah−Bh.L(\mu)\approx\frac{A^h-1}{A^h-B^h}. Check: μ=μ0\mu=\mu_0 gives h=1h=1 and L=1−αL=1-\alpha; μ=μ1\mu=\mu_1 gives h=−1h=-1 and L=βL=\beta; at μ=μ0+μ12\mu=\frac{\mu_0+\mu_1}2, L=logAlogA−logBL=\frac{\log A}{\log A-\log B}.

✓ Derivation checked step by step Every step was checked: the normal log-likelihood ratio with μ₁ < μ₀, the reversed continuation band, and the OC parameter μ(h) = [(1 + h)μ₀ + (1 − h)μ₁]/2.

↑ Back to the question list

Let the random variable X have the pmf fθ(x)=θx(1−θ)1−x, x=0,1 and 0<θ<1. Derive the SPR test of H0:θ=θ0 against H1:θ=θ1 [?]. Determine the OC function of the test.

1996 · Paper I · Q7b · 30 marks

Solution

Note on the question. The “[?]” is a stray mark in the source. We take θ1>θ0\theta_1>\theta_0.

SPRT. With m=∑i=1nxim=\sum_{i=1}^nx_i, logλn=mlogθ1θ0+(n−m)log1−θ11−θ0.\log\lambda_n=m\log\frac{\theta_1}{\theta_0}+(n-m)\log\frac{1-\theta_1}{1-\theta_0}. Let g1=logθ1θ0>0g_1=\log\frac{\theta_1}{\theta_0}>0 and g2=log1−θ01−θ1>0g_2=\log\frac{1-\theta_0}{1-\theta_1}>0. Then logλn=m(g1+g2)−ng2\log\lambda_n=m(g_1+g_2)-ng_2. With A=1−βαA=\frac{1-\beta}\alpha and B=β1−αB=\frac\beta{1-\alpha}, continue while logBg1+g2+ng2g1+g2<m<logAg1+g2+ng2g1+g2.\frac{\log B}{g_1+g_2}+n\frac{g_2}{g_1+g_2}<m<\frac{\log A}{g_1+g_2}+n\frac{g_2}{g_1+g_2}. Accept H1H_1 when mm reaches the upper line, and H0H_0 when it reaches the lower line.

OC function. Solve Eθ[(f1/f0)h]=1E_\theta[(f_1/f_0)^h]=1: θ(θ1θ0)h+(1−θ)(1−θ11−θ0)h=1,\theta\Big(\frac{\theta_1}{\theta_0}\Big)^h+(1-\theta)\Big(\frac{1-\theta_1}{1-\theta_0}\Big)^h=1, θ(h)=1−(1−θ11−θ0)h(θ1θ0)h−(1−θ11−θ0)h,L(θ(h))=Ah−1Ah−Bh.\theta(h)=\frac{1-\big(\frac{1-\theta_1}{1-\theta_0}\big)^h}{\big(\frac{\theta_1}{\theta_0}\big)^h-\big(\frac{1-\theta_1}{1-\theta_0}\big)^h},\qquad L(\theta(h))=\frac{A^h-1}{A^h-B^h}. At h=1h=1: θ=θ0\theta=\theta_0 and L=1−αL=1-\alpha. At h=−1h=-1: θ=θ1\theta=\theta_1 and L=βL=\beta. As h→0h\to0: θ→g2g1+g2\theta\to\frac{g_2}{g_1+g_2} and L→logAlogA−logBL\to\frac{\log A}{\log A-\log B}.

✓ Derivation checked step by step Every step was checked: the Bernoulli log-likelihood ratio, the continuation band, and the OC parameter θ(h), which gives θ₀ at h = 1 and θ₁ at h = −1.

↑ Back to the question list

For the SPRT with stopping bounds A and B (A>B) and strength (α,β) show that A≤1−βα and B≥β1−α for 0<α<1,0<β<1.

1995 · Paper I · Q7b · 30 marks

Solution

(This is the same result as the 2002 question above. The worked solution is repeated here.)

Set-up. In the SPRT with bounds A>1>BA>1>B, let RnR_n be the set of (x1,…,xn)(x_1,\dots,x_n) where sampling stops at stage nn with λn≥A\lambda_n\ge A (reject H0H_0), and AnA_n the set where it stops with λn≤B\lambda_n\le B (accept H0H_0). The sets for different nn are disjoint. The test terminates with probability 1 under H0H_0 and H1H_1, so with strength (α,β)(\alpha,\beta): ∑nP0(Rn)=α,∑nP1(Rn)=1−β,∑nP0(An)=1−α,∑nP1(An)=β.\sum_nP_0(R_n)=\alpha,\quad\sum_nP_1(R_n)=1-\beta,\quad\sum_nP_0(A_n)=1-\alpha,\quad\sum_nP_1(A_n)=\beta .

A≤1−βαA\le\frac{1-\beta}\alpha. On RnR_n, p1n≥Ap0np_{1n}\ge A\,p_{0n}, where pjn=∏i≤nfj(xi)p_{jn}=\prod_{i\le n}f_j(x_i). Integrating over RnR_n and summing over nn: 1−β=∑n∫Rnp1n≥A∑n∫Rnp0n=Aα.1-\beta=\sum_n\int_{R_n}p_{1n}\ \ge\ A\sum_n\int_{R_n}p_{0n}=A\alpha . So A≤1−βαA\le\dfrac{1-\beta}\alpha.

B≥β1−αB\ge\frac\beta{1-\alpha}. On AnA_n, p1n≤Bp0np_{1n}\le B\,p_{0n}. So β=∑n∫Anp1n≤B∑n∫Anp0n=B(1−α).\beta=\sum_n\int_{A_n}p_{1n}\ \le\ B\sum_n\int_{A_n}p_{0n}=B(1-\alpha). So B≥β1−αB\ge\dfrac\beta{1-\alpha}. ◼\blacksquare

Consequence. The inequalities are not equalities only because λn\lambda_n can overshoot the bounds. Ignoring the overshoot, Wald took A=1−βαA=\frac{1-\beta}\alpha and B=β1−αB=\frac\beta{1-\alpha}. With these bounds the actual error probabilities α′,β′\alpha',\beta' satisfy α′≤α1−β\alpha'\le\frac\alpha{1-\beta}, β′≤β1−α\beta'\le\frac\beta{1-\alpha} and α′+β′≤α+β\alpha'+\beta'\le\alpha+\beta.

✓ Proof checked step by step Every step was checked: the inequalities come from integrating the stopping conditions over the decision regions, using termination with probability one.

↑ Back to the question list

More on Statistical Inference

Questions: UPSC Civil Services (Main) Examination, Statistics Paper I, 1995–2026. Solutions: Optional Province. Found an error? Tell us.

Spotted an error? Tell us.

We classify every PYQ with care, but mistakes can slip in. If a question is in the wrong topic, has a typo, the wrong year, or is missing, let us know. We review every report and update the page.

Report an Error
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted