Basics of Sequential Testing

Recently, I've become interested in anytime-valid inference, especially e-values. I think the ideas are cool and useful, both in theory and in practice, so I'm planning to learn more about them whenever I have some spare time (mostly for fun).

These notes are mainly based on Aaditya Ramdas's lecture slides and the book by Ramdas and Wang [1], which are great resources for self-study.

1. Revisiting Hypothesis Testing

For some of the concepts in mathematical statistics, I usually refer to Statistical Inference by George Casella and Roger Berger. It's a well written textbook that's easy to follow even without a strong background in measure theory.

Suppose that X1,X2,…∼iidPθX_{1},X_{2},\ldots \overset{iid}{\sim}P_{\theta} for θ∈Θ\theta\in\Theta. Consider the hypothesis testing problem

H0:θ∈Θ0vs.H1:θ∈Θ1,H_{0}:\theta\in\Theta_{0} \quad \text{vs.}\quad H_{1}:\theta\in\Theta_{1},

where Θ0∩Θ1=∅\Theta_{0}\cap\Theta_{1}=\emptyset. Let X1:t=(X1,…,Xt)X_{1:t}=(X_{1},\ldots,X_{t}) be the observed sample.

Definition 1 (Test)

A test is a function ϕ:Xt→[0,1]\phi:\mathcal{X}^{t}\to[0,1], where ϕ(X1:t)\phi(X_{1:t}) is the probability of rejecting H0H_{0} given the observed sample.

The power function of ϕ\phi is the probability of rejecting H0H_{0} under PθP_{\theta}:

γϕ(θ)=Eθ[ϕ(X1:t)].\gamma_{\phi}(\theta)=\mathbb{E}_{\theta}[\phi(X_{1:t})].

The size of ϕ\phi is defined as

size⁡(ϕ)=sup⁡θ∈Θ0γϕ(θ).\operatorname{size}(\phi)=\sup_{\theta\in\Theta_0}\gamma_{\phi}(\theta).

A test ϕ\phi is called a level-α\alpha test if size⁡(ϕ)≤α\operatorname{size}(\phi)\leq\alpha.

In other words, a level-α\alpha test rejects H0H_{0} with probability at most α\alpha when H0H_{0} is true.

Definition 2 (pp-value)

A statistic pt(X1:t)∈[0,1]p_{t}(X_{1:t})\in[0,1] is called a pp-value for H0H_{0} if

Pθ(pt(X1:t)≤α)≤αP_{\theta}(p_{t}(X_{1:t}) \leq\alpha)\leq\alpha

for every θ∈Θ0\theta\in\Theta_{0} and α∈(0,1)\alpha\in(0,1).

Given a pp-value ptp_{t}, we obtain a level-α\alpha test by

ϕ(X1:t)=I{pt(X1:t)≤α}.\phi(X_{1:t})=\mathbb{I}\{p_{t}(X_{1:t})\leq\alpha\}.

That is, we reject H0H_{0} whenever the pp-value is smaller than or equal to α\alpha.

2. Sequential hypothesis testing

In classical testing, the sample size is fixed in advance. In sequential testing, we collect data until we have enough evidence to make a decision.

Definition 3 (Stopping time)

A random time τ∈ N∪{∞}\tau\in\ \mathbb{N} \cup\{\infty\} is called a stopping time if {τ≤t}∈Ft\{\tau\leq t\}\in\mathcal{F}_{t} for every t≥0t\geq0.

Suppose that ptp_{t} is a valid pp-value at each time tt. Consider the stopping rule

τ=inf⁡{t≥1:pt≤α}.\tau=\inf\{t\geq1: p_{t}\leq\alpha\}.

Is the resulting test still valid..?

Example 1

Suppose under null hypothesis, p1,p2,…∼iidUnif(0,1)p_{1}, p_{2},\ldots\overset{iid}{\sim}\mathtt{Unif}(0,1). Although each ptp_{t} is a valid pp-value,

