Page 1 of 1

monte carlo convergence question

Posted: June 15th, 2010, 1:23 am
by nuclph
Hi all,I would be interested in your opinion about simple, but still somethingthat i probably do not understand completely.I have nt number of time steps and n simulation, sig=const.For each path at each time step node, I have:nt=1v1 = exp(-sig^2*dt/2 + sqrt(dt)*sig*Z1)) , Zi ~ N(0,1)nt=2v2 = exp(-sig^2*dt/2 - sig^2*dt/2 + sqrt(dt)*sig*Z1 + sqrt(dt)*sig *Z2)nt=kvk = exp(-sig^2/2*SUM(dt) + sig*SUM(sqrt(dt)*Zi))With "enough" number of simulation nsim, I should expect at each time step nt1/n * SUM(v1) ->11/n * SUM(v2) ->1...1/n * SUM(v3) ->1When I increase number of time steps with same number of simulation,we can notice deterioration in convergence.See below simple monte carlo code in matlab. What kind of rule I should/can use in order to be able optimally chose nt(maybe not equally distributed dt nodes) in order to get best convergence to 1 in above settings?Thank you in advance for any comments/suggestions,nuclph.%Matlab code:clear all;nt = 500;T = 5;dt = T/nt;sig = 1;nsim = 50000;%qmc=sobolset(nt,'Skip',1e3);%qmc=net(qmc,nsim);s_mat = -0.5*sig*sig*dt + sig*sqrt(dt)*randn(nt,nsim);%s_mat = -0.5*sig*sig*dt + sig*sqrt(dt)*norminv(qmc,0,1)';s_mat = exp(cumsum(s_mat));mean(s_mat,2)

monte carlo convergence question

Posted: June 15th, 2010, 9:19 am
by Cuchulainn
nuclph,Your SDE is driftless and has a sig == 1. Something similar (?) was discussed hereIn that case, we needed NSIM = 10^15 to price a call.

monte carlo convergence question

Posted: June 15th, 2010, 3:45 pm
by nuclph
Thank you Cuchlainn, Outrun.Antithetic draws make things better.As far as I see, the problem appears as sig^2*T became big. It is a negative drift -0.5sig^2T whichpull down sample mean.Below, couple examples (using antithetic, nsim = 50000)nt=2T=1sig=4 mean = 1.0389 mean = 0.5803 nt = 2T=16sig = 1 mean = 1.3166 mean = 0.7320 Those examples have same -1/2*sig^2T = -8As long as cumulative -1/2*sig^2T big, I am having this issue. Suggested example in the link by Cuchlainnworks for put/call. But if someone need to estimate something different, not just put and call?I would be interesting to know what other practical solution can one have to get more "stable"matrix from simulation of underlying process in the setting when sig^2T > 1 and no drift (r,q=0)outrun> also, shouldn;t you use sum instead of cumsum, maybe that's the issue -you effectively sum twice, getting larger variance-?from GBM setting, we connect any S(i) with S(0). To do it, we need to use cumsum to get right thing at each time step.Please, correct me if i am wrong.cuchlainn>in that case, we needed NSIM = 10^15 to price a call.but 10^15 sim and having nt ~100 not practical, it is impossible to run on "standard" desktop

monte carlo convergence question

Posted: June 15th, 2010, 7:58 pm
by nuclph
hi outrun,thanks. i agree. the solution to this issue would be to use moment matching if i know true expectations. in this case it is 1. i just check P.Glasserman 4.5.1 chapter. then, one can do the following simulation to get a distribution with mean always equal to "theoretical mean". let me know if you have suggestion/comments. thank you nuclph.clear all;nt = 100;T = 4;dt = T/nt;sig = 2.0;nsim = 50000;Zh =randn(nt,nsim/2);Z = [Zh -Zh];s_mat = -0.5*sig*sig*dt + sig*sqrt(dt)*Z;s_mat = exp(cumsum(s_mat));s_expected = 1;w = s_expected ./mean(s_mat,2); % mean along rows, time steps nt% adjust values of simulated paths to match first moments_mat = diag(w) * s_mat;mean(s_mat,2) % mean along rows, time steps nt

monte carlo convergence question

Posted: June 15th, 2010, 8:38 pm
by Costeanu
Hi nuclph,I ran your code and I don't see what the confusion is. The variance of the variable you sample increases with each time step, so the deviation from the analytic mean of 1 increases as well. Best,V.

monte carlo convergence question

Posted: June 15th, 2010, 9:05 pm
by nuclph
hi Costeanu,i see what you mean. if i would have only 1 time step, it seems i need to run much more simulation to converge to theoretical mean if sig^2*T >> 1original idea behind my question was more towards how to overcome this problem if I know theoretical mean which seems to be resolved using matching moments or weighted monte carlo. T = 4;dt = T;sig = 3.0;nsim = 50000;s_mat = -0.5*sig*sig*dt + sig*sqrt(dt)*randn(1,nsim);s_mat = exp(s_mat);mean(s_mat) 0.0759