Issue MMXXVI · I · Probability

Index

Probability

Martingales and Stopping

On the randomness we agree to trust, and the moment we agree to stop.

Read
Martingales and Stopping
Plate — Fortuna · wheel, dice, blindfold
Contents

A martingale is not a kind of randomness. It is a kind of promise about randomness — the promise that, whatever has already happened, the next increment is worth nothing in conditional expectation. Stopping asks how far that promise extends when the time of reckoning is itself random.

The fair game

Work in discrete time on a probability space with a filtration: an increasing family ℱ0⊆ℱ1⊆⋯ of σ-algebras, where ℱn records the information available at time n. A real-valued process Xn adapted to this filtration, with E[|Xn|]<∞ for every n, is a martingale when [1]

E[Xn+1∣ℱn]=Xn,n≥0
(1)

almost surely. The conditional expectation is the whole content of the definition. Given the available information, the conditional mean of tomorrow’s value is today’s value. Replace the equality with ≥ and the process is a submartingale; with ≤, a supermartingale. These are statements about conditional means, not about the direction of every realised step.1

Iterating (1) and using the tower property of conditional expectation gives

E[Xn]=E[X0],for every fixed n
(2)

and this is where the trouble starts. Equation (2) holds for every fixed time. The gambler, however, does not play until a fixed time. The gambler plays until something happens — until the money doubles, until the money is gone, until the mood turns. May a random time be substituted into (2), and what has to be true for the substitution to survive?

Stopping without foresight

A rule for quitting has to be executable with the information then available. “Sell at the highest price of the year” is easy to write after December. It is generally not a rule one can carry out in March.

{τ≤n}∈ℱn,for every n≥0
(3)

At time n the observer must be able to answer “have I stopped?” using ℱn alone. The first time an adapted price process crosses a level is a stopping time. The last crossing before a fixed horizon generally is not: identifying it may require later observations. [1]2

Given a stopping time, the natural object is the process frozen at the moment of stopping. Write n∧τ for the smaller of the two and define the stopped process

Xnτ=Xn∧τ
(4)

The stopped process has increments 𝟙{k≤τ}(Xk−Xk−1). The event {k≤τ} is the complement of {τ≤k−1}, so the indicator is known at time k−1: a stake placed before the coin lands. It is bounded, and the martingale increment is integrable with conditional mean zero. Thus Xn∧τ is again an integrable martingale at every finite n, even when τ can be infinite. [1]

That looks like victory, and it is the reason the theorem in the next section is so often misquoted. Equation (4) gives E[Xn∧τ]=E[X0] for each finite n. What we want is the same statement with Xτ in place of Xn∧τ. Between the two lies a limit, and limits and expectations do not commute for free.

The optional stopping theorem

There are several ways to justify that limit. Keeping them separate makes the theorem easier to use. [1] [2]

  1. (i) There is a deterministic finite N with τ≤N almost surely.
  2. (ii) The family {Xn∧τ:n≥0} is uniformly integrable. In particular, this holds if |Xn∧τ|≤Y for all n almost surely, for some integrable Y≥0.
  3. (iii) E[τ]<∞ and there is a deterministic c<∞ such that |Xk−Xk−1|≤c almost surely for every k≥1.
E[Xτ]=E[X0]
(5)

Play independent fair coin tosses, doubling the stake after every loss, and stop at the first win. Start with net gain zero. Each finite-time stopped gain is integrable and is a martingale, but Xτ=1 almost surely. Here P(τ>n)=2−n and E[τ]=2: finite mean duration alone does not rescue (5). The stakes are unbounded, the stopping time is not bounded by a deterministic horizon, and the stopped gains are not uniformly integrable. [1]4

Ruin, and what it costs

Let Sn be a simple symmetric random walk started at zero, and let τ be the first time it reaches −a or b, where a,b are positive integers. To check finiteness, group the independent tosses into stretches of a+b steps. From any interior site, a stretch of all upward steps forces exit; its probability is 2−(a+b). Hence τ has a geometric tail bound over these stretches and E[τ]<∞. The stopped walk lies between −a and b, so condition (ii) applies. If p=P(Sτ=b), (5) reads pb−(1−p)a=0. [2]

P(reach b before −a)=aa+b,E[τ]=ab
(6)

The first half of (6) is one line of algebra. For the second, independence, mean zero and unit second moment of the increments make Sn2−n a martingale. Apply bounded optional stopping to τ∧n≤n: E[τ∧n]=E[Sτ∧n2]. The left side tends to E[τ] by monotone convergence; the right side tends to E[Sτ2] by bounded convergence. Substituting the exit probabilities gives E[τ]=pb2+(1−p)a2=ab. We have not assumed the formula for the mean duration in order to prove it.

