Skip to content
All library documents

Why GBM Price Medians Must Be Measured at a Fixed Time

Article Quant Q&A · Author: Robert

Summary

The document examines a simulation of stock prices under geometric Brownian motion with zero drift. Although each simulated price at a fixed horizon has a lognormal distribution, the author finds that taking the median across all time steps produces a value below the initial price and wonders whether the simulation is incorrect.

The response explains that the median should be calculated across many simulated paths at one chosen time point. Pooling prices from different times combines distributions with different horizons into a mixture, whose median need not equal the initial value. The stated result that the fixed-time median equals the initial price follows from the chosen zero drift in log-price under the simulation setup. The answer identifies the sampling comparison as the issue, though it gives no additional diagnostic of the MATLAB implementation or discussion of finite-sample variation.

Key ideas

  • A GBM price at a particular time has a lognormal distribution under the stated simulation.
  • Compare simulated prices across paths at one fixed time to study that time’s distribution.
  • Pooling prices from multiple time steps mixes distributions with different horizons and can shift the median.
  • The response attributes the discrepancy to how the sample is assembled rather than to the simulation formula.

Tags

Full text
# Median value for geometric brownian motion simulation


# Median value for geometric brownian motion simulation












I'm trying to simulate stock prices using GBM. I am using the following formula, and MATLAB function, to determine the stock prices:

$\nu = \mu - \frac{\sigma^{2}}{2}$;

$S = S0*\text{[ones(1,nsims); ... cumprod(}\exp(\nu dt+\sigma \sqrt{dt}*\text{randn(steps,nsims))},1)];$

using the following parameters:

$S0 = 1,$ $\mu = 0,$ $\sigma = 0.2481,$ $dt = 1/365,$ $\text{steps} = 365,$ $\text{nsims} = 1000.$

When I use this to generate the stock prices the results look log-normal and the log of the returns from the first to last price is also normal.

The issue I am having is that with no drift the median should be 1 according to http://en.wikipedia.org/wiki/Log-normal_distribution#Mode_and_median, but I am consistently getting values less than 1.

I am not sure what is going on or if I am simulating incorrectly.

This is my first time posting so please let me know if I have done anything incorrectly.

Thank you.

## Answer by Rusan Kax (score 1)

https://quant.stackexchange.com/a/15912

You are generating a price series, in time steps $p_{dt},p_{2dt},p_{3dt},...$. I assume? So if you do $\text{Median}\{p_{dt},p_{2dt},p_{3dt},..\}$ then you will get a value biased towards $0$ (for the parameters you gave, and the sample size you have).

If you want to look at the distributional characteristics of the price, then you have to do so per each $p_{i \times dt}$, for a single $i$. So you create your price series, then isolate a particular $p_{i \times dt}$ and look at the distribution of that, over many samples.

So $\text{Median}\{p_{i\times dt}\}$ is equal to 1 (for all $i$).

If look at $\text{Median}\{p_{dt},p_{2dt},p_{3dt},..\}$ you are simply getting the median of a log-normal mixture distribution (with a really small sample size), which I guess is not what you want.

p.s. you should use latex on this site.

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.