|
From: Luigi B. <lui...@gm...> - 2010-10-18 09:12:01
|
On Fri, 2010-10-15 at 16:50 +0100, Simon Ibbotson wrote: > I've written some code for generating random numbers for the Gamma > distribution, the Chi-squared distribution and the Non-Central > Chi-Squared distribution but I need to wrap these up into a path > generator for CIR which can then be used for Monte-Carlo pricing. > [...] I don't want to use the InverseCumulativeRsg as inverting the > CIR distribution is really slow compared to sampling from the > Non-Central Chi-Squared. > > So, I'm assuming that (to use the Monte Carlo framework) I need to > create > 1) A CIR sequence generator. > 2) A RNG traits template class which enables the CIR sequence generator > class. > > Is this correct? Or is there something that I've missed? Correct. You can already generate numbers according to your distribution, so just wrap them in a sequence generator and you should be done. Luigi -- Better to have an approximate answer to the right question than a precise answer to the wrong question. -- John Tukey as quoted by John Chambers |