Forty-six steps of a fair coin walk, starting at zero, drifting below the axis and then rising to touch the upper barrier at plus eight.
One realisation with a = b = 8. Absorption at the upper barrier after forty-six steps; the expected duration is 64.

The table makes the tradeoff visible. Here a is the initial bankroll and b the desired net gain, not the final bankroll. With a=b, reaching the upper barrier doubles the initial money. Increasing the target reduces the chance of success and increases the mean duration.

Ruin probabilities and expected durations for a symmetric walk
Bankroll aTarget bP(reach target)Mean durationP(ruin)
10100.5001000.500
10400.2004000.800
10900.1009000.900
50500.50025000.500
502000.200100000.800

Checking it by simulation

Simulation can check the scale of both quantities in (6); it does not prove them. This example uses a fixed seed so that its output can be reproduced.

from random import Random

def ruin(a, b, trials=20_000, seed=2026):
    """Estimate P(hit +b before -a) and the mean exit time."""
    if any(type(v) is not int or v <= 0 for v in (a, b, trials)):
        raise ValueError("a, b and trials must be positive integers")
    rng = Random(seed)
    wins = steps = 0
    for _ in range(trials):
        x = t = 0
        while -a < x < b:
            x += rng.choice((-1, 1))
            t += 1
        wins += x == b
        steps += t
    return wins / trials, steps / trials

print(ruin(10, 40))    # compare with the exact values (0.2, 400)

A cousin of the same argument gives Wald’s identity. Let ξk be independent, identically distributed real random variables with E[|ξ1|]<∞, set S0=0 and Sn=∑k=1nξk, and take ℱn=σ(ξ1,…,ξn). If τ is a stopping time for this filtration and E[τ]<∞, then [2]5

E[Sτ]=E[τ]⋅E[ξ1]
(7)

The assumptions in (7) do more than make Sn−nE[ξ1] a martingale. Since {τ≥k}∈ℱk−1 is independent of ξk, Tonelli’s theorem gives E[∑k=1τ|ξk|]=E[τ]E[|ξ1|]<∞. This random sum dominates every |Sτ∧n|. Bounded optional stopping applied to Sn−nE[ξ1] at τ∧n≤n, followed by dominated and monotone convergence, proves the identity. No bound on individual increments is required; the integrable domination has been proved instead. [2]

How far a fair game wanders

Optional stopping controls the value at a moment. The next result controls the whole trajectory, and it does so by the same device: choose the right stopping time and let the theorem do the work.

P(max0≤k≤nXk≥λ)≤E[Xn]λ
(8)

The terminal expectation controls the chance of a large excursion. To obtain the L2 bound, one needs a stronger estimate, not the square of (8). For a real square-integrable martingale Mk, write Mn∗=max0≤k≤n|Mk|. Apply bounded conditional optional sampling to the submartingale |Mk| at its first crossing of λ, capped at n. The crossing event belongs to the information at that time, so [2]

λP(Mn∗≥λ)≤E[|Mn|𝟙{Mn∗≥λ}]
(9)
E[supn≥0|Mn|2]≤4supn≥0E[Mn2]
(10)

Almost-sure convergence under the weaker assumption supnE[|Mn|]<∞ is a separate theorem. Doob’s upcrossing inequality bounds the expected number of crossings of each interval with rational endpoints. There are almost surely only finitely many crossings of each such interval, which rules out distinct lower and upper limits; Fatou’s lemma makes the resulting limit finite and integrable. This is the martingale convergence theorem, not a consequence of an L2 estimate. [2]

If supnE[Mn2]<∞, Cauchy–Schwarz first gives the L1 bound, hence Mn→M∞ almost surely by that theorem. Now (10) makes supn|Mn|2 integrable. Since |Mn−M∞|2≤4supk|Mk|2, dominated convergence gives E[|Mn−M∞|2]→0: convergence in L2. [2]6

The Snell envelope

Until now stopping has been something done to a process. Reverse the question. Given an adapted reward Zn with E[|Zn|]<∞ for n=0,…,N, which stopping time τ≤N maximises E[Zτ]? The finite horizon matters: it guarantees that the following recursion reaches an attainable terminal reward. [6] [7]

VN=ZN,Vn=max(Zn,E[Vn+1∣ℱn])
(11)

The recursion in (11) is a dialogue with two lines. Take what is on the table, or hold and inherit the value of holding; take whichever is larger. Set τ∗=min{0≤n≤N:Vn=Zn}. This is a stopping time and τ∗≤N because VN=ZN. On {n<τ∗} the continuation value equals Vn, so the stopped process Vn∧τ∗ is a martingale. Bounded optional stopping gives E[Zτ∗]=E[V0]. For any stopping time τ≤N, domination and bounded optional sampling give E[Zτ]≤E[Vτ]≤E[V0]. Thus τ∗ is optimal. [8]

