Quant Memo
Advanced

Stochastic Differential Equations

A rule of motion for something that is pushed by a predictable force and kicked by a random one at the same time. Writing that rule down gives you a whole distribution of futures instead of a single forecast, and almost every model in derivatives and rates is one of these.

Prerequisites: The Itô Integral, Itô's Lemma, Brownian Motion

An ordinary differential equation is a promise: tell me where the system is now, and I will tell you exactly where it goes next. That promise is useless for a share price. Nothing about today's close determines tomorrow's, and a model that returns a single number is answering a question nobody asked. What you actually want is a rule that produces a spread of tomorrows, with the right centre and the right width. A stochastic differential equation is exactly that rule.

The picture before any symbols

Think of a small boat crossing a choppy lake under engine power. Two things move it. The engine pushes steadily in a chosen direction — over an hour it covers a predictable distance. The chop shoves it about randomly — over an hour those shoves partly cancel, so the boat ends up displaced, but far less than the sum of the individual shoves.

That asymmetry is the entire mathematical content. Steady push accumulates in proportion to time. Random shoves accumulate in proportion to the square root of time, because they cancel each other out on average. Over a minute the chop dominates and you cannot tell where the engine is pointing. Over a day the engine wins and the chop is a blur around the track. Everything below is bookkeeping for those two rates.

Writing the rule down

The standard form is

dXt  =  μ(Xt,t)dt  +  σ(Xt,t)dWt.dX_t \;=\; \mu(X_t, t)\,dt \;+\; \sigma(X_t, t)\,dW_t .

Reading it symbol by symbol: XtX_t is the thing you are modelling at time tt — a price, a rate, a spread. μ\mu is the drift, the engine: how much XX is expected to move per unit of time, possibly depending on where XX currently is. σ\sigma is the diffusion coefficient or volatility, the chop: how large the random kicks are. dWtdW_t is an increment of Brownian motion — a fresh, unpredictable shock with mean zero and standard deviation dt\sqrt{dt}.

In plain English: over the next sliver of time, XX moves by a predictable amount proportional to the length of the sliver, plus a random amount proportional to the square root of that length.

The dd's are not derivatives; Brownian paths have no derivative anywhere. The equation above is shorthand for an honest statement about Itô integrals:

XT  =  X0  +  0Tμ(Xt,t)dt  +  0Tσ(Xt,t)dWt.X_T \;=\; X_0 \;+\; \int_0^T \mu(X_t,t)\,dt \;+\; \int_0^T \sigma(X_t,t)\,dW_t .

In words: where you end up equals where you started, plus everything the engine did, plus everything the chop did. The second integral is the one that needs Itô's construction; the first is ordinary calculus.

Why dt\sqrt{dt} changes how you think

Put numbers on the boat. Take a stock with drift μ=0.08\mu = 0.08 per year and volatility σ=0.20\sigma = 0.20 per year. Over one trading day, Δt=1/252=0.003968\Delta t = 1/252 = 0.003968:

  • drift contribution: 0.08×0.003968=0.0003170.08 \times 0.003968 = 0.000317, about 0.03 percent
  • noise standard deviation: 0.20×0.003968=0.20×0.06299=0.01260.20 \times \sqrt{0.003968} = 0.20 \times 0.06299 = 0.0126, about 1.26 percent

The noise is roughly 40 times the drift over a single day. That is why one day of price action tells you essentially nothing about expected return. The two are equal when μt=σt\mu t = \sigma\sqrt{t}, that is when t=σ/μ=0.20/0.08=2.5\sqrt{t} = \sigma/\mu = 0.20/0.08 = 2.5, so t=6.25t = 6.25 years. Below six years of data, the noise in a mean-return estimate is larger than the mean itself. This single calculation explains why Sharpe ratios need decades to measure and why risk models are estimable from a few months of data.

drift grows like t, noise like the square root of t 6.25 yr 25 yr drift noise
With an 8 percent drift and 20 percent volatility, the expected move only overtakes the typical random move after 6.25 years. To the left of the dot you are looking at noise; to the right, at signal.

