Serving the Quantitative Finance Community

 
User avatar
barny
Topic Author
Posts: 0
Joined: May 8th, 2007, 6:55 pm

Risk-neutral random walk monte carlo simulation

September 22nd, 2015, 10:53 am

If we assume a risk-neutral random walk for an underlying [$] S [$] to be [$]dS = rS dt + \sigma S dX[$] then an obvious discretised monte-carlo algorithm for simulating this is:[$] S(t+\Delta t) = r S(t) \Delta t + \sigma S(t) \sqrt{\Delta t} \phi [$] where [$]\phi[$] is drawn from a normal distribution. However, every google search has revealed the following algorithm for the time-stepping:[$] S(t+\Delta t) = S(t) e^{((r-\frac{1}{2}\sigma^2) \Delta t + \sigma \sqrt{\Delta t} \phi)}[$]I understand how to get the second equation, but what I wonder is what is wrong with the first? Why does nobody ever simulate a risk-neutral random walk using the first?
Last edited by barny on September 21st, 2015, 10:00 pm, edited 1 time in total.
 
User avatar
LocalVolatility
Posts: 13
Joined: May 27th, 2009, 10:07 am
Location: Amsterdam
Contact:

Risk-neutral random walk monte carlo simulation

September 22nd, 2015, 12:17 pm

The first discretization generates normally distributed [$]S_t[$] (i.e. it can become negative). The second is equivalent to discretizing the SDE for [$]\ln \left( S_t \right)[$] which follows a constant coefficient arithmetic Brownian motion and thus there is no discretization error.
 
User avatar
pcaspers
Posts: 30
Joined: June 6th, 2005, 9:49 am
Location: Germany

Risk-neutral random walk monte carlo simulation

September 22nd, 2015, 2:03 pm

no, the first generates a lognormal S(t) as well, it is the plain Euler discretization of S, though it has a stochastic drift requiring small time steps (and S might become negative for numerical reasons).
 
User avatar
list1
Posts: 827
Joined: July 22nd, 2015, 2:12 pm

Risk-neutral random walk monte carlo simulation

September 22nd, 2015, 2:37 pm

It seems you lost term - S ( t ) on the left hand side of the first equation. There is a difference between using discretization of S or discretization of the SDE which specifies S. First approximates solution of the SDE , second approximates SDE. Both of them lead to stepwise approximation of the S. And the difference is probably o ( delta t )
 
User avatar
Cuchulainn
Posts: 22933
Joined: July 16th, 2004, 7:38 am

Risk-neutral random walk monte carlo simulation

September 22nd, 2015, 5:37 pm

Would it be an idea to write the SDE as a stochastic integral equation SIE and move it from there? QuoteIt seems you lost term - S ( t ) on the left hand side of the first equation. Indeed Having a SIE we can write it as a combination of Riemann and Ito integrals let's say on an interval [t, t + d] using numerical integration which is more intuitive and robuster than the SDE form?
Last edited by Cuchulainn on September 22nd, 2015, 10:00 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Posts: 22933
Joined: July 16th, 2004, 7:38 am

Risk-neutral random walk monte carlo simulation

September 23rd, 2015, 12:05 pm

QuoteOriginally posted by: list1It seems you lost term - S ( t ) on the left hand side of the first equation. There is a difference between using discretization of S or discretization of the SDE which specifies S. First approximates solution of the SDE , second approximates SDE. Both of them lead to stepwise approximation of the S. And the difference is probably o ( delta t )A SDE is only a symbolic representation of a stochastic integral equation, consisting of Riemann integral + Ito integral as mentioned. An SDE is just symbols.And most classical FD schemes (e.g. Euler) are awful numerical approximations.QuoteAnd the difference is probably o ( delta t)This is not true. The small o is wrong. And "difference" is ill-defined concept.Example: (norm) Convergence can be weak or strong, each one leading to a different O(dt^p) (BIG O). p can take on values like 1 or 1/2.
Last edited by Cuchulainn on September 22nd, 2015, 10:00 pm, edited 1 time in total.
 
User avatar
list1
Posts: 827
Joined: July 22nd, 2015, 2:12 pm

Risk-neutral random walk monte carlo simulation

September 23rd, 2015, 2:30 pm

When mathematicians talk about SDE it always implies it in integral form tough discrete time form makes sense.The difference between integral SDE and its finite difference approximation calculated straightforward by making its difference. The simple way is consider mean squared difference ( Sorry I missed that ) and we arrive at o( [$]\Delta t[$] )
Last edited by list1 on September 22nd, 2015, 10:00 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Posts: 22933
Joined: July 16th, 2004, 7:38 am

Risk-neutral random walk monte carlo simulation

September 23rd, 2015, 2:45 pm

QuoteOriginally posted by: list1The simple way is consider mean squared difference ( Sorry I missed that ) and we arrive at o( [$]\Delta t[$] )What do you mean o(dt) difference? (really)
Last edited by Cuchulainn on September 22nd, 2015, 10:00 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Posts: 22933
Joined: July 16th, 2004, 7:38 am

Risk-neutral random walk monte carlo simulation

September 24th, 2015, 1:34 pm

The Euler-Maruyama can diverge for MLMC A bit hit and miss..
 
User avatar
list1
Posts: 827
Joined: July 22nd, 2015, 2:12 pm

Risk-neutral random walk monte carlo simulation

September 29th, 2015, 9:21 pm

QuoteOriginally posted by: CuchulainnQuoteOriginally posted by: list1The simple way is consider mean squared difference ( Sorry I missed that ) and we arrive at o( [$]\Delta t[$] )What do you mean o(dt) difference? (really)Cuchulainn, sorry for delay. I did not have enough time to answer. I also did not find books or papers to refer. I tried to make a sketch of derivation to present order of convergence solution of Euler scheme to correspondent solution of the continuous SDE. I should say that squared mean convergence is O ( dt ), ie [$]E | S ( t ) - S_\delta ( t ) | ^ 2 < C \Delta t [$]. If you interested to look on this sketch I could send it to you.
Last edited by list1 on September 28th, 2015, 10:00 pm, edited 1 time in total.
 
User avatar
barny
Topic Author
Posts: 0
Joined: May 8th, 2007, 6:55 pm

Risk-neutral random walk monte carlo simulation

September 30th, 2015, 6:41 pm

As a general aside, does anyone have any numbers on how long it takes in their pet language to generate e.g. 1 million such walks? In my python code it takes around 1 minute for a million.
 
User avatar
Cuchulainn
Posts: 22933
Joined: July 16th, 2004, 7:38 am

Risk-neutral random walk monte carlo simulation

September 30th, 2015, 8:11 pm

QuoteOriginally posted by: barnyAs a general aside, does anyone have any numbers on how long it takes in their pet language to generate e.g. 1 million such walks? In my python code it takes around 1 minute for a million.It depends on the language and whether serial or parallel. Python is probably slow, but I don't know. Example: MLMC has a speedup on GPU in the range [10,190] compared to CPU. OpenMP and PPL are similar because problem is embarrassingly parallel.
Last edited by Cuchulainn on September 29th, 2015, 10:00 pm, edited 1 time in total.