Tuesday, June 16, 2015

stochastic processes - Getting the next price of a GBM (Geometric Brownian Motion)


I am writing a program that creates realizations of a GBM.


Starting from an initial price, I get the following price with this formula:


NewPrice = PreviousPrice * Exp(Volatility * N10 * Sqrt(DaysElapsed) + Drift * DaysElapsed)


Where:



  • Volatility is the annual percentage volatility / 100 / sqrt(250)

  • Drift the annual percentage Drift / 100 / 250

  • N01 is a standard normal realization

  • DaysElapsed are the days elapsed from previous price (this is a small fraction in my case)


I am not sure that I am doing this right. Is the above line correct ? Please, suggest the right code expression or other possible corrections. Thank you!



Answer




GBM is defined as St=St1exp((μσ22)dt+σdWt)


So, in your notation, assuming your daily parameters:


Snew=Spreviousexp((driftvolatility22)days+volatilitydaysN(0,1))


So your formula was incorrect. The youtube you quote is only true for 1-year timesteps (while you have days steps).


No comments:

Post a Comment

technique - How credible is wikipedia?

I understand that this question relates more to wikipedia than it does writing but... If I was going to use wikipedia for a source for a res...