This is a tutorial code which demonstrates comparison of the below 3 methods to find delta of a plain vanilla call option using monte carlo simulations:
1. Finite difference using forward difference scheme
2. Finite difference using crank nicholson scheme
3. Pathwise derivative method suggestd by formula in Glasserman's paper
Following is an output of the reslut:
octave-3.1.50.exe:53> mcblack
analytical_delta = 0.76307
avg_finitediff_delta_CN = 0.76080
avg_finitediff_delta_Fwd = 0.76091
avg_pathwise_delta = 0.76079
variance_pathwise_delta = 2.6992e-004
variance_finitediff_delta_CN = 2.7027e-004
variance_finitediff_delta_Fwd = 2.7011e-004
Points to note from the results:
- avg_finitediff_delta_Fwd is biased higher, which matches with the explanation
- crank nicholson gives better values than forward difference scheme, since it is closer to analytical value
- variance of delta calculated using crank nicholson increases when FD step size (h) is decreased
PS : Following file is needed to compare analytical result:
http://www.quantcode.com/modules/docmanager/view_file.php?curent_file=407&curent_dir=19