1. Learning Objectives
By the end of this lesson, you will be able to:
-
Rigorously define conditional expectation and prove its key properties (linearity, tower property, smoothing).
-
Define and construct martingales, submartingales, and supermartingales in discrete and continuous time.
-
Apply the Optional Stopping Theorem to determine fair prices of financial derivatives.
-
Understand the Radon-Nikodym derivative and its role in changing probability measures.
-
Derive the Girsanov Theorem and apply it to transform a real-world drift into a risk-neutral drift.
-
Understand the connection between martingales, no-arbitrage, and the Fundamental Theorem of Asset Pricing.
-
Implement Monte Carlo simulation of martingale processes for derivative pricing.
2. Conditional Expectation – The Foundation of Predictive Modelling
Conditional expectation E[Y | X] is the expected value of Y given the information contained in X. In AI, a neural network trained with MSE loss learns E[Y | X].
2.1 Formal Definition
Let (Ω, F, P) be a probability space, and let G ⊆ F be a sub-sigma-algebra (a subset of available information). The conditional expectation E[Y | G] is the unique (up to almost sure equivalence) G-measurable random variable such that:∫_A E[Y | G] dP = ∫_A Y dP for all A ∈ G.
This means that E[Y | G] is the best G-measurable approximation of Y in the L2 sense.
2.2 Key Properties of Conditional Expectation (The “Tower Rules”)
Property 1: LinearityE[aX + bY | G] = a E[X | G] + b E[Y | G] for constants a, b.
Property 2: Pulling Out Known Factors
If Z is G-measurable, then E[ZY | G] = Z E[Y | G].
Property 3: Tower Property (Law of Total Expectation)
If H ⊆ G (more information is available), then:E[ E[Y | G] | H ] = E[Y | H].
In plain terms: the expectation of the conditional expectation is the lower-information expectation.
AI Application: If a model uses 100 features (G) and another uses only 10 (H), the 100-feature model’s predictions averaged over the 10-feature information set equal the 10-feature model’s predictions.
Property 4: Independence
If Y is independent of G, then E[Y | G] = E[Y] (a constant).
Property 5: Conditional Variance Decomposition (Law of Total Variance)Var(Y) = E[ Var(Y | G) ] + Var( E[Y | G] ).
This is the fundamental decomposition of risk into reducible and irreducible components.
2.3 Conditional Expectation as Projection
In the Hilbert space of square-integrable random variables L²(Ω, F, P), the conditional expectation E[Y | G] is the orthogonal projection of Y onto the subspace L²(Ω, G, P). This means it minimises the mean squared error:E[ (Y - E[Y | G])² ] = min_{Z ∈ G} E[ (Y - Z)² ].
This is precisely why regression neural networks converge to the conditional expectation.
3. Filtration – The Flow of Information Over Time
In finance, information arrives over time. This is modelled by a filtration {F_t}_{t ≥ 0}, which is an increasing sequence of sigma-algebras:F_s ⊆ F_t for all s ≤ t.
-
F_trepresents all information available up to timet. -
A process
{X_t}is adapted toF_tifX_tisF_t-measurable (its value is known at timet). -
A process
{X_t}is predictable ifX_tisF_{t-1}}-measurable (its value is known just before timet). This is essential for trading strategies – a trade at timetmust be based on information available att-1.
AI Application: In a time-series AI model, the input features at time t must be F_{t-1}}-measurable. The prediction Y_t is an F_t-measurable output. The model is trained to approximate E[Y_t | F_{t-1}}].
4. Martingales – The Fair Game Process
A martingale is a stochastic process that represents a “fair game”: the expected future value, given all past information, is equal to the current value.
4.1 Definition (Discrete Time)
A sequence of random variables {M_t}_{t=0}^{∞} is a martingale with respect to filtration {F_t} if:
-
E[|M_t|] < ∞for allt(integrable). -
M_tisF_t-measurable (adapted). -
E[ M_{t+1} | F_t ] = M_tfor allt.
4.2 Submartingale and Supermartingale
-
Submartingale:
E[ M_{t+1} | F_t ] ≥ M_t. The process has a positive drift (bullish). -
Supermartingale:
E[ M_{t+1} | F_t ] ≤ M_t. The process has a negative drift (bearish).
4.3 Financial Interpretation of Martingales
-
Under the Risk-Neutral Measure
Q, discounted asset prices are martingales.E_Q[ S_{t+1} / (1+r) | F_t ] = S_t.
This means that in a risk-neutral world, the expected return on any asset is exactly the risk-free rater. This is the foundation of no-arbitrage pricing. -
If a process is a martingale, it has no predictable patterns. This implies that you cannot make a risk-free profit by trading on past information (the Efficient Market Hypothesis under risk-neutrality).
4.4 The Martingale Property of Brownian Motion
A standard Brownian motion W_t (Wiener process) is a martingale:E[ W_{t+1} | F_t ] = W_t.
The increments W_{t+1} - W_t are independent of F_t and have mean zero.
5. The Optional Stopping Theorem (OST) – Pricing American Options
Stopping times are random times at which we decide to stop a process. The Optional Stopping Theorem gives conditions under which the martingale property is preserved at a stopping time.
5.1 Definition of Stopping Time
A random variable τ is a stopping time if the event {τ ≤ t} is F_t-measurable. In finance, this is a decision rule: “sell when the price hits $100” is a stopping time because you know at time t whether it has happened.
5.2 The Optional Stopping Theorem
If M_t is a martingale and τ is a bounded stopping time (there exists T such that τ ≤ T almost surely), then:E[ M_τ ] = E[ M_0 ].
If τ is unbounded but has finite expectation and |M_{t ∧ τ}| is bounded, the result also holds.
5.3 Financial Application – American Option Pricing
An American option can be exercised at any time before maturity. The price of an American option is:V_t = sup_{τ ≥ t} E_Q[ e^{-r(τ-t)} Payoff(S_τ) | F_t ], where the supremum is over all stopping times τ.
The OST ensures that this supremum is well-defined. This is solved using the Longstaff-Schwartz (Least Squares Monte Carlo) algorithm in practice.
5.4 Example: Gambler’s Ruin
Consider a gambler with initial wealth M_0 = 1, playing a fair game (martingale). The stopping time τ = min{ t : M_t = 0 or M_t = 2 }. By OST: E[M_τ] = E[M_0] = 1. Therefore, P(M_τ = 2) * 2 + P(M_τ = 0) * 0 = 1 → P(win) = 1/2. This proves that in a fair game, the probability of doubling before ruin is 50%.
6. The Radon-Nikodym Derivative – Changing the Probability Measure
In finance, we often need to shift from the real-world (physical) measure P to the risk-neutral measure Q. This is done using the Radon-Nikodym derivative.
6.1 Definition
If Q is absolutely continuous with respect to P (i.e., P(A) = 0 implies Q(A) = 0), then there exists a non-negative random variable Z such that:Q(A) = ∫_A Z(ω) dP(ω) for all events A ∈ F.Z is the Radon-Nikodym derivative, denoted Z = dQ/dP.
6.2 Properties
-
E_P[ Z ] = 1. -
Z > 0almost surely. -
For any random variable
X:E_Q[ X ] = E_P[ X * Z ].
6.3 Financial Application – Change of Numeraire
If we change the numeraire (the unit of account) from the risk-free asset (money market account) to the stock price itself, the Radon-Nikodym derivative is:Z = (S_T / S_0) / (B_T / B_0), where B_T is the money market account.
This is used to price options under the Stock Numeraire measure, which simplifies the pricing of quanto options and options on forwards.
7. The Girsanov Theorem – Shifting the Drift
Girsanov’s theorem tells us how a Brownian motion changes when we switch from one probability measure to another. This is the single most important theorem in quantitative finance.
7.1 The Setup
Let W_t be a Brownian motion under measure P. Define a process γ_t (the “market price of risk”) that is adapted to F_t. Define the Radon-Nikodym derivative:Z_t = exp( -∫_0^t γ_s dW_s - (1/2) ∫_0^t γ_s² ds ).
This is a martingale (exponential martingale). It is the density of the new measure Q with respect to P on F_t.
7.2 The Theorem
Under the new measure Q defined by dQ/dP = Z_T, the process:W_t^Q = W_t + ∫_0^t γ_s ds
is a standard Brownian motion.
Equivalently, under Q, the original Brownian motion W_t has a drift of -γ_t:dW_t = dW_t^Q - γ_t dt.
7.3 Financial Application – Risk-Neutral Pricing
Assume a stock price follows a geometric Brownian motion under the real-world measure P:dS_t = μ S_t dt + σ S_t dW_t.
We want to move to the risk-neutral measure Q where the discounted stock price is a martingale.
The market price of risk is γ = (μ - r) / σ.
By Girsanov: dW_t = dW_t^Q - γ dt.
Substitute into the SDE:dS_t = μ S_t dt + σ S_t (dW_t^Q - γ dt)= μ S_t dt + σ S_t dW_t^Q - σ γ S_t dt= μ S_t dt + σ S_t dW_t^Q - (μ - r) S_t dt= r S_t dt + σ S_t dW_t^Q.
Under the risk-neutral measure Q, the stock price drifts at the risk-free rate r. This is the fundamental result that enables option pricing (Black-Scholes).
8. The Fundamental Theorem of Asset Pricing (FTAP)
The FTAP connects martingales to the absence of arbitrage.
8.1 First Fundamental Theorem
A market is arbitrage-free if and only if there exists at least one risk-neutral measure Q such that all discounted asset prices are martingales under Q.
8.2 Second Fundamental Theorem
If the market is complete (every derivative can be perfectly hedged), then the risk-neutral measure Q is unique. If the market is incomplete, there are infinitely many risk-neutral measures, and option prices are not unique.
8.3 AI Application
In an incomplete market (e.g., there are fewer traded assets than sources of uncertainty), an AI model can be trained to learn the optimal hedging strategy directly using reinforcement learning, effectively bypassing the need to know the risk-neutral measure. The AI learns the pricing kernel Z implicitly from market data.
9. Martingale Representation Theorem
Any martingale M_t with respect to the filtration generated by a Brownian motion W_t can be represented as:M_t = M_0 + ∫_0^t φ_s dW_s
for some predictable process φ_t. This is the mathematical basis for dynamic hedging and delta hedging. The hedge ratio (delta) is precisely φ_t / σ_t.
10. Summary for the AI Practitioner
-
Conditional Expectation is the mathematical target of supervised learning. Your neural network approximates
E[Y | X]. -
Martingales are “fair games.” Under risk-neutral measure, discounted prices are martingales. If your AI model finds a non-martingale pattern, it has found alpha (under the real-world measure).
-
Optional Stopping Theorem is used to price American options. AI (Reinforcement Learning) is used to find the optimal stopping policy.
-
Girsanov Theorem allows drift transformation. It is used to go from real-world drift
μto risk-neutral driftr. The market price of riskγ = (μ - r)/σis a key input. -
Fundamental Theorem of Asset Pricing states: no-arbitrage ⇔ existence of at least one martingale measure. AI models often learn the pricing kernel implicitly.
-
Martingale Representation justifies delta hedging. The hedge ratio is the integrand
φ_t.