PH0(min⁡1≤t≤Tpt≤α)=1−PH0(min⁡1≤t≤Tpt>α)=1−PH0(p1>α,…,pT>α)=1−(1−α)T→1\begin{align*} P_{H_0}\left( \min_{1\leq t\leq T}p_{t}\leq\alpha \right) =&1 - P_{H_0}\left( \min_{1 \le t \le T}p_{t} > \alpha \right) \\ =&1 - P_{H_0}\left( p_{1} > \alpha, \dots, p_{T} > \alpha \right) \\ =&1-(1-\alpha)^{T}\to1 \end{align*}

as T→∞T\to\infty.

Thus, validity at each fixed time does not imply validity under repeated testing.

Definition 4 (Anytime-valid test)

A sequence of nonrandomized tests (ϕt)t≥1(\phi_{t})_{t\geq1} is anytime-valid at level α\alpha if

sup⁡θ∈Θ0Pθ(∃t≥1:ϕt=1)≤α.\sup_{\theta\in\Theta_0}P_{\theta}(\exists t\geq1:\phi_{t}=1) \leq\alpha.

How can we construct such a test?

3. Preliminaries

Definition 5 (Supermartingale)

An integrable, (Ft)(\mathcal{F}_{t})-adapted process (Mt)t≥0(M_{t})_{t\geq0} is a supermartingale if

E[Mt∣Ft−1]≤Mt−1a.s.\mathbb{E}[M_{t}\mid\mathcal{F}_{t-1}] \leq M_{t-1}\quad\text{a.s.}

for every t≥1t\geq1.

