Day 244 — Simulating an SDE, and measuring the discretisation error
Wednesday, 7 April 2027 · Week 35 of 52 · Derivatives · Study day · 60 min
Every pricing method in week 39 is a simulation, so knowing the error of your integrator, and that it has two different rates depending on what you are measuring, prevents a class of silent inaccuracy.
What you should be able to do tonight
- Implement the Euler-Maruyama scheme and measure its strong and weak convergence rates against the exact solution.
- Say which rate matters for pricing an option and which matters for hedging a path.
Tasks 60 min
35 min Implement the scheme in qlib/derivatives/sde.py and measure both errors against the exact geometric Brownian motion solution: strong error as the mean absolute path difference, and weak error as the difference in the mean of a function of the terminal value. Plot both against the step size on log axes and read off the two slopes.
15 min Say which one you need: pricing depends on the distribution of the terminal value, so weak convergence is what matters and it is the faster of the two rates. Path-dependent hedging depends on the path, so strong convergence matters there and it is slower. Getting this wrong makes people use far smaller steps than they need for a European price.
10 min Implement the exact simulation for geometric Brownian motion too, since it exists, and note that using the exact scheme where one is available removes the question entirely.
Resources
Deliverable
qlib/derivatives/sde.py with Euler-Maruyama and exact schemes, plus measured strong and weak convergence slopes.
Checkpoint
Which convergence rate matters for pricing a European option, and which for simulating a hedging strategy?
Prepare for tomorrow
Ten minutes tonight so Day 245, Thursday, 8 April 2027 starts clean. This is what the evening email sends you.
Reread your derivation of Itô’s lemma and try to reproduce it from a blank page.
Check the arithmetic drill times; tomorrow is the thirty-fifth sitting.
Nothing to install.