Hello all:
As one of my first forays into QuantLib, I am experimenting with a Monte Carlo simulation to price a basket option. Among the classes I am using is the class EuropeanMultiPathPricer and I am slightly puzzled by what I see. Perhaps one of you could throw me a bone. Firstly, I find that there does not appear to be a way to specify different weights for the assets in the basket, or to specify the position in each of the assets. It would seem that the designer of the BasketOption and the EuropeanMultiPathPricer have intended for this to be specified directly in the 'underlying' Array, which is populated by the SimpleQuote object specifying the initial price of the underlying. In other words, the only way I have found to have a position of 2 in an asset currently priced at 3 is via: Handle<Quote> x0_1(boost::shared_ptr<Quote>(new SimpleQuote(2 * 3))); However, the following code in the EuropeanMultiPathPricer constructor prevents a short position in any of the assets in the basket. for (Size i = 0; 0 && i < underlying.size(); i++) { QL_REQUIRE(underlying[i]>0.0, "underlying less/equal zero not allowed"); } Secondly, only two types of baskets are available, called Max and Min and the price of these baskets is computed as the price of the most or least expensive asset respectively, see: Real EuropeanMultiPathPricer::operator()(const MultiPath& multiPath) const; in mcbasketengine.cpp. My intention was to price the basket as the weighted sum of assets, which does not seem to be one of the available types: I fear that I am missing an important design point of the QuantLib basket option. Any help would be appreciated. Best regards Gísli |
On 03/28/2006 12:52:04 PM, Gísli Sigurbjörn Óttarsson KB banki wrote:
> I find that there does not appear to be a way to specify > different weights for the assets in the basket, or to specify the > position in each of the assets. > > Secondly, only two types of baskets are available, called Max and Min Gísli, I guess the weighted type should be added besides Min and Max, and a vector of weights should be passed to the option. Such vector would have to be stored in its arguments and passed down to the path pricer, which could then use it to compute the correct payoff. Are you willing to try and implement this? Later, Luigi ---------------------------------------- This gubblick contains many nonsklarkish English flutzpahs, but the overall pluggandisp can be glorked from context. -- David Moser |
In reply to this post by Gísli Sigurbjörn Óttarsson KB banki
Yes, I am willing to try this. In a locally modified copy I have
supplemented "Min" and "Max" with "Sum" and handled the weights by scaling the initial price quote of each asset. This works well. Unfortunately, this seems to make it inconvenient to change to weights if the basket is to be rebalanced. I´ll experiment with a "WeightedSum" attribute and a weight vector. Gisli -----Original Message----- From: Luigi Ballabio [mailto:[hidden email]] Sent: 5. apríl 2006 09:15 To: Gísli Sigurbjörn Óttarsson KB banki Cc: [hidden email] Subject: Re: [Quantlib-users] BasketOption On 03/28/2006 12:52:04 PM, Gísli Sigurbjörn Óttarsson KB banki wrote: > I find that there does not appear to be a way to specify different > weights for the assets in the basket, or to specify the position in > each of the assets. > > Secondly, only two types of baskets are available, called Max and Min Gísli, I guess the weighted type should be added besides Min and Max, and a vector of weights should be passed to the option. Such vector would have to be stored in its arguments and passed down to the path pricer, which could then use it to compute the correct payoff. Are you willing to try and implement this? Later, Luigi ---------------------------------------- This gubblick contains many nonsklarkish English flutzpahs, but the overall pluggandisp can be glorked from context. -- David Moser |
Free forum by Nabble | Edit this page |