Why Euler Error Must Be Compared on Shared Brownian Paths
Summary
The document investigates why the root mean squared error of an Euler simulation of geometric Brownian motion appeared to increase as the number of time steps rose. The simulation compared the Euler endpoint with an endpoint generated from the exact geometric Brownian motion formula. However, the two endpoints were driven by independent random draws, so their difference included random path variation as well as discretization error.
The answer identifies the mismatch and says to use the same Brownian increments for both the Euler approximation and the exact solution. This couples the simulated paths, allowing the measured difference to reflect the discretization error more directly; after this correction, the author reports that the error decreases with finer steps. The example illustrates that numerical error comparisons for stochastic processes require matched randomness. It does not present convergence rates, confidence intervals, or a broader analysis across schemes, parameters, or error measures.
Key ideas
- The example compares an Euler approximation of geometric Brownian motion with its exact solution.
- Independent random increments in the two paths obscure the discretization error.
- The Euler and exact endpoints should use the same underlying Brownian increments for a meaningful pathwise comparison.
- The author reports that the measured error decreases after matching the increments.
- The example does not estimate convergence rates or compare alternative discretization schemes.
Tags
Full text
# Why is my Euler discretization error increasing with number of steps?
# Why is my Euler discretization error increasing with number of steps?
I'm trying to see how the Euler discretization error behaves with respect to the number of steps. To do this I'm simulating a geometric brownian motion and comparing it with it's 'exact' solution. However when using the root mean squared error as a measure of the error it is increasing with the number of steps, which is very weird! So now I'm confused if I made a coding error or I'm just missing something. Help would be appreciated!
Here is my matlab code, I hope it is self explanatory. (The problem is that the elements of meanvec are increasing while it is expected they decrease)
```
X0=100;
mu=0.04;
sigma=0.2;
T=10;
M=10^5;
meanvec=zeros(6,1);
for i=1:6
N=2^i;
dt=T/N;
t=0;
X=X0;
for k=1:N
dW = sqrt(dt)*randn(M,1);
dX = mu*X*dt + sigma*X.*dW;
X = X + dX;
t = t + dt;
end
Y=100.*exp((mu-sigma^2/2)*T+sigma.*sqrt(T).*randn(M,1));
meanvec(i)=sqrt(mean((X-Y).^2))/mean(Y);
end
```
## Answer by frank (score 1)
https://quant.stackexchange.com/a/20813
After thinking about it a bit more I realized what the problem is. Y is generated with different increments than X, while I should use the same. I fixed this and know it is decreasing.Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.