Stochastic processes
A price path is a single draw from a random process. To reason about it — to simulate it, to price risk against it, to know what “no edge” looks like — you need the mathematics of random motion: random walks, martingales, Brownian motion, and the geometric Brownian motion that underlies almost every model of asset prices. This chapter builds them in order, states Itô’s lemma, and uses it to re-derive the volatility drag you first met in Part II — this time from the calculus of randomness.
You only ever see one price path — the one that happened. But to judge a strategy you need to ask what could have happened: was that year skill, or one lucky draw from a process that just as easily hands you ? To answer that you need a model of the coin the market is flipping. This chapter builds that model in three steps — a fair coin-flip walk (the “no edge” null), its smooth continuous-time limit (Brownian motion), and the version that keeps prices positive and compounding (geometric Brownian motion). The payoff is concrete: it tells you what random looks like (so you can spot when your backtest isn’t), and it explains — from calculus, not hand-waving — why a volatile asset compounds slower than its average return suggests.
Random walks and martingales#
Start discrete. A random walk is a running sum of independent shocks :
Its defining property is that the best forecast of tomorrow, given everything you know today (the information set ), is simply today’s value. A process with that property is a martingale:
The martingale is the mathematical statement of no edge. If prices are a martingale, no rule built from past information can produce positive expected return — a theorem (the optional-stopping theorem) that no stop, target, or entry timing can beat. This is why the martingale is the null hypothesis the whole gauntlet tests against: an edge is precisely a departure from the martingale property, a conditional expectation that drifts up rather than staying flat.
Brownian motion#
Take the random walk to a continuous-time limit — shrink the step size and let steps arrive infinitely often — and it converges (by the central limit theorem) to Brownian motion , also called the Wiener process. It is defined by four properties:
- Starts at zero: .
- Independent increments: non-overlapping changes are independent — the future is uncorrelated with the past given the present (the continuous-time martingale property).
- Gaussian increments: over an interval of length , the change is normal with variance equal to the elapsed time, .
- Continuous paths (but nowhere differentiable — the path is infinitely jagged).
The variance-proportional-to-time property is the one to hold onto: , so the standard deviation grows like . This is the famous square-root-of-time scaling: risk over a horizon grows with its square root, not linearly. It is the same that governs the standard error of a measured edge — dispersion accumulates like the root of the number of independent increments.

Geometric Brownian motion#
Prices cannot be modelled as plain Brownian motion — that would let them go negative, and a $10 move should mean something different for a $20 stock than a $2000 one. The fix is to make the proportional change follow Brownian motion. That is geometric Brownian motion (GBM), written as a stochastic differential equation:
The first term is a deterministic drift at rate ; the second is random diffusion with volatility . Both scale with , so returns — not dollar moves — are what is stationary. This is the model behind Black-Scholes and behind the Monte-Carlo engine in Simulating markets.
Itô’s lemma and the solution#
To solve the SDE we need the chain rule for stochastic processes, which is not the ordinary one. Itô’s lemma says: for a smooth function of a process driven by ,
The extra term — the second-derivative piece — is what distinguishes Itô calculus from ordinary calculus. It appears because is first-order, not second-order, so a Taylor expansion must keep the quadratic term. Apply it to to solve GBM.
For GBM, and . With the derivatives are and (no explicit time dependence). Substitute:
Now follows a plain Brownian motion with constant drift, so it integrates trivially: . Exponentiate to get the closed-form solution of GBM:
Why it matters: the growth rate of the logarithm — the compound rate you actually earn — is , not . The is volatility drag, and here it drops out of Itô’s lemma automatically: the concavity of (its negative second derivative) turns variance into a systematic penalty on compound growth. Two assets with the same arithmetic drift but different volatility compound at different rates — the more volatile one lags by exactly half its variance.
Because is normal, is log-normal — positive, right-skewed, and with a median () that sits below its mean (). The typical path underperforms the average path; a few big winners drag the mean above the median. That gap is the drag, made visual.

Two instruments, one year (). A broad equity index with arithmetic drift and volatility ; and an altcoin with a fat drift but volatility. Itô says the compound growth rate is , so plug in the numbers:
The index compounds at — the drag is a mild tax. The altcoin is the shock: despite a average return, its drag makes the median holder lose money — the typical one-year path ends at , down , while the mean ends at , up . The gap between them is not a paradox: a handful of moon-shot paths haul the average up while most paths quietly bleed. At the desk this is why you size on log growth, not headline drift, and why leverage on a high-vol asset can have a negative expected compound rate even when each bet has positive expected return — the same volatility drag you met in returns and compounding, now falling straight out of the second-derivative term in Itô’s lemma.

import numpy as np
# One GBM path via the exact log-solution (no discretisation error):
# S_t = S_0 * exp((mu - sigma^2/2) t + sigma W_t)
S0, mu, sigma, T, steps = 100.0, 0.08, 0.20, 1.0, 252
dt = T / steps
dW = np.random.normal(0.0, np.sqrt(dt), steps) # increments ~ N(0, dt)
logS = np.log(S0) + np.cumsum((mu - 0.5*sigma**2)*dt + sigma*dW)
path = np.exp(logS) # a single log-normal price pathWhy model prices this way — and where it breaks#
GBM earns its place because it captures the three things that matter most cheaply: prices stay positive, returns compound multiplicatively, and volatility scales with the square root of time. It gives closed-form option prices and trivially fast simulation. But it is a model, and its assumptions are exactly where real markets bite back:
| GBM assumes | Reality | Consequence |
|---|---|---|
| Gaussian log-returns | Fat tails — extreme moves far more likely | Underestimates crash / gap risk |
| Constant volatility σ | Volatility clusters and spikes (GARCH-like) | Mis-prices risk in regime shifts |
| Continuous paths | Prices jump (gaps, halts, news) | Stops slip; no continuous hedging |
| Independent increments | Short-horizon autocorrelation, trends | The very thing edges exploit |
The right stance is instrumental: GBM is the frictionless baseline you reason from, the “no edge, no fat tails” null. Simulation lets you keep its convenience while swapping in fatter tails and clustered volatility to stress-test what the closed form hides.
Next: these processes are exactly what a Monte-Carlo engine draws from — and how you generate thousands of plausible futures to stress a strategy. Simulating markets.