Worked example 1: solving the equation for a stock

The standard equity model is geometric Brownian motion, where both drift and volatility scale with the price:

dSt=μStdt+σStdWt.dS_t = \mu S_t\,dt + \sigma S_t\,dW_t .

In words: the stock moves by a percentage each instant, not a dollar amount, so a 100-dollar stock and a 10-dollar stock have the same return dynamics.

To solve it, apply Itô's lemma to Yt=lnStY_t = \ln S_t. The first derivative is 1/S1/S, the second is 1/S2-1/S^2, and the lemma's extra half-second-derivative term contributes 12(1/S2)(σS)2=12σ2\tfrac12(-1/S^2)(\sigma S)^2 = -\tfrac12\sigma^2:

dYt=(μ12σ2)dt+σdWt.dY_t = \left(\mu - \tfrac{1}{2}\sigma^2\right)dt + \sigma\,dW_t .

The right-hand side no longer mentions YY, so it integrates directly and exponentiates back:

ST=S0exp ⁣[(μ12σ2)T+σWT].S_T = S_0 \exp\!\left[\left(\mu - \tfrac{1}{2}\sigma^2\right)T + \sigma W_T\right].

In words: the log price is a straight-line drift plus a Brownian wobble, so the price itself is lognormal.

Numbers, with S0=100S_0 = 100, μ=0.08\mu = 0.08, σ=0.20\sigma = 0.20, T=1T = 1:

  • log-drift: μ12σ2=0.080.02=0.06\mu - \tfrac12\sigma^2 = 0.08 - 0.02 = 0.06
  • suppose the year's shock lands at W1=+0.5W_1 = +0.5. Exponent =0.06+0.20(0.5)=0.16= 0.06 + 0.20(0.5) = 0.16, so S1=100e0.16=117.35S_1 = 100\,e^{0.16} = 117.35
  • expected price: E[S1]=100e0.08=108.33E[S_1] = 100\,e^{0.08} = 108.33
  • median price: 100e0.06=106.18100\,e^{0.06} = 106.18

The mean and the median differ by more than two dollars, and the median is the lower one. Half of all outcomes land below 106.18 even though the average is 108.33 — a handful of large upside paths drag the mean up. And the chance of simply losing money over the year is Φ(0.06/0.20)=Φ(0.3)=0.38\Phi(-0.06/0.20) = \Phi(-0.3) = 0.38, so 38 percent of one-year paths finish below where they started despite a positive drift. That 12σ2-\tfrac12\sigma^2 term is where most of the intuition damage happens.

Worked example 2: simulating one you cannot solve

Most SDEs have no closed form. You step them numerically with Euler–Maruyama: replace dtdt with Δt\Delta t and dWdW with Δtz\sqrt{\Delta t}\,z, where zz is a standard normal draw.

Xk+1=Xk+μ(Xk)Δt+σ(Xk)Δt  zk+1.X_{k+1} = X_k + \mu(X_k)\,\Delta t + \sigma(X_k)\,\sqrt{\Delta t}\;z_{k+1}.

Take a short rate that is pulled toward 4 percent: dr=3(0.04r)dt+0.02dWdr = 3(0.04 - r)\,dt + 0.02\,dW, starting at r0=0.06r_0 = 0.06, stepping quarterly so Δt=0.25\Delta t = 0.25 and σΔt=0.02×0.5=0.01\sigma\sqrt{\Delta t} = 0.02 \times 0.5 = 0.01. Suppose the four normal draws are z=(+0.8,1.2,+0.3,0.5)z = (+0.8,\,-1.2,\,+0.3,\,-0.5).