Theorem 1 (Ville's inequality [2])

Let (Mt)t≥0(M_{t})_{t\geq0} be a nonnegative supermartingale. For every a>0a>0,

P(sup⁡t≥0Mt≥a)≤E[M0]a.\mathbb{P}\left(\sup_{t\geq0}M_{t}\geq a\right) \leq\frac{\mathbb{E}[M_{0}]}{a}.

In particular, if M0=1M_{0}=1, then

P(∃t≥1:Mt≥1α)≤α.\mathbb{P}\left( \exists t\geq1:M_{t}\geq\frac{1}{\alpha} \right)\leq\alpha.

Thus, if we can construct a nonnegative supermartingale under H0H_{0}, we can obtain an anytime-valid test.

4. E-values and e-processes

Definition 6 (E-variable)

A nonnegative statistic EE is called an e-variable for H0H_{0} if

sup⁡θ∈Θ0Eθ[E]≤1.\sup_{\theta\in\Theta_0}\mathbb{E}_{\theta}[E]\leq1.

Its observed value is called an e-value.

By Markov's inequality,

Pθ(E≥1α)≤αEθ[E]≤αP_{\theta}\left(E\geq\frac{1}{\alpha}\right) \leq\alpha\mathbb{E}_{\theta}[E] \leq\alpha

for every θ∈Θ0\theta\in\Theta_{0}. Therefore,

ϕ=I{E≥1α}\phi=\mathbb{I}\left\{E\geq\frac{1}{\alpha}\right\}

is a level-α\alpha test.

Remark

Given an e-variable EE,

p=min⁡{1,1E}p=\min\left\{1,\frac{1}{E}\right\}

is a valid pp-value, due to Markov's inquality.

Definition 7 (E-process)

A nonnegative, adapted process (Et)t≥0(E_{t})_{t\geq0} is called an e-process for H0H_{0} if

sup⁡θ∈Θ0Eθ[Eτ]≤1\sup_{\theta\in\Theta_0}\mathbb{E}_{\theta}[E_{\tau}]\leq1

for every finite stopping time τ\tau.

In particular, a nonnegative supermartingale under every PθP_{\theta} with initial value one is an e-process.

Theorem 2

Let (Et)t≥0(E_{t})_{t\geq0} be an e-process for H0H_{0}. Then

sup⁡θ∈Θ0Pθ(∃t≥1:Et≥1α)≤α.\sup_{\theta\in\Theta_0}P_{\theta}\left( \exists t\geq1:E_{t}\geq\frac{1}{\alpha} \right)\leq\alpha.

Proof

Fix θ∈Θ0\theta\in\Theta_{0} and T≥1T\geq1. Let τ=inf⁡{t≥1:Et≥1/α}.\tau=\inf\{t\geq1:E_{t}\geq1/\alpha\}. Since τ∧T=min⁡{τ,T}\tau\wedge T=\min\{\tau,T\} is a finite stopping time, the definition of an e-process gives

Eθ[Eτ∧T]≤1.\mathbb{E}_{\theta}[E_{\tau\wedge T}]\leq1.

By Markov's inequality,

Pθ(max⁡1≤t≤TEt≥1α)=Pθ(τ≤T)=Pθ(Eτ∧T≥1α)≤αEθ[Eτ∧T]≤α.\begin{aligned}P_{\theta}\left(\max_{1\leq t\leq T}E_{t}\geq\frac{1}{\alpha}\right)&=P_{\theta}(\tau\leq T)\\&=P_{\theta}\left(E_{\tau\wedge T}\geq\frac{1}{\alpha}\right)\\&\leq\alpha\mathbb{E}_{\theta}[E_{\tau\wedge T}]\\&\leq\alpha.\end{aligned}

Letting T→∞T\to\infty, we obtain

Pθ(∃t≥1:Et≥1α)=Pθ(τ<∞)=lim⁡T→∞Pθ(τ≤T)≤α.\begin{aligned}P_{\theta}\left(\exists t\geq1:E_{t}\geq\frac{1}{\alpha}\right)&=P_{\theta}(\tau<\infty)\\&=\lim_{T\to\infty}P_{\theta}(\tau\leq T)\\&\leq\alpha.\end{aligned}

Since θ∈Θ0\theta\in\Theta_{0} is arbitrary, the desired result follows.

5. Testing by betting

So far, we have seen that an e-process gives us an anytime-valid test. The next question is, how can we construct an e-process..?

One way is to think of hypothesis testing as a betting game.

Suppose that a bettor starts with an initial wealth W0=1W_{0}=1. At each time tt, the bettor observes XtX_{t}, and the wealth is updated by

Wt=Wt−1Bt,W_{t}=W_{t-1}B_{t},

where Bt≥0B_{t}\geq0 is a betting factor. The betting rule may depend on the past observations, but it must be chosen before observing XtX_{t}.

The bettor bets in favor of H1H_{1}. If H0H_{0} is true, the bettor should not make money on average. That is,

Eθ[Bt∣Ft−1]≤1\mathbb{E}_{\theta}[B_{t}\mid\mathcal{F}_{t-1}]\leq1

for every θ∈Θ0\theta\in\Theta_{0} and t≥1t\geq1.

Then, for every θ∈Θ0\theta\in\Theta_{0},

Eθ[Wt∣Ft−1]=Eθ[Wt−1Bt∣Ft−1]=Wt−1Eθ[Bt∣Ft−1]≤Wt−1.\begin{aligned}\mathbb{E}_{\theta}[W_{t}\mid\mathcal{F}_{t-1}]&=\mathbb{E}_{\theta}[W_{t-1}B_{t}\mid\mathcal{F}_{t-1}]\\&=W_{t-1}\mathbb{E}_{\theta}[B_{t}\mid\mathcal{F}_{t-1}]\\&\leq W_{t-1}.\end{aligned}

Therefore, the wealth process

Wt=∏s=1tBsW_{t}=\prod_{s=1}^{t} B_{s}

is a nonnegative supermartingale under H0H_{0}, and hence an e-process.

By Ville's inequality,

Pθ(∃t≥1:Wt≥1α)≤Pθ(sup⁡t≥0Wt≥1α)≤αEθ[W0]=α\begin{aligned}P_{\theta}\left(\exists t\geq1:W_{t}\geq\frac{1}{\alpha}\right)&\leq P_{\theta}\left(\sup_{t\geq0}W_{t}\geq\frac{1}{\alpha}\right)\\&\leq\alpha\mathbb{E}_{\theta}[W_{0}]\\&=\alpha\end{aligned}

for every θ∈Θ0\theta\in\Theta_{0}.

Thus, we can reject H0H_{0} whenever Wt≥1/αW_{t}\geq1/\alpha. If H0H_{0} is true, it should be difficult for the bettor to make a large amount of money. If the bettor makes a lot of money, we have some evidence against H0H_{0}.

6. What is a good betting strategy?

There are many valid betting strategies. For example, we can choose not to bet at all:

Bt=1,t≥1.B_{t}=1,\qquad t\geq1.

Then Wt=1W_{t}=1 for every t≥0t\geq0. This strategy is valid but provides no evidence against H0H_{0}. We can also bet all our money at each round. This is also valid, but a single loss wipes out our entire wealth.

We want a betting strategy that is valid under H0H_{0} but makes money quickly under H1H_{1}. For simplicity, consider two simple hypotheses:

H0:θ=θ0vs.H1:θ=θ1.H_{0}:\theta=\theta_{0} \quad\text{vs.}\quad H_{1}:\theta=\theta_{1}.

Consider a betting function b:X→[0,∞)b:\mathcal{X}\to[0,\infty) satisfying

Eθ0[b(X)]≤1,\mathbb{E}_{\theta_0}[b(X)]\leq1,

and use the same betting function at every time:

Bt=b(Xt).B_{t}=b(X_{t}).

Since XtX_{t} is independent of the past,

Eθ0[Bt∣Ft−1]=Eθ0[b(Xt)∣Ft−1]=Eθ0[b(Xt)]≤1.\begin{aligned}\mathbb{E}_{\theta_0}[B_{t}\mid\mathcal{F}_{t-1}]&=\mathbb{E}_{\theta_0}[b(X_{t})\mid\mathcal{F}_{t-1}]\\&=\mathbb{E}_{\theta_0}[b(X_{t})]\\&\leq1.\end{aligned}

Hence, the wealth process

Wt=∏s=1tb(Xs)W_{t}=\prod_{s=1}^{t} b(X_{s})

is an e-process under H0H_{0}.

The remaining question is how to choose bb so that the wealth grows quickly under H1H_{1}.

Since the wealth is updated multiplicatively, it is natural to consider its logarithm (Why? Because taking the log turns a product into a sum and lets us use the law of large numbers.):

log⁡Wt=log⁡(∏s=1tb(Xs))=∑s=1tlog⁡b(Xs).\begin{aligned}\log W_{t}&=\log\left(\prod_{s=1}^{t} b(X_{s})\right)\\&=\sum_{s=1}^{t}\log b(X_{s}).\end{aligned}

Taking the expectation under H1H_{1} gives

Eθ1[log⁡Wt]=∑s=1tEθ1[log⁡b(Xs)]=tEθ1[log⁡b(X)].\begin{aligned}\mathbb{E}_{\theta_1}[\log W_{t}]&=\sum_{s=1}^{t}\mathbb{E}_{\theta_1}[\log b(X_{s})]\\&=t\mathbb{E}_{\theta_1}[\log b(X)].\end{aligned}

Moreover, assuming Eθ1[∣log⁡b(X)∣]<∞\mathbb{E}_{\theta_1}[|\log b(X)|]<\infty, the SLLN gives

1tlog⁡Wt=1t∑s=1tlog⁡b(Xs)→a.s.Eθ1[log⁡b(X)].\frac{1}{t}\log W_{t} =\frac{1}{t}\sum_{s=1}^{t}\log b(X_{s}) \xrightarrow{a.s.}\mathbb{E}_{\theta_1}[\log b(X)].

Then, for large tt,

log⁡Wt≈tEθ1[log⁡b(X)],\log W_{t}\approx t\mathbb{E}_{\theta_1}[\log b(X)],

or equivalently,

Wt≈exp⁡(tEθ1[log⁡b(X)]).W_{t}\approx\exp(t\mathbb{E}_{\theta_1}[\log b(X)]).

Thus, Eθ1[log⁡b(X)]\mathbb{E}_{\theta_1}[\log b(X)] determines the long-run exponential growth rate of the wealth. We would like to make this quantity as large as possible while keeping the betting strategy valid under H0H_{0}.

7. Kelly optimality

The idea of maximizing the expected logarithmic growth of wealth is known as the Kelly criterion.

Definition 8 (Kelly optimality)

A betting function b⋆:X→[0,∞)b^{\star} : \mathcal{X} \to [0, \infty) is called Kelly-optimal if it solves

max⁡b≥0Eθ1[log⁡b(X)]subject toEθ0[b(X)]≤1.\begin{aligned}\max_{b\geq0}\quad&\mathbb{E}_{\theta_1}[\log b(X)]\\ \text{subject to}\quad&\mathbb{E}_{\theta_0}[b(X)]\leq1.\end{aligned}

The constraint makes the betting strategy valid under H0H_{0}, while the objective makes the wealth grow as fast as possible under H1H_{1}.

What is the solution to this optimization problem?Interestingly, the solution is something we are already familiar with from classical hypothesis testing.

Theorem 3 (A simplified version of Theorem 3.20 in [1]; see also [3])

Let pθ0p_{\theta_0} and pθ1p_{\theta_1} be the densities of Pθ0P_{\theta_0} and Pθ1P_{\theta_1}, respectively. Suppose that Pθ1≪Pθ0P_{\theta_1}\ll P_{\theta_0} and DKL(Pθ1∥Pθ0)<∞.D_{\mathrm{KL}}(P_{\theta_1}\|P_{\theta_0})<\infty.

Then the likelihood ratio

b⋆(x)=pθ1(x)pθ0(x)b^{\star}(x)=\frac{p_{\theta_1}(x)}{p_{\theta_0}(x)}

is Kelly-optimal. Moreover, the optimal logarithmic growth rate is

Eθ1[log⁡b⋆(X)]=DKL(Pθ1∥Pθ0).\mathbb{E}_{\theta_1}[\log b^{\star}(X)] =D_{\mathrm{KL}}(P_{\theta_1}\|P_{\theta_0}).

Proof

For simplicity, we give the proof for continuous distributions. (no measure theoretic notation here.) First, we check that b⋆b^{\star} is a valid betting function:

Eθ0[b⋆(X)]=∫pθ0(x)>0pθ1(x)pθ0(x)pθ0(x) dx=∫pθ1(x) dx=1\begin{aligned}\mathbb{E}_{\theta_0}[b^{\star}(X)]&=\int_{p_{\theta_0}(x)>0}\frac{p_{\theta_1}(x)}{p_{\theta_0}(x)}p_{\theta_0}(x)\,dx\\&=\int p_{\theta_1}(x)\,dx = 1\end{aligned}

where the second equality follows from Pθ1≪Pθ0P_{\theta_1}\ll P_{\theta_0}.

Now, let bb be any valid betting function, i.e., Eθ0[b(X)]≤1\mathbb{E}_{\theta_0}[b(X)]\leq1. We want to show that

Eθ1[log⁡b(X)]≤Eθ1[log⁡b⋆(X)].\mathbb{E}_{\theta_1}[\log b(X)] \leq\mathbb{E}_{\theta_1}[\log b^{\star}(X)].

Note that

Eθ1[b(X)b⋆(X)]=∫pθ1(x)>0b(x)pθ0(x)pθ1(x)pθ1(x) dx=∫pθ1(x)>0b(x)pθ0(x) dx≤∫b(x)pθ0(x) dx=Eθ0[b(X)]≤1.\begin{aligned}\mathbb{E}_{\theta_1}\left[\frac{b(X)}{b^\star(X)}\right]&=\int_{p_{\theta_1}(x)>0}b(x)\frac{p_{\theta_0}(x)}{p_{\theta_1}(x)}p_{\theta_1}(x)\,dx\\&=\int_{p_{\theta_1}(x)>0}b(x)p_{\theta_0}(x)\,dx\\&\leq\int b(x)p_{\theta_0}(x)\,dx\\&=\mathbb{E}_{\theta_0}[b(X)] \leq1.\end{aligned}

By Jensen's inequality,

Eθ1[log⁡b(X)]−Eθ1[log⁡b⋆(X)]=Eθ1[log⁡b(X)b⋆(X)]≤log⁡Eθ1[b(X)b⋆(X)]≤0\begin{aligned}\mathbb{E}_{\theta_1}[\log b(X)] -\mathbb{E}_{\theta_1}[\log b^{\star}(X)]&=\mathbb{E}_{\theta_1}\left[\log\frac{b(X)}{b^\star(X)}\right]\\&\leq\log\mathbb{E}_{\theta_1}\left[\frac{b(X)}{b^\star(X)}\right] \le 0\end{aligned}

Hence, b⋆b^{\star} is Kelly-optimal. Finally, by the definition of KL divergence,

Eθ1[log⁡b⋆(X)]=Eθ1[log⁡pθ1(X)pθ0(X)]=∫pθ1(x)>0pθ1(x)log⁡pθ1(x)pθ0(x) dx=DKL(Pθ1∥Pθ0).\begin{aligned}\mathbb{E}_{\theta_1}[\log b^{\star}(X)]&=\mathbb{E}_{\theta_1}\left[\log\frac{p_{\theta_1}(X)}{p_{\theta_0}(X)}\right]\\&=\int_{p_{\theta_1}(x)>0}p_{\theta_1}(x)\log\frac{p_{\theta_1}(x)}{p_{\theta_0}(x)}\,dx\\&=D_{\mathrm{KL}}(P_{\theta_1}\|P_{\theta_0}).\end{aligned}

It is interesting that we obtain the same likelihood ratio by maximizing power in classical testing (Neyman–Pearson lemma) and log-wealth growth in betting.

8. Sequential likelihood ratio test

Now that we know the Kelly-optimal betting function, we can use it at every round:

Bt=b⋆(Xt)=pθ1(Xt)pθ0(Xt).B_{t}=b^{\star}(X_{t})=\frac{p_{\theta_1}(X_{t})}{p_{\theta_0}(X_{t})}.

The resulting wealth process is

Wt=∏s=1tb⋆(Xs)=∏s=1tpθ1(Xs)pθ0(Xs)=pθ1(X1:t)pθ0(X1:t)=:Lt.\begin{aligned}W_{t}&=\prod_{s=1}^{t} b^{\star}(X_{s}) =\prod_{s=1}^{t}\frac{p_{\theta_1}(X_s)}{p_{\theta_0}(X_s)}\\&=\frac{p_{\theta_1}(X_{1:t})}{p_{\theta_0}(X_{1:t})}\\&=:L_{t}.\end{aligned}

We call (Lt)t≥0(L_{t})_{t\geq0} the likelihood ratio process, with L0=1L_{0}=1. Under H0H_{0},

Eθ0[Lt∣Ft−1]=Lt−1Eθ0[pθ1(Xt)pθ0(Xt)|Ft−1]=Lt−1Eθ0[pθ1(Xt)pθ0(Xt)]=Lt−1.\begin{aligned}\mathbb{E}_{\theta_0}[L_{t}\mid\mathcal{F}_{t-1}]&=L_{t-1}\mathbb{E}_{\theta_0}\left[ \frac{p_{\theta_1}(X_t)}{p_{\theta_0}(X_t)}\middle|\mathcal{F}_{t-1}\right]\\&=L_{t-1}\mathbb{E}_{\theta_0}\left[ \frac{p_{\theta_1}(X_t)}{p_{\theta_0}(X_t)}\right]\\&=L_{t-1}.\end{aligned}

Hence, (Lt)(L_{t}) is a nonnegative martingale under H0H_{0}.

Under H1H_{1}, the SLLN gives

1tlog⁡Lt=1t∑s=1tlog⁡pθ1(Xs)pθ0(Xs)→a.s.Eθ1[log⁡pθ1(X)pθ0(X)]=DKL(Pθ1∥Pθ0).\begin{aligned}\frac{1}{t}\log L_{t}&=\frac{1}{t}\sum_{s=1}^{t}\log\frac{p_{\theta_1}(X_s)}{p_{\theta_0}(X_s)}\xrightarrow{\mathrm{a.s.}}\mathbb{E}_{\theta_1}\left[ \log\frac{p_{\theta_1}(X)}{p_{\theta_0}(X)}\right]=D_{\mathrm{KL}}(P_{\theta_1}\|P_{\theta_0}).\end{aligned}

Thus, the likelihood ratio process is valid under H0H_{0} and achieves the Kelly-optimal logarithmic growth rate under H1H_{1}.

Consider the stopping rule

τ=inf⁡{t≥1:Lt≥1α}.\tau=\inf\left\{t\geq1:L_{t}\geq\frac{1}{\alpha}\right\}.

By Ville's inequality,

Pθ0(τ<∞)=Pθ0(∃t≥1:Lt≥1α)≤α.\begin{aligned}P_{\theta_0}(\tau<\infty)&=P_{\theta_0}\left(\exists t\geq1:L_{t}\geq\frac{1}{\alpha}\right) \leq\alpha.\end{aligned}

If Pθ0≠Pθ1P_{\theta_0}\neq P_{\theta_1}, then DKL(Pθ1∥Pθ0)>0.D_{\mathrm{KL}}(P_{\theta_1}\|P_{\theta_0})>0. Therefore, Lt→∞L_{t}\to\infty almost surely under H1H_{1}, which implies

Pθ1(τ<∞)=1.P_{\theta_1}(\tau<\infty)=1.

Remark (Wald's Sequential Probability Ratio Test [4])

The test above tells us when to reject H0H_{0}, but not when to stop and accept H0H_{0}.

To make a decision in both directions, we can introduce a lower boundary and define

τα,β=inf⁡{t≥1:Lt∉(β,1/α)}.\tau_{\alpha,\beta}=\inf\left\{t\geq1:L_{t}\notin(\beta,1/\alpha)\right\}.

We make a decision according to the following rule:

{Reject H0,Lt≥1/α,Accept H0,Lt≤β,Continue sampling,β<Lt<1/α.\begin{cases}\text{Reject }H_{0},&L_{t}\geq1/\alpha,\\ \text{Accept }H_{0},&L_{t}\leq\beta,\\ \text{Continue sampling},&\beta<L_{t}<1/\alpha.\end{cases}

Under mutual absolute continuity, (Lt)(L_{t}) and (1/Lt)(1/L_{t}) are nonnegative martingales under H0H_{0} and H1H_{1}, respectively. Applying Ville's inequality to both processes gives

Pθ0(Reject H0)≤α,Pθ1(Accept H0)≤β.\begin{aligned}P_{\theta_0}(\text{Reject }H_{0})&\leq\alpha,\\ P_{\theta_1}(\text{Accept }H_{0})&\leq\beta.\end{aligned}

References

  1. [1] Aaditya Ramdas and Ruodu Wang (2025). Hypothesis testing with e-values. Foundations and Trends in Statistics, 1(1–2), 1–390
  2. [2] Jean Ville (1939). Etude critique de la notion de collectif. Gauthier-Villars, Paris, 3
  3. [3] Glenn Shafer (2021). Testing by betting: A strategy for statistical and scientific communication. Journal of the Royal Statistical Society: Series A, 184(2), 407–431
  4. [4] Abraham Wald (1945). Sequential tests of statistical hypotheses. The Annals of Mathematical Statistics, 16(2), 117–186