|
From: Andrea <mar...@go...> - 2009-10-10 15:39:58
|
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
|