|
From: animesh s. <ani...@gm...> - 2010-09-16 09:58:11
|
Also FYI convergence diagram for my code (3 Asset basket option) with Stochastic Vol (less than 30 seconds to price) http://quantanalysis.files.wordpress.com/2010/09/091510_2334_montecarlob101.jpg On 9/16/10 3:25 PM, animesh saxena wrote: > Hi Luigi, > Thanks for your mail. I think I might have tried Mersenne > twister (from sample code), coz the sequence gave my code convergence > issues. I initially went with my own implementation of Halton sequence > to improve the convergence, but well Sobol is much much better :) > > I had used Cholesky decomposition for generating correlated random > numbers. Using some of the code from QuantLib I am able to generate an > N dimension array. If I have this huge array I can use it for pricing > almost any exotic (by repeating the simulations). All that changes is > the payoff function. For instance Heston model combined with Path > generation can be used for pricing almost any exotic structure (well > majority of them). I still am trying to think of how to make the > payoff specification generic. > > So is it possible to have a generic pricer in QuantLib which will > allow the user to specify a PayOff function using the multi path > generated above? I think it can be pretty useful. Coz currently as you > mentioned we have Engines tightly coupled with Exotic Options and > Processes. > > Let me know your views on that. > > Thanks, > > Animesh > On 9/16/10 2:57 PM, Luigi Ballabio wrote: >> On Thu, 2010-09-16 at 13:19 +0530, animesh saxena wrote: >>> What is the method used for Random number generation in QuantLib for >>> Monte Carlo Simulations (for instance Heston Model)? >>> Is it Mersene Twister or something else? >> It depends on the traits you choose when you instantiate the engine. >> For the PseudoRandom traits, it's Mersenne Twister. For LowDiscrepancy, >> it's Sobol. If you want something else, you can make a new traits class >> and use that one; look at<ql/math/randomnumbers/rngtraits.hpp> and >> <ql/methods/montecarlo/mctraits.hpp> for examples and details. >> >> Luigi >> >> > -- Regards, Animesh Saxena (http://quantanalysis.wordpress.com) Ph: (+91)9920098221 |