Simulating Sample Paths and Discretization (Euler–Maruyama)
Turning an SDE into a computable path, and the difference between strong and weak accuracy.
Learning Objectives
Click a status chip to cycle: Not started → In progress → Studied → Practiced → Needs review → Mastered.
- Write the Euler–Maruyama scheme for a general Ito SDE and simulate one path.
- Distinguish strong (path-wise) from weak (distributional) convergence and state their orders.
- Explain why GBM should be simulated in log-space (exact, positivity-preserving) rather than by naive Euler.
- Identify discretization bias and how it differs from Monte Carlo statistical error.
- Verify a scheme by comparing Euler and exact GBM on shared Brownian increments.
Key Vocabulary
- Euler–Maruyama
- The first-order scheme \(X_{k+1}=X_k+a(X_k)\,\Delta t+b(X_k)\,\Delta W_k\) with \(\Delta W_k\sim\Normal(0,\Delta t)\).
- Strong convergence
- Path-wise accuracy: \(\E|X^{\Delta t}_T-X_T|\le C\,\Delta t^{\gamma}\); Euler has strong order \(\gamma=\tfrac12\).
- Weak convergence
- Distributional accuracy: \(|\E f(X^{\Delta t}_T)-\E f(X_T)|\le C\,\Delta t^{\beta}\); Euler has weak order \(\beta=1\).
- Discretization bias
- The systematic error from replacing the continuous SDE by a finite-step scheme; it does not vanish as \(N\to\infty\) at fixed \(\Delta t\).
- Log-Euler (exact GBM)
- Simulating \(\log S\) with the exact increment \((\mu-\tfrac12\sigma^2)\Delta t+\sigma\sqrt{\Delta t}Z\), which reproduces GBM without bias.
- Milstein scheme
- A refinement adding the \(\tfrac12 b\,b'\big((\Delta W)^2-\Delta t\big)\) term to raise strong order to 1.
Intuition & Motivation
The Euler–Maruyama scheme
Given \(dX_t=a(t,X_t)\,dt+b(t,X_t)\,dW_t\) on \([0,T]\), pick \(n\) steps of size \(\Delta t=T/n\) and iterate
The crucial detail is that the noise scales as \(\sqrt{\Delta t}\), not \(\Delta t\): a Brownian increment over \(\Delta t\) has standard deviation \(\sqrt{\Delta t}\). Getting this wrong destroys the diffusion.
Strong vs weak convergence
Two error notions, two orders:
| Notion | What it measures | Euler order | When it matters |
|---|---|---|---|
| Strong (\(\gamma\)) | Path-wise \(\E|X^{\Delta t}_T-X_T|\) | \(\tfrac12\) | Hedging, path-dependent sensitivities |
| Weak (\(\beta\)) | Distribution \(|\E f(X^{\Delta t}_T)-\E f(X_T)|\) | \(1\) | Pricing (only the payoff’s expectation) |
So halving \(\Delta t\) reduces Euler weak (pricing) bias by about a factor of 2, but path-wise error only by \(\sqrt2\). The Milstein scheme raises the strong order to 1 by adding a correction built from \(b\,b'\).
GBM: exact simulation in log-space
For \(dS=\mu S\,dt+\sigma S\,dW\), Ito’s lemma gives an SDE for \(\log S\) with constant coefficients, which integrates exactly over any step:
This log-Euler scheme has zero discretization bias for GBM (it is the exact solution sampled on a grid) and can never produce a negative price - unlike naive Euler on \(S\) itself, which can step below zero for large \(\sigma\sqrt{\Delta t}\).
Interactive: Euler–Maruyama vs exact GBM
- Scaling the noise by \(\Delta t\) instead of \(\sqrt{\Delta t}\) - the single most common simulation bug; the diffusion then vanishes as the grid refines.
- Confusing statistical error with discretization bias: adding paths tightens the confidence interval around the biased value, not the true one.
- Running naive Euler on \(S\) for GBM and getting negative prices; use the log-scheme, which is exact and positive.
- Reusing the same \(Z\) across time-steps or across the two schemes incorrectly; increments must be independent within a path, but shared between schemes for a fair comparison.
- For pricing you only need weak accuracy - Euler’s weak order 1 is often enough with a modest number of steps.
- Whenever the SDE has a known exact transition (GBM, Ornstein–Uhlenbeck, CIR via non-central \(\chi^2\)), simulate it exactly and skip discretization bias.
- Do a Richardson-style check: halve \(\Delta t\) and confirm the price moves by \(O(\Delta t)\); extrapolate to remove leading bias.
- Vectorize over paths (simulate all at once) rather than looping - orders of magnitude faster in NumPy.
Knowledge Check
Practical Exercise
Consider GBM with \(\mu=0.05,\ \sigma=0.4\) simulated by naive Euler on \(S\) with a single step \(\Delta t=1\). (a) Write the one-step update. (b) For which values of the standard normal \(Z\) does the naive scheme return a negative price, and how does the log-scheme avoid this?
(a) \(S_1=S_0\big(1+0.05\cdot1+0.4\sqrt1\,Z\big)=S_0(1.05+0.4Z)\).
(b) This is negative when \(1.05+0.4Z\lt 0\), i.e. \(Z\lt -2.625\) (about a 0.43% chance). The log-scheme \(S_1=S_0\exp\big((0.05-0.08)\cdot1+0.4Z\big)=S_0e^{-0.03+0.4Z}\) is an exponential, hence strictly positive for every \(Z\), and - because GBM’s log has constant coefficients - it is the exact transition, carrying no discretization bias.
Lesson Summary
Retrieval Practice
Close the lesson and answer from memory before checking. This is deliberate, effortful recall - the single highest-yield study action.
A: \(X_{k+1}=X_k+a\,\Delta t+b\,\Delta W_k\) with \(\Delta W_k=\sqrt{\Delta t}\,Z_k\), \(Z_k\sim\Normal(0,1)\); the noise scales as \(\sqrt{\Delta t}\), not \(\Delta t\).
A: Strong = path-wise \(\E|X^{\Delta t}_T-X_T|\) (Euler order \(\tfrac12\)); weak = distributional \(|\E f(X^{\Delta t}_T)-\E f(X_T)|\) (Euler order 1). Pricing depends on weak convergence.
Completion Checklist
- I can explain the core ideas in my own words
- I worked the derivations/examples by hand
- I completed the interactive workbench(es)
- I passed the knowledge check