steppull term 3(0.04r)Δt3(0.04-r)\Delta tshock 0.01z0.01 znew rr
13(0.020)(0.25)=0.015003(-0.020)(0.25) = -0.01500+0.0080+0.00800.053000.05300
23(0.013)(0.25)=0.009753(-0.013)(0.25) = -0.009750.0120-0.01200.031250.03125
33(+0.00875)(0.25)=+0.006563(+0.00875)(0.25) = +0.00656+0.0030+0.00300.040810.04081
43(0.00081)(0.25)=0.000613(-0.00081)(0.25) = -0.000610.0050-0.00500.035200.03520

Read the middle column down: it is negative while the rate sits above 4 percent, flips positive the moment the rate falls below, and shrinks to almost nothing once the rate is close. That is a drift that depends on the state — the thing an ODE-shaped intuition keeps missing. The path goes 6.00, 5.30, 3.13, 4.08, 3.52 percent: overshooting, getting hauled back, overshooting less. This is the Ornstein–Uhlenbeck process, the workhorse for spreads and rates.

Set the explorer below to gbm and drag the drift to zero: the fan of paths still spreads out, it just stops leaning. Then switch to reverting and watch the fan stop widening altogether — the drift term is now pulling every path back and the spread reaches a ceiling. Same equation shape, completely different long-run behaviour, and the only thing that changed is whether μ\mu depends on XX.

Path explorer
13055time →
end (bold path) 100.38spread of ends 58.966 independent paths, same settings

An SDE says: next move = drift × (time elapsed) + volatility × (random shock scaled by the square root of time elapsed). Because noise grows like t\sqrt{t} and drift like tt, short horizons are all noise and long horizons are all drift. The solution is never a number — it is a distribution of paths.

What this means in practice

  • Pricing. Black–Scholes is one SDE (geometric Brownian motion) plus a change of drift under the risk-neutral measure. Heston is two coupled SDEs, one for the price and one for its variance. Reading a pricing paper is largely reading which SDE the author chose.
  • Choosing the diffusion term. σdW\sigma\,dW (constant, additive) lets XX go negative — fine for spreads, wrong for prices. σXdW\sigma X\,dW keeps XX positive but makes vol proportional to level. σXdW\sigma\sqrt{X}\,dW sits between and is why CIR rates stay non-negative. The shape of σ\sigma is a modelling decision with visible consequences at the boundaries.
  • Calibration. The drift is nearly unobservable on any realistic sample, as the 6.25-year calculation showed. The diffusion is estimable from high-frequency data almost exactly, because quadratic variation converges quickly. Trust your fitted σ\sigma; treat your fitted μ\mu as a prior.
  • Risk systems. Scenario generators, VaR engines and stress libraries are all SDE simulators. If your engine steps too coarsely near a barrier or a default boundary, discretisation error shows up as understated tail risk rather than as an obvious bug.

The μ\mu in dS=μSdt+σSdWdS = \mu S\,dt + \sigma S\,dW is not the growth rate of the stock. The stock grows at μ12σ2\mu - \tfrac12\sigma^2 in log terms; μ\mu is the growth rate of the average, which no individual path achieves. With μ=0.08\mu = 0.08 and σ=0.40\sigma = 0.40, the log drift is 0.080.08=00.08 - 0.08 = 0 — the typical path goes nowhere at all while the expected value still rises 8 percent a year. The second common error is treating dW/dtdW/dt as a "noise function"; no such function exists, and any manipulation that implicitly divides by dtdt is invalid.

Before touching an SDE algebraically, ask two questions of the drift: where does it vanish, and which way does it point on either side of that point? For μ=3(0.04r)\mu = 3(0.04 - r) it vanishes at 4 percent and points inward from both sides, so the process is mean-reverting. For μ=0.08r\mu = 0.08 r it vanishes at zero and points outward, so the process runs away. That thirty-second check tells you the qualitative answer before any calculus.

Related concepts

Practice in interviews

Further reading

  • Øksendal, Stochastic Differential Equations (ch. 5)
  • Shreve, Stochastic Calculus for Finance II (ch. 6)
  • Kloeden & Platen, Numerical Solution of Stochastic Differential Equations
ShareTwitterLinkedIn