STOCHASTIC CALCULUS 06
Euler–Maruyama Method
Euler–Maruyama is a numerical method for approximating sample paths of stochastic differential equations.
The main idea
Consider the stochastic differential equation
\[ dX_t = a(X_t,t)\,dt + b(X_t,t)\,dW_t. \]Euler–Maruyama approximates its solution on a discrete time grid.
where
\[ \boxed{ \Delta W_n = \sqrt{\Delta t}\,Z_n, \qquad Z_n\sim N(0,1). } \]1. Connection with Euler's method
For an ordinary differential equation
\[ \frac{dX}{dt}=a(X,t), \]Euler's method uses
\[ X_{n+1} = X_n + a(X_n,t_n)\Delta t. \]Euler–Maruyama adds the stochastic contribution
\[ b(X_n,t_n)\Delta W_n. \]2. Choose a time grid
Let
\[ t_n=t_0+n\Delta t. \]The time step is
\[ \Delta t>0. \]We approximate
\[ X(t_n) \]by
\[ X_n. \]3. Brownian increment at each step
For every interval
\[ [t_n,t_{n+1}], \]generate an independent standard normal random variable
\[ Z_n\sim N(0,1). \]Then define
so that
\[ \Delta W_n \sim N(0,\Delta t). \]4. The update step
At time \(t_n\), calculate the drift
\[ a(X_n,t_n) \]and diffusion coefficient
\[ b(X_n,t_n). \]Then calculate
\[ X_{n+1} = X_n + a(X_n,t_n)\Delta t + b(X_n,t_n)\sqrt{\Delta t}\,Z_n. \]5. A simple example
Consider
\[ dX_t = 2\,dt + 0.5\,dW_t, \]with
\[ X_0=1. \]Take
\[ \Delta t=0.04. \]Then
\[ \sqrt{\Delta t}=0.2. \]The Euler–Maruyama update is
\[ X_{n+1} = X_n + 2(0.04) + 0.5(0.2)Z_n. \]Therefore,
6. First numerical step
Suppose the first random number is
\[ Z_0=1.2. \]Then
\[ X_1 = 1+0.08+0.1(1.2). \]So
\[ X_1=1.20. \]Thus,
\[ \boxed{ X(0.04)\approx1.20 } \]7. A different random number gives a different path
Suppose instead
\[ Z_0=-0.8. \]Then
\[ X_1 = 1+0.08-0.08 = 1. \]So even with the same initial condition and parameters, the next value can be different because the Brownian increment is random.
8. Repeat the procedure
At each time step:
Repeating these steps produces one approximate sample path.
9. One simulation gives one realisation
A single sequence
\[ Z_0,Z_1,Z_2,\ldots \]produces one stochastic trajectory.
A different sequence produces another.
10. Many trajectories
To study the distribution of possible outcomes, repeat the simulation many times.
For example, simulate
\[ X_t^{(1)}, \; X_t^{(2)}, \; \ldots, \; X_t^{(M)}. \]These are independent approximate realisations of the same stochastic model.
11. Estimating the expected value
At a chosen time \(t\), the expectation can be estimated by the sample mean:
As the number of independent simulations increases, this Monte Carlo estimate generally becomes more stable.
12. Estimating variance
If
\[ \bar X_t = \frac1M \sum_{m=1}^M X_t^{(m)}, \]then the variance can be estimated by
13. Estimating a probability
Suppose we want
\[ P(X_T>L). \]Count how many simulated trajectories exceed \(L\) at time \(T\).
If \(K\) out of \(M\) simulations exceed the threshold, then
14. Example: threshold exceedance
Suppose
\[ M=10000 \]trajectories are simulated and
\[ 1830 \]finish above a chosen threshold.
Then
\[ P(X_T>L) \approx \frac{1830}{10000} = 0.183. \]So the estimated probability is approximately
\[ \boxed{ 18.3\% } \]15. Visual interpretation
16. The time grid is discrete
Euler–Maruyama calculates values only at
\[ t_0,t_1,t_2,\ldots \]so the numerical output is discrete in time.
But the SDE being approximated is still a continuous-time model.
17. Why the plot appears continuous
A computer usually draws straight lines between the computed values.
These connecting lines are for visualisation only.
They do not mean the numerical method calculated every intermediate time point.
18. Smaller time steps
Using a smaller \(\Delta t\) usually improves the numerical approximation.
But it also requires more calculations and more random increments.
19. Two kinds of numerical accuracy
For stochastic differential equations, it is useful to distinguish two ideas.
Strong convergence concerns how closely a numerical path follows the corresponding true stochastic path.
Weak convergence concerns how accurately the numerical method reproduces quantities such as expectations or probability distributions.
20. Strong order of Euler–Maruyama
Under standard regularity conditions, Euler–Maruyama has strong convergence order
\[ \boxed{ \frac12 } \]for many SDEs.
Very roughly, reducing the step size improves pathwise accuracy at a rate proportional to \((\Delta t)^{1/2}\).
21. Weak order
For sufficiently smooth problems, Euler–Maruyama commonly has weak order
\[ \boxed{ 1 } \]for suitable expectation-type quantities.
So the numerical purpose matters when choosing a method.
22. State-dependent diffusion
Consider
\[ dX_t = \mu X_t\,dt + \sigma X_t\,dW_t. \]Euler–Maruyama gives
or
\[ X_{n+1} = X_n \left( 1+\mu\Delta t + \sigma\sqrt{\Delta t}\,Z_n \right). \]23. Systems of SDEs
Euler–Maruyama also applies to several stochastic state variables.
For example, if
\[ d\mathbf{X}_t = \mathbf{a}(\mathbf{X}_t,t)\,dt + B(\mathbf{X}_t,t)\,d\mathbf{W}_t, \]then
where the components of \(\Delta\mathbf{W}_n\) represent Brownian increments.
24. Epidemic example
Suppose a stochastic epidemic model contains
\[ dI_t = a(S_t,I_t)\,dt + b(S_t,I_t)\,dW_t. \]Then one Euler–Maruyama step is
\[ I_{n+1} = I_n + a(S_n,I_n)\Delta t + b(S_n,I_n)\sqrt{\Delta t}\,Z_n. \]The first contribution gives the deterministic epidemic tendency.
The second introduces stochastic variation around that tendency.
25. Numerical values must remain meaningful
In population models, the state may need to satisfy restrictions such as
\[ I_t\ge0. \]A simple Euler–Maruyama discretisation can sometimes generate negative numerical values even when the intended continuous model is nonnegative.
This is a numerical issue that must be checked rather than ignored.
26. Simulation is not the same as the exact SDE
A simulated Euler–Maruyama path contains two approximations:
and
\[ \boxed{ \text{the numerical update approximates the exact SDE solution} } \]Therefore numerical results should be checked for sensitivity to the chosen step size.
27. A useful convergence check
Run the simulation with
\[ \Delta t, \]then repeat with a smaller step such as
\[ \frac{\Delta t}{2}. \]If important estimated quantities change substantially, the original time step may have been too large.
28. Monte Carlo error is different from time-step error
There are two separate sources of numerical uncertainty:
from the finite time step, and
\[ \boxed{ \text{Monte Carlo sampling error} } \]from using only finitely many simulated trajectories.
Using a smaller time step addresses the first. Using more simulations addresses the second.
29. The practical algorithm
30. The central idea
Euler–Maruyama turns a continuous stochastic differential equation into a step-by-step numerical simulation while preserving the essential Brownian scaling.