The scope is broad, but specific: choose a stopping time for a given reward process and information flow. Sequential testing can lead to such a problem after specifying losses and observation costs. A bandit problem also chooses which observation to make next; that extra control is not supplied by (11). Shiryaev treats statistical stopping problems, and Peskir and Shiryaev develop the connection with free-boundary problems. [7] [8]

The market's martingale

A concrete financial example is a finite-horizon binomial market with a non-dividend-paying stock, a bank account Bn=(1+r)n, and constant stock multipliers d,u satisfying 0<d<1+r<u. Assume frictionless trading, unrestricted borrowing and short selling, and positive physical probabilities for both branches at every node. The market is complete and has a unique equivalent risk-neutral measure Q, with up probability q=(1+r−d)/(u−d). Discounted stock prices are Q-martingales: [9]

SnBn=EQ[SNBN∣ℱn],0≤n≤N
(12)

In this complete model an American payoff Hn≥0 is priced by the Snell envelope of Zn=Hn/Bn under Q; multiply the envelope by Bn to recover the price at time n. All variables are integrable on the finite tree, and exercise times satisfy τ≤N. Replication connects this stopping value to the no-arbitrage price. See Shreve, Chapter 4, “American Derivative Securities,” pp. 89–117. [9]7

For a backtest, the useful question is which model and information set justify the calculation. The martingale property under a pricing measure does not assert zero expected returns under the physical measure. A claimed riskless gain also calls for checking trading costs, financing, position limits and whether decisions use information actually available at the time. Optional stopping addresses a stated stochastic model; it does not validate the data or the execution assumptions.

Coda

What makes the martingale useful is that drift can be separated from fluctuation. In discrete time, an adapted integrable process Yn has a Doob decomposition Yn=Mn+An, where A0=0 and An−An−1=E[Yn−Yn−1∣ℱn−1]. Then M is a martingale and A is predictable; for a submartingale, A is nondecreasing. Each inequality still needs its own integrability assumptions. [3] [2]

A stopping rule can react to what has happened. That is its purpose. Repeatedly inspecting a trial and stopping at a boundary may be a valid stopping time; it does not thereby preserve a test calibrated for a fixed sample size. Wald’s procedure builds the sequential decision into the design. Choosing the best historical window afterwards is a different operation. The useful discipline is to state the information, the rule and the result whose conditions it satisfies. [4]

References

  1. David Williams. Probability with Martingales (1991). DOI: 10.1017/CBO9780511813658 Cambridge University Press, Cambridge. Cambridge Mathematical Textbooks. ISBN 978-0-521-40605-5. Chapters 10–14: stopping, convergence, L² bounds and uniform integrability.
  2. Rick Durrett. Probability: Theory and Examples (2019). 5th ed., Cambridge University Press, Cambridge. Cambridge Series in Statistical and Probabilistic Mathematics 49. ISBN 978-1-108-47368-2. Theorems 2.6.2, 4.2.10–11, 4.4.1–4, 4.4.6; §4.8. Link: author’s January 11, 2019 PDF.
  3. Joseph L. Doob. Stochastic Processes (1953). John Wiley & Sons, New York. viii + 654 pp. Chapter VII, “Martingales.” Link: bibliographic record in Doob’s collected bibliography.
  4. Abraham Wald. Sequential Tests of Statistical Hypotheses (1945). DOI: 10.1214/aoms/1177731118 The Annals of Mathematical Statistics 16(2), 117–186. Institute of Mathematical Statistics.
  5. Abraham Wald. Sequential Analysis (1947). John Wiley & Sons, New York. xii + 212 pp. Original edition; link to the digitised volume’s bibliographic record.
  6. J. Laurie Snell. Applications of Martingale System Theorems (1952). DOI: 10.2307/1990670 Transactions of the American Mathematical Society 73(2), 293–312. Historical source; the finite-horizon proof is given in the text.
  7. Albert N. Shiryaev. Optimal Stopping Rules (2008). DOI: 10.1007/978-3-540-74011-7 Springer, Berlin and Heidelberg. Stochastic Modelling and Applied Probability 8. Reprint of the 1978 edition. Chapter II, “Optimal Stopping of Markov Sequences”; Chapter IV, statistical applications.
  8. Goran Peskir, Albert Shiryaev. Optimal Stopping and Free-Boundary Problems (2006). DOI: 10.1007/978-3-7643-7390-0 Birkhäuser, Basel. Lectures in Mathematics ETH Zürich. Part I, “Optimal stopping: General facts,” pp. 1–52; Part VII, mathematical finance, pp. 375–436.
  9. Steven E. Shreve. Stochastic Calculus for Finance I: The Binomial Asset Pricing Model (2004). DOI: 10.1007/978-0-387-22527-2 Springer, New York. Springer Finance. ISBN 978-0-387-40100-3. Chapters 1–3; Chapter 4, “American Derivative Securities,” pp. 89–117.