Re: Help on Multi Asset Options

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

Hi Andrea,
        here we are. Apologies for the delay.

On Sun, 2007-12-09 at 20:14 +0000, Andrea wrote:
> I have to confess that I am a new user of QuantLib and I would like to
> write a "generic" MC engine to price "generic" product depending on
> many fixings of many assets.
>
> I've found in QuantLib something that is almost what I want, and it is
> the "mcbasketengine".
> It lack only the ability to price path dependent options. But I don't
> think it is complicated to add it.

No, it's not. The problem is that at this time, the engine is not a
generic MC basket engine---it's a European one. The pathPricer() and
timeGrid() methods should be made abstract and their implementations
moved to a McEuropeanBasketEngine class. Then you could inherit your
engine from the (now truly generic) base engine, defining timeGrid() to
return the relevant times for your pricing and pathPricer() to return a
path-dependent pricer.

Unfortunately, much of the BasketOption class seems to be based on the
same assumptions (an European exercise, and a payoff depending on a
single number, be it the average, the min, or the max of the underlying
values) hence the problems you're having in fitting a generic payoff
over it. We'll have to review it and try to generalize a bit.

In the meantime, you can work your way around it. My suggestion is to
generalize the McBasket class as I sketched above, write the formulas
you need in your PathPricer, and disregard the payoff classes entirely.
To keep it cleaner, you might want to inherit your class(es) from
BasketOption so that their constructor don't take a payoff.


> 2) MultiAssetOption has the following methods
>
>         Real delta() const;
>         Real gamma() const;
>         Real vega() const;
>         Real dividendRho() const;
>
> which in my opinion should return Arrays or Matrices

I think so too. Hmm, it's a long time since I looked at this class...
whoever added these methods might have though of the greeks with respect
to the total basket value---whatever sense this may make. I'll have to
see if any engine provides these results. If not, they should probably
be redefined.

Later,
        Luigi


--

These are my principles, and if you don't like them... Well, I have
others.
-- Groucho Marx



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