Simulating Geometric Brownian Motion with Discrete Steps and Its Closed Form
Summary
The document compares two ways to simulate a stock price under geometric Brownian motion (GBM). The first uses stepwise percentage changes driven by drift, volatility, and normal random draws. The accepted response describes this as a discretization that generates intermediate prices along a simulated path. The second expression gives the GBM price at a chosen time as an exponential function of the initial price, drift, volatility, and Brownian motion; it specifies a random endpoint without by itself laying out the intervening values.
A second response derives the exponential form by applying Itô’s lemma to the logarithm of a GBM price, producing the volatility adjustment in the log drift. The document also includes a response that discusses risk-neutral pricing, but its claims about the closed form and downward drift are not reconciled with the other explanations. The treatment is therefore not fully consistent. It does not provide a worked simulation comparison or clarify whether parameters are under the real-world or risk-neutral measure, both of which matter for choosing the drift.
Key ideas
- A stepwise GBM simulation generates intermediate prices using discrete random increments.
- The exponential solution describes the random price at a chosen time from an initial value.
- Applying Itô’s lemma to the log price produces the volatility adjustment in the drift.
- The document does not consistently distinguish real-world and risk-neutral drift assumptions.
Tags
Full text
# How to simulate stock prices with a Geometric Brownian Motion?
# How to simulate stock prices with a Geometric Brownian Motion?
I want to simulate stock price paths with different stochastic processes. I started with the famous geometric brownian motion. I simulated the values with the following formula:
$$R_i=\frac{S_{i+1}-S_i}{S_i}=\mu \Delta t + \sigma \varphi \sqrt{\Delta t}$$
with:
$\mu= $ sample mean
$\sigma= $ sample volatility
$\Delta t = $ 1 (1 day)
$\varphi=$ normally distributed random number
I used a short way of simulating: Simulate normally distributed random numbers with sample mean and sample standard deviation.
Multiplicate this with the stock price, this gives the price increment.
Calculate Sum of price increment and stock price and this gives the simulated stock price value. (This methodology can be found here)
So I thought I understood this, but now I found the following formula, which is also the geometric brownian motion:
$$ S_t = S_0 \exp\left[\left(\mu - \frac{\sigma^2}{2}\right) t + \sigma W_t \right] $$
I do not understand the difference? What does the second formula says in comparison to the first? Should I have taken the second one? How should I simulate with the second formula?
## Answer by SRKX (score 32, accepted)
https://quant.stackexchange.com/a/4591
The way you do it in the first place is a discretization of the Geometric Brownian Motion (GBM) process. This method is most useful when you want to compute the path between $S_0$ and $S_t$, i.e. you want to know all the intermediary points $S_i$ for $0 \leq i \leq t$.
The second equation is a closed form solution for the GBM given $S_0$. A simple mathematical proof showed that, if you know the initial point $S_0$ (which is $a$ in your equation), then the value of the process at time $t$ is given by your equation (which contains $W_t$, so $S_t$ is still random). However, this method will not tell you anything about the path.
As mentioned in the comments below, you can also use the close form to simulate each step of the paths.
## Answer by Malick (score 14)
https://quant.stackexchange.com/a/10072
To complement @SRKX comment ,i'll try to explain the "simple mathematical proof" beetween both formula : I assume you know the geometric or arithmetic brownian motion :
Geometric: \begin{equation*} dS = \mu S dt + \sigma Sdz \end{equation*} Arithmetic : \begin{equation*} dS = \mu dt + \sigma dz \end{equation*}
Then another important stochastic tool you need to know is the so called Ito Lemma : Loosely speaking, if a random variable $x$ follows an Ito process : (drift = $ a(x,t) $ et variance = $ b(x,t)^{2} $):
\begin{equation*} dx = a(x,t) dt + b(x,t) dz \end{equation*} Then another function $G$ which depends of $x$ and $t$ will respect also (ito lemma) the following process : \begin{equation*} dG = (\frac{\partial G}{\partial x}a + \frac{\partial G}{\partial t}+ \frac{1}{2}\frac{\partial^{2} G}{\partial x^{2}} b^{2}) dt + \frac{\partial G}{\partial x} bdz \end{equation*}
If we replace $x$ by the stock price and take its logarithm: $ G = ln(S)$. We also know : \begin{equation*} dS = \mu S dt + \sigma Sdz \end{equation*} then $ a = \mu S $ et $b = \sigma S $ and \begin{equation*} \frac{\partial G}{\partial S} =\frac{1}{S}, \frac{\partial^{2} G}{\partial S^{2}} = - \frac{1}{S^{2}},\frac{\partial G}{\partial t} =0 \end{equation*} using Ito lemma : \begin{equation*} dG = (\mu - \frac{\sigma^{2}}{2})dt + \sigma dz \end{equation*} Thus if we investigate the variation of $ln(S)$ (=G) between date zero and date $T$ : \begin{equation*} ln(S_{T})-ln(S_{0}) \sim \phi[(\mu - \frac{\sigma^{2}}{2})T, \sigma \sqrt{T}] \end{equation*} \begin{equation*} ln(S_{T}) \sim \phi[ln(S_{0})+(\mu - \frac{\sigma^{2}}{2})T, \sigma \sqrt{T}] \end{equation*} If we integrate : \begin{equation*} S(t) = S(0) \exp{(\mu - \frac{\sigma^{2}}{2})t + \sigma (z(t)-z(0))} \end{equation*} or \begin{equation*} S(t) = S(0) \exp{(\mu - \frac{\sigma^{2}}{2})t + B_{t}} \end{equation*} where $ B_{t} $ is a brownian motion.
## Answer by foobar (score 2)
https://quant.stackexchange.com/a/16808
They won't be the same.
If you run a discrete simulation you will get the actual (or an instance of an actual path) price process for the future value of the stock using the real probability measure.
If you do the same thing using the closed form solution, the path will look very similar but will drift downwards.
Why are they different?
To see it easily, build a spreadsheet model with a graph that shows both the real and the modeled path (the latter being the one with $e^{r-\sigma^2/2)}$. Then plug in maybe 5% for $r$ (or $\mu$, they are the same). Then run it using $\sigma=0$ and perhaps $\sigma=40\%$.
It will be clear that with no risk ($\sigma=0$) the path is just $S_t=B_0e^{rt}$, where $B_0$ is the price of the bond at time $t=0$. It drifts up in value to return the risk free rate over a single period (a year). This makes sense.
However, with $\sigma=40\%$ the modeled price process for a stock that starts at price $B_0$ drifts downwards.
The whole point of a risk-neutral measure and model is that you discount future amounts by the risk-neutral, or risk-free, rate. It doesn't make that real, or make the stock's expected return the same as a bond. It just makes it consistent.
So imagine a stock with an initial price of $S_0$. If the stock has a higher risk than the bond (which it must) and investors in equilibrium have bid the price to a point so it is expected to have a return greater than the bond to compensate for the risk, it must be that the stock is priced a discount to the bond if investors expect the future value to be equal. Thus, if investors expect $B_{t=1}=S_{t=1}$then $S_0<B_0$. In essence, the stock is priced today at a discount to the bond.
The closed-form solution does everything in risk-neutral space. So if we start with $S_0=B_0$ the bond trajectory of price $B_t$ must discount back to $B_0$ when the risk-free rate is used. As a result the future value of the stock at the same time must be below $B_t$ so that it discounts back to a lower value at $t=0$ using $r$ as the discount rate to earn a return that compensates for the risk.
Simply, if you 'roll forward' a simulation the stock will outperform the bond on average, but if you see a price model under risk-neutrality the path must be such that when you discount future values to today they must give you a fair value today for the stock.
This is a bit of mathematical sleight of hand but it all works out the same. So, for example, if $B_0=100$ and $r=5%$ the future value of the bond in one year is 105, and its present value is 100. But the future value of the stock must look like a smaller number (say, perhaps, 94) so that the price today, $S_0$, is maybe 89 or some such.
The closed form solution does not give you the actual price model. It gives you a future price model that allows you to price a stock as if the risk-free rate can be used to discount the future value to get the right present value. They are really the same model just expressed differently.
## Answer by Yanyi Yuan (score 1)
https://quant.stackexchange.com/a/44333
https://en.wikipedia.org/wiki/It%C3%B4%27s_lemma
Formula is derived from Ito Lemma. The correction term of − σ2/2 corresponds to the difference between the median and mean of the log-normal distribution, or equivalently for this distribution, the geometric mean and arithmetic mean, with the median (geometric mean) being lower. This is due to the AM–GM inequality, and corresponds to the logarithm being convex down, so the correction term can accordingly be interpreted as a convexity correction. This is an infinitesimal version of the fact that the annualized return is less than the average return, with the difference proportional to the variance. See geometric moments of the log-normal distribution for further discussion.
The same factor of σ2/2 appears in the d1 and d2 auxiliary variables of the Black–Scholes formula, and can be interpreted as a consequence of Itô's lemma.
## Answer by NPQ (score 0)
https://quant.stackexchange.com/a/41823
Geometric Brownian motion is simply the exponential (this's the reason that we often say the stock prices grows or declines exponentially in the long term) of a Brownian motion with a constant drift. Therefore, you may simulate the price series starting with a drifted Brownian motion where the increment of the exponent term is a normal distribution. Or equivalently, you may directly use the close-form of the GBM for the price simulation such that the relative increment (i.e. ratios of consecutive days) is a lognormal distribution. I had an article on on GBM and its applications, where you download a Matlab code to do the simulations using the two methods.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.