Re: Question on extrapolation method in term structure classes
Posted by Luigi Ballabio-2 on Apr 13, 2004; 7:20am
URL: http://quantlib.414.s1.nabble.com/Question-on-extrapolation-method-in-term-structure-classes-tp2912p2913.html
Hi Enrico,
On 2004.04.13 13:05, Michelotti Enrico wrote:
> We have a problem in setting the extrapolation method
> in the term structure class (and derived classes) in case
> we use it to calibrate some models.
> It seems to us that it is possible to set this optionality only
> within the inner functions (ex: discountFactor, forward...) and not
> to an higher level (for example in the constructor).
>
> - Am I right?
Yes, you are.
> - Did you find the same problem?
Yes, in several classes (volatility term structures, interpolations...)
But I didn't find the time to code a general solution yet.
> - Do you know how to solve this issue?
We should add a couple of enable/disableExtrapolation() methods to
those classes, setting a corresponding data member. Then, lower-level
methods would check that data member besides the local argument.
Also, it would probably be more convenient to encapsulate this in a
basic class and have TermStructure and such inherit from the latter.
> - Do we need to set manually in QuantLib files the extrapolation at
> true as default?
Yes, I'm afraid this is the simplest solution right now.
> - Do you suggest to create another term structure with this
> optionality in the constructor?
No, I'd rather solve this in a more general way. May you file this as a
feature request on the QuantLib site? (Or if you code it, you can
submit it as a patch :)
Later,
Luigi