Login  Register

Update version of experimental/mcbasket

Posted by andrea-110 on Oct 10, 2009; 3:39pm
URL: http://quantlib.414.s1.nabble.com/Update-version-of-experimental-mcbasket-tp9167.html

Hi,

After almost 2 year I would like to post an updated version of mcbasket experimental.
The idea is still the same as the initial version: i.e. have one single engine (here
MCAmericanPathEngine or MCPathBasketEngine) and to only have to write a new option/payoff
(PathMultiAssetOption/PathPayoff)

Here the biggest new feature is the support of American Options.

The key feature is this virtual method of PathPayoff

         virtual void value(const Matrix       & path,
                            Array              & payments,
                            Array              & exercises,
                            std::vector<Array> & states) const = 0;

which has to return all information needed to value a payoff with early exercise (for a single path)

path: is the path of all assets/times
payments: all payments made
exercises: if the option is exercised at time i, all payment up to (and including i) are preserved
and the others cancelled
states: a vector of financial coordinates used in LS

I have attached a diff wrt the most recent svn and an example of an American Lookback.

I can go through all the code in details if people are interested.

I don't think it makes much sense to compare it to the 1st version, since it was very limited in
features and hardly usable at all.

TODO, problems, bugs:

- I had to copy&paste a lot of classes/templates already used in QL (e.g.: EarlyExercisePathPricer,
LongstaffSchwartzPathPricer). My problem is that the existing EarlyExercisePathPricer only seems to
handle an option which pays only once (i.e. at exercise), while I wanted to allow an option that
pays many times and that I can cancel at some point

- allow for non 1-1 mapping between paths and assets (e.g. stoch vol)

- allow for non deterministic interest rates (i.e. replace the discount factors with 1/numeraire)

- find nicer names

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev

example.cpp (7K) Download Attachment
ql.diff.gz (12K) Download Attachment