Page 1 of 1

Can't get my gamma right via MC simulation

Posted: October 9th, 2006, 5:07 pm
by cougar91
Hi,I am writing a C++ program for MC simulation and don't seem to be able to get my gamma right. I got the price and delta, but the gamma is way off. Can someone tell me what I am doing wrong? Basically for delta I multiply the spot price by 1.01 and for gamma by 1.02. .......... newspot = spot*exp((intrate_ - 0.5*vol*vol)*expiration); deltanewspot = (spot*1.01)*exp((intrate_ - 0.5*vol*vol)*expiration); gammanewspot = (spot*1.01*1.01)*exp((intrate_ - 0.5*vol*vol)*expiration); .... call some function to generate a series of normal RVs .... loop thru the RVs and stored in vector of doubles the different S(T) prices gbmnode.GBMPrice=newspot*exp(voltime*(*rand_iter)); gbmnode.DeltaGBMPrice=deltanewspot*exp(voltime*(*rand_iter)); gbmnode.GammaGBMPrice=gammanewspot*exp(voltime*(*rand_iter)); ... loop thru the different S(T) prices and calculate the payoff for European call running_sum += max((*gbm_iter).GBMPrice - strike, 0); delta_running_sum += max((*gbm_iter).DeltaGBMPrice - strike, 0); gamma_running_sum += max((*gbm_iter).GammaGBMPrice - strike, 0); ... Average and PV the result prices running_sum = (running_sum / NumOfSim_)*exp(-intrate_*expiration); delta_running_sum = (delta_running_sum / NumOfSim_)*exp(-intrate_*expiration); gamma_running_sum = (gamma_running_sum / NumOfSim_)*exp(-intrate_*expiration); Price = running_sum; Delta = (delta_running_sum - running_sum)/(spot*0.01); Gamma = ((gamma_running_sum - delta_running_sum)/(spot*0.01)) - Delta; //I imagine this is where the problem is?The way I think about how to compute gamma is to increase the spot price 1% and then another 1%, calculate the payoff from delta price, the payoff from gamma price, take the difference bettween the two, normalize by 1 and get the second delta , then subtract from it the first delta, thus the change in delta due to spot price increase. What is wrong here?Thx in advance.

Can't get my gamma right via MC simulation

Posted: October 10th, 2006, 10:47 am
by QuantBit
Your problem line looks indeed problematic. A 2nd order finite difference for gamma is v_{n-1} - 2 v_n + v_{n+1}/(0.01²), the v_n correspond to your variables "Price", "Delta", "Gamma". The way I see it, "Gamma" just calculates another delta. In the text you write you take the difference between these two deltas but I don't see that in your code. Also try using centred differences instread of one-sided ones for better accuracy.If you indeed take this difference but encounter strange gammas you may be experiencing noise. First measure the noise by calculating the standard deviation of your gamma and second reduce it by using common random variables or more advanced schemes. Find these in Glasserman and Jäckel.

Can't get my gamma right via MC simulation

Posted: October 10th, 2006, 11:47 am
by Cuchulainn
In general, taking higher-order divided differences demands that the original solution is smooth enough. If note, then things get progressively worse. The problem is well known in other approximaion techniques as well.What data are you using?

Can't get my gamma right via MC simulation

Posted: October 10th, 2006, 7:30 pm
by cougar91
>What data are you using?You mean what kind of RNG am I using? It's Boost MT. I got both of your point about non-linearality of the hedge parameters, thus I shall re-program it to consider both ends and see how that turns out.Another question: I read somewhere that a good MC simulator should converge to theoretical B/S value within a couple of thousand iterations. Is this true?

Can't get my gamma right via MC simulation

Posted: October 11th, 2006, 5:57 am
by mutley
the speed of convergence will depend on the terms of the instrument you're pricing i.e. vol = 0.01, t = 0.1, and S=K this should converge pretty swiftlyvol = 0.5, t = 10.0 and 2*S=K0.5 this should converge pretty slowly

Can't get my gamma right via MC simulation

Posted: October 16th, 2006, 8:36 pm
by mj
gammas are notoriously slow by finite differencing MC, take a larger bump and 10 million paths and see what you get

Can't get my gamma right via MC simulation

Posted: October 19th, 2006, 6:24 am
by ZmeiGorynych
If you want to get the gamma etc with comparatively low number of paths/high precision, you could use likelihood ratio monte carlo instead of bumping and differencing.

Can't get my gamma right via MC simulation

Posted: October 19th, 2006, 12:55 pm
by quantie
well the best way to do gamma with MC is to combine the likelihood ratio method with the pathwise method.. so take the derivative under the density (LRM) and then use pathwise. (derivative wrt payoff)