Geometric Brownian Motion Stock Price Simulation
Project Overview
This project models and visualizes stock price movements using Geometric Brownian Motion (GBM), one of the most fundamental stochastic processes in financial mathematics. GBM serves as the foundation for the Black-Scholes option pricing model and is widely used for simulating asset price paths in finance.
Geometric Brownian Motion Simulation
Adjust the parameters below to see how they affect the stock price simulations:
There are 252 trading days in a year.
Geometric Brownian Motion Model
Geometric Brownian Motion (GBM) is a continuous-time stochastic process where the logarithm of the randomly varying quantity follows a Brownian motion with drift (Hull, 2017). The stochastic differential equation (SDE) for GBM is:
\[ dS_t = \mu S_t dt + \sigma S_t dW_t \]Where:
\(S_t\) = Stock price at time \(t\)
\(\mu\) = Drift coefficient (expected return)
\(\sigma\) = Volatility coefficient
\(dW_t\) = Increment of a Wiener process (standard Brownian motion)
The solution to this SDE can be expressed in closed form (Hull, 2017) as:
\[ S_t = S_0 \exp\left(\left(\mu - \frac{\sigma^2}{2}\right)t + \sigma W_t\right) \]Discretization for Simulation
For computational purposes, we discretize the GBM equation. Using the continuous-time closed form solution:
\[ S_{t + \Delta t} = S_t \exp \left( \left(\mu - \frac{\sigma^2}{2}\right) \Delta t + \sigma \sqrt{\Delta t} Z \right) \]Where \(Z \sim \mathcal{N}(0,1)\).
Properties of GBM
Log-normality: The future stock price \(S_t\) has a log-normal distribution.
Multiplicative nature: Percentage changes rather than absolute changes are modeled.
No negative values: Stock prices remain positive, consistent with limited liability.
Markov property: Future price movements depend only on the current price, not the past trajectory.
Independent increments: Price changes over non-overlapping time intervals are independent.
Model Limitations
Despite its widespread use, GBM has several limitations as discussed by various researchers (Cont, 2001; Mandelbrot, 1963):
Constant Parameters: Assumes constant drift and volatility, though these may vary over time.
Normal Distribution of Returns: Real market returns often exhibit "fat tails" with more extreme events than predicted by normal distributions.
Continuous Price Paths: Real markets can have gaps and jumps, especially overnight or during news events.
No Mean Reversion: Some assets show tendencies to revert to long-term averages.
No Volatility Clustering: Real markets often show periods of high volatility followed by periods of calm.
Perfect Liquidity: Assumes assets can be traded continuously with no impact on price.
Extensions and Alternatives
To address the limitations of the basic GBM model, several extensions have been proposed:
Jump-Diffusion Models: Incorporate discrete jumps to account for sudden price movements (Merton, 1976). This model is discussed and simulated below.
Stochastic Volatility Models: Allow volatility to evolve stochastically (Heston, 1993).
Regime-Switching Models: Allow parameters to change based on market regimes (Hamilton, 1989).
GARCH Models: Capture volatility clustering in discrete time (Bollerslev, 1986).
Fractional Brownian Motion: Incorporate long-memory dependencies (Mandelbrot & van Ness, 1968).
Merton Jump Diffusion Model Simulation
Below is an interactive simulation using the Merton Jump Diffusion model, which extends the GBM by adding random jumps to better capture sudden market movements:
Average number of jumps per year.
Negative for downward jumps.
Merton Jump Diffusion Model
The Merton Jump Diffusion model (Merton, 1976) extends the Geometric Brownian Motion by adding a jump component to account for sudden, discontinuous changes in asset prices often observed during market shocks or news events. The stochastic differential equation for this model is:
\[ dS_t = (\mu - \lambda k)S_t dt + \sigma S_t dW_t + S_t \left(J_t - 1 \right) dN_t \]Where:
\(S_t\) = Stock price at time \(t\)
\(\mu\) = Drift coefficient (expected return)
\(\sigma\) = Diffusion volatility coefficient
\(W_t\) = Wiener process
\(\lambda\) = Jump intensity (average number of jumps per year)
\(J_t\) = Jump size satisfying \(\ln{J_t} \sim \mathcal{N}(\mu_J, \sigma_J^2)\)
\(k = E[J_t-1] = e^{\mu_J + \frac{\sigma_J^2}{2}} - 1\) = Expected jump size
\(N_t\) = Poisson process representing the number of jumps in time interval \([0, t]\)
There is also a closed form solution to this SDE can be expressed in closed form (Merton, 1976) as:
\[ \begin{align*} S_t &= S_0 \exp\left(\left(\mu - \frac{\sigma^2}{2} - \lambda k\right)t + \sigma W_t \right) \prod_{i = 1}^{N_t}{Y_i} \\ &= S_0 \exp\left(\left(\mu - \frac{\sigma^2}{2} - \lambda k\right)t + \sigma W_t + \sum_{i = 1}^{N_t}{y_i} \right) \end{align*} \]Where \(Y_i\) are the jump sizes, with \(y_i = \ln(Y_i) \sim N(\mu_J, \sigma_J^2)\). Notice that \(\ln{J_t} = \sum_{i=1}^{N_t}{y_i}\) is a compound poisson process.
Discretization for Simulation
For computational implementation, we discretize the Merton Jump Diffusion equation:
\[ S_{t+\Delta t} = S_t \exp \left( \left(\mu - \frac{1}{2} \sigma^2 - \lambda k \right)\Delta t + \sigma\sqrt{\Delta t} Z + Y N \right) \]Where:
\(Z \sim N(0, 1)\) is a standard normal random variable
\(N \sim \text{Pois}(\lambda \Delta t)\)
\(Y \sim \mathcal{N}(\mu_J, \sigma_J^2)\)
References
[1] Black, F., & Scholes, M. (1973). The Pricing of Options and Corporate Liabilities. Journal of Political Economy, 81, 637--654. https://doi.org/10.1086/260062
[2] Bollerslev, T. (1986). Generalized autoregressive conditional heteroskedasticity. Journal of Econometrics, 31, 307--327. https://doi.org/10.1016/0304-4076(86)90063-1
[3] Cont, R. (2001). Empirical properties of asset returns: stylized facts and statistical issues. Quantitative Finance, 1, 223--236. https://doi.org/10.1080/713665670
[4] Hamilton, J. D. (1989). A New Approach to the Economic Analysis of Nonstationary Time Series and the Business Cycle. Econometrica, 57, 357. https://doi.org/10.2307/1912559
[5] Heston, S. L. (1993). A Closed-Form Solution for Options with Stochastic Volatility with Applications to Bond and Currency Options. Review of Financial Studies, 6, 327--343. https://doi.org/10.1093/rfs/6.2.327
[6] Hull, J. C. (2017). Options, Futures, and Other Derivatives.
[7] Mandelbrot, B. (1963). The Variation of Certain Speculative Prices. The Journal of Business, 36, 394. https://doi.org/10.1086/294632
[8] Mandelbrot, B. B., & Van Ness, J. W. (1968). Fractional Brownian Motions, Fractional Noises and Applications. SIAM Review, 10, 422--437. https://doi.org/10.1137/1010093
[9] Merton, R. C. (1976). Option pricing when underlying stock returns are discontinuous. Journal of Financial Economics, 3, 125--144. https://doi.org/10.1016/0304-405x(76)90022-2