Phase 13 - Lesson 13.4

Simulating Sample Paths and Discretization (Euler–Maruyama)

Turning an SDE into a computable path, and the difference between strong and weak accuracy.

⏱ 55 min● Advanced🔗 Prereqs: 13.1–13.2, SDEs (Phase 9)
↖ Phase 13 hub
Builds on: Phase 9 solved GBM exactly; here we discretize general SDEs when no closed form exists.

Learning Objectives

Click a status chip to cycle: Not started → In progress → Studied → Practiced → Needs review → Mastered.

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

Intuition
An SDE \(dX=a(X)\,dt+b(X)\,dW\) is a recipe for an infinitesimal step. To simulate it, chop \([0,T]\) into \(n\) slices and take that step \(n\) times - replacing \(dt\) by \(\Delta t\) and \(dW\) by a fresh \(\Normal(0,\Delta t)\) increment. That is Euler–Maruyama. Two very different questions of accuracy arise: do we want each simulated path to hug the true path (strong convergence), or just the distribution of the endpoint to be right for pricing (weak convergence)? Pricing only needs the weaker notion - good news, because Euler’s weak order (1) beats its strong order (\(\tfrac12\)). And when the SDE is GBM, we can skip discretization bias entirely by stepping in log-space.

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

\[X_{k+1}=X_k+a(t_k,X_k)\,\Delta t+b(t_k,X_k)\,\Delta W_k,\qquad \Delta W_k=\sqrt{\Delta t}\,Z_k,\ \ Z_k\sim\Normal(0,1).\] (13.12)

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:

NotionWhat it measuresEuler orderWhen 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'\).

Key Idea
Two distinct errors coexist in a simulated price: statistical error \(\sigma/\sqrt N\) (shrinks with more paths) and discretization bias \(O(\Delta t)\) (shrinks only with more time-steps). Adding paths never removes the bias; you must also refine \(\Delta t\).

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:

\[\log S_{k+1}=\log S_k+\Big(\mu-\tfrac12\sigma^2\Big)\Delta t+\sigma\sqrt{\Delta t}\,Z_k.\] (13.13)

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}\).

Worked Example - One Euler step vs one exact step for GBM
1
Naive Euler on \(S\): \(S_{k+1}=S_k(1+\mu\Delta t+\sigma\sqrt{\Delta t}Z_k)\) - can be negative if \(\sigma\sqrt{\Delta t}Z_k\lt -1\).
2
Log-Euler: \(S_{k+1}=S_k\exp\big((\mu-\tfrac12\sigma^2)\Delta t+\sigma\sqrt{\Delta t}Z_k\big)\) - always positive.
3
On the same \(Z_k\), the two agree to \(O(\Delta t)\) (Taylor-expand the exponential).
4
Over a full path with shared increments, log-Euler matches the exact GBM terminal law exactly; naive Euler carries an \(O(\Delta t)\) bias.

Interactive: Euler–Maruyama vs exact GBM

Common Mistakes to Avoid
  • 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.
Quant Practitioner Tips
  • 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

Q1 Easy
In Euler–Maruyama the Brownian increment over a step \(\Delta t\) is drawn as:
\(\Delta t\,Z\)
\(\sqrt{\Delta t}\,Z\)
\((\Delta t)^2 Z\)
\(Z\)
Q2 Medium
For pricing a European option by simulation, which convergence notion is the relevant one?
Strong (path-wise)
Weak (distribution of the terminal value)
Neither
Both must be order 2
Q3 Medium
Adding more Monte Carlo paths at a fixed time-step \(\Delta t\) will:
Remove the discretization bias
Shrink the statistical error but leave the discretization bias
Increase the bias
Have no effect on either error

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?

▶ Show full solution

(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.

After the reveal, answer for yourself: With \(n=250\) daily steps instead of one, does the negative-price probability per step rise or fall, and why?

Lesson Summary

Euler–Maruyama turns an SDE into a computable path by replacing \(dt\to\Delta t\) and \(dW\to\sqrt{\Delta t}\,Z\). It has strong order \(\tfrac12\) (path-wise) and weak order 1 (distributional); pricing needs only the weak notion. A simulated price carries both statistical error \(\sigma/\sqrt N\) and discretization bias \(O(\Delta t)\) - different errors requiring different fixes. For GBM, the exact log-scheme eliminates the bias and guarantees positivity.

Retrieval Practice

Close the lesson and answer from memory before checking. This is deliberate, effortful recall - the single highest-yield study action.

▶ Show retrieval prompts & answers
Q: State the Euler–Maruyama update and the correct noise scaling.
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\).
Q: Distinguish strong and weak convergence and give Euler’s orders.
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

Confidence / mastery rating
Personal notes

Source References

This lesson synthesizes and paraphrases concepts from the sources below. No copyrighted text, problem sets, or solutions are reproduced. Return to the originals for full depth.