Re: Help on Multi Asset Options

Posted by Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/Help-on-Multi-Asset-Options-tp11751p11756.html

On Sun, 2008-03-02 at 20:48 +0000, Andrea wrote:

> The PathPricer receives the MultiPath, extract the values of the
> assets on the times requested by the product (the time grind having
> potentially more dates than the product needs) into some sort of
> matrix and passes it to the product.
> The product return (for the time being) one single number, and the
> PathPricer takes care of discounting it.
>
> I want to write only one instance of the PathPricer and many
> Products/Payoffs.
>
> Is it correct?

Andrea,
        just to remove ambiguity, I wouldn't speak of product---that suggests
an instance of the Instrument class (and in fact, it got me confused
earlier.) Let's use "Payoff" instead.

This said: some path pricers happen to use a Payoff instance, but this
is not necessarily always the case. True, you could expand the Payoff
hierarchy until it becomes some kind of interpreted language (at which
point the PathPricer becomes little more than a discounter.) But if you
want to express a number of exotic path-dependent payoffs, and if you
don't need to specify the formula for your payoff at run-time (in which
case you'll have to go for the interpreter, but it's a lot of work) you
might be better off if:
a) you write a general engine which does the setup, defines an abstract
pathPricer() method to instantiate the payoff, and runs the simulation;
b) you inherit specific engines which implement pathPricer() by
returning a derived PathPricer with the specific formula you need. The
path pricer doesn't need to use a Payoff object, mind you: it can just
implement the formula itself.

Luigi


--

Ogden's Law:
The sooner you fall behind, the more time you have to catch up.



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev