|
From: Luigi B. <lui...@gm...> - 2010-11-30 16:42:40
|
On Wed, 2010-11-24 at 10:46 +0000, Simon Ibbotson wrote: > Is there any existing way for returning multiple values from a > MonteCarlo simulation? I can’t see a way for any of the existing > pricing engines. No, existing ones don't do that. > As far as I can see, I’d have to: > > Define a different traits (mctraits.hpp) struct which used a > PathPricer<path_type, VECTOR return type>. > > Use a GenericSequenceStatistics<GaussianStatistics> class (instead of > a GenericRiskStatistics<GaussianStatistics> class). True and true. > Then either > > a) Define arithmetic operations for the VECTOR return type or > > b) Write parts of MonteCarloModel specialised (via class > template) for the particular traits class. No, I don't think you need to do that. SequenceStatistics doesn't do statistics on the passed vectors as such, it just maintains a set of 1-D statistics. This part should just work. Let me know how it goes, 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 |