I am trying to write a simple GBM simulator. Unfortunately, the task has turned rather difficult.
The first approach I looked into was the most obvious. I could use the analytic solution for the GBM found here:
$S_t = S_0exp((\mu - \frac{\sigma^2}{2})t + \sigma W_t)$
This is relatively straight-forward in implementation except the $W_t$, the $t$-th observation from a brownian process. Following the direction of this tutorial on brownian motion left me lost as to it's implementation. It seemed to be:
- Simulate a brownian process from $W_0$ to $W_t$
- For each $x$ from $0$ to $t$ use $W_x$ to solve for $S_x$
This seemed excessively complicated compared to what I remembered from doing simulations a few years back. Stumbling on this article I came across an interesting formula I've seen before:
$\frac{\Delta S}{S} = \mu \Delta t + \sigma \epsilon \sqrt{\Delta t}$
Where $\epsilon$ is a shock drawn from the standard normal distribution $N(0, 1)$. $\Delta t$ is obviously the change in time from $S_t$ to $S_{t + \Delta t}$. Perhaps for daily data $\Delta t = 1$. This is a little closer to what I remember - though there's no brownian component here - $W_t$. Where did it go?
I am unsure which of these I should use that would be more correct. Currently I'm relearning stochastic calculus after many years and am inclined to use the SDE (if I could figure out how to simulate brownian motion easily!). However, the simpler second solution intrigues me as well if I could figure out how it is derived.