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.