Simulating SDEs: Euler, Milstein and the order of convergence
Most stochastic models in finance can’t be solved in closed form, so we simulate them in small time steps. The simplest scheme, Euler–Maruyama, copies the ordinary Euler method: take the drift times dt and the volatility times a normal increment. It works, but its paths drift away from the true ones faster than you might expect. The reason, and the fix, come from a term that ordinary calculus doesn’t have.
Strong and weak convergence
There are two ways to measure how good a scheme is:
- Strong error : how close the simulated path ends to the true path driven by the same Brownian motion. This matters for path-dependent quantities, multilevel Monte Carlo, and hedging simulations.
- Weak error : how close expectations are. This is what matters for pricing a European payoff.
Euler has weak order 1 but only strong order ½. For pricing with Euler, halving the step halves the bias. For anything that needs pathwise accuracy, you need four times as many steps to halve the error.
The Itô–Taylor expansion
Over one step, . Euler freezes at . Expanding and keeping the largest piece, , gives an extra term
by Itô’s formula applied to . Its size is of order , the same as the drift term, so dropping it, as Euler does, leaves an error of order h per step in a random direction. Those errors add up like a random walk, to order overall: strong order ½. Milstein keeps the term and gets strong order 1.
Note the term has mean zero: . That’s why dropping it doesn’t hurt the weak order.
Same Brownian path, three ways
Average |error| at T vs steps (log–log)
At 80% volatility with 16 steps, the Euler polyline visibly wanders off the exact path while Milstein stays on it. The log–log plot measures the strong error over 600 paths: Euler’s slope is about ½, Milstein’s about 1. At 20% volatility both are much more accurate, because the error terms scale with σ², but the slopes are the same.
import numpy as np
def simulate_gbm(S0, mu, sigma, T, n_steps, dW):
"""Euler and Milstein end values for GBM, driven by given Brownian increments dW (shape: paths x n_steps)."""
dt = T / n_steps
euler = np.full(dW.shape[0], S0, dtype=float)
milst = euler.copy()
for i in range(n_steps):
w = dW[:, i]
euler = euler + mu * euler * dt + sigma * euler * w
milst = milst + mu * milst * dt + sigma * milst * w + 0.5 * sigma**2 * milst * (w**2 - dt)
exact = S0 * np.exp((mu - 0.5 * sigma**2) * T + sigma * dW.sum(axis=1))
return np.abs(euler - exact).mean(), np.abs(milst - exact).mean()In a run with 4,000 paths at σ = 80%, going from 8 to 1,024 steps cut Euler’s mean error from 0.134 to 0.012 (11×) and Milstein’s from 0.018 to 0.00018 (100×).
When to bother
- If an exact scheme exists, use it. For GBM, simulate with Euler: the log-price has constant coefficients, so the scheme is exact. Same for OU (exact Gaussian transition).
- Additive noise needs no correction. If b doesn’t depend on X, then and Milstein is Euler.
- Pricing European payoffs: Euler’s weak order 1 is usually fine; Richardson extrapolation (combine runs at Δt and Δt/2) removes most of the bias.
- Square-root processes (CIR, Heston variance): Euler can go negative. Milstein helps, for , but practitioners usually use full truncation or Andersen’s QE scheme.
- Several Brownian motions: Milstein needs Lévy areas (iterated integrals of different Brownian motions), which are hard to simulate. That’s why it’s mostly used in one dimension or with commutative noise.
Where people slip in interviews
- Confusing strong and weak order. Euler is order 1 for expectations, order ½ for paths.
- Thinking more steps always fix a biased scheme quickly. With strong order ½, a 10× smaller error needs 100× the steps.
- Simulating GBM with Euler on S. It’s unnecessary error, and S can even go negative with big steps. Simulate log S instead.
- Forgetting the −Δt in the Milstein term. Without it the correction has a non-zero mean and biases the drift.
Try these before you open the answer
Warm-upWrite the Milstein scheme for an OU process dX = θ(μ − X)dt + σ dW.Show answer
is constant, so and Milstein is just Euler: .
CIRWhat's the Milstein correction term for dX = κ(θ − X)dt + σ√X dW?Show answer
, , so . The term is .
StepsEuler's strong error is 0.04 with 100 steps. Roughly how many steps for 0.01? With Milstein, if it's 0.004 at 100 steps, how many for 0.001?Show answer
Euler, order ½: error × ¼ needs steps × 16, so 1,600. Milstein, order 1: error × ¼ needs steps × 4, so 400.
ItôShow that ∫ₜ^{t+h} (W_s − W_t) dW_s = ½(ΔW² − h).Show answer
Apply Itô’s formula to : . Integrate from t to t + h: . Rearrange.
ExactWhy is Euler on log S exact for GBM?Show answer
has constant coefficients, so exactly. The Euler step is the exact transition.
The convergence numbers were measured on 4,000 simulated GBM paths with σ = 80%. The figure recomputes the error curve on 600 paths in your browser.