December 15th, 2003, 9:23 pm
Thanks for the feedback AVt. You're always helpful on this stuff.The spreadsheet is a conversion of some code I wrote in C++ ...I thought it would expecting a bit too much of people to trawl through my C++, and to then plot the results! ...So I don't *think* it is a problem with the random number generator, as I get the same results in C++.The VBA Rnd() function cycles at around 16,000,000 - but my MC isn't reaching that limit. I don't think Rnd() is autocorrelated, but haven't done the testing - but as I say, I'm getting comparable results with my C++ implementation.My original C++ code was heavily influenced by Gatheral - but I will test his code. For his default settings, he uses about the same number of paths as me (he has 30000 with antithetic variables, I have 50000), but 150 steps instead of my 100 steps. In my C++, I run a lot more paths, but generally keep the steps the same - I'll try increasing these.I've got access to Mathematica, so will try to get things working there.If I'm backed into a corner, then I'll go into the maths!One of the things that MC has to deal with (which Gatheral's code has) is what to do if the variance goes negative. As the stochastic eqns for both dS and dv contain sqrt(v), a negative v is clearly a problem. Gatheral says either reflect (v = -v) or absorb (v=0) when v goes negative. Now, I wonder if this actually causes errors in Monte Carlo.The closed form solution just doesn't have to do this. The fact that Monte Carlo has to deal with it suggests to me that it is more and more of an approximation when it has to start manipulating the results (?)