Re: [Quantlib-users] problem when you try to extrapolate a ZeroSpreadedTermStructure

Posted by Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/problem-when-you-try-to-extrapolate-a-ZeroSpreadedTermStructure-tp10759p10760.html

On 03/04/05 10:39:01, Adjriou Belak wrote:

> there is a problem when I want to extrapolate a yield at one date which  
> is not in the spreaded curve. The problem comes from :
>
> inline Rate ZeroSpreadedTermStructure::zeroYieldImpl(Time t) const {
>  // return originalCurve_->zeroYield(t, true) + spread_->value();
>         return originalCurve_->zeroRate(t, Continuous, NoFrequency) +
>             spread_->value();
> }
>
> It should be used with a boolean extrapolate :
>
>         return originalCurve_->zeroRate(t, Continuous,
> NoFrequency,extrapolate) +
>             spread_->value();
>
> It's missing a parameter in the zeroYieldImpl function.

zeroYieldImpl is not missing a parameter as such: that method is called  
internally, and by the time it is called the extrapolation check has been  
performed already.
But your bug report is correct: we have to add a 'true' to the call to  
zeroRate. I'll fix it in CVS presently.

Thanks,
        Luigi


----------------------------------------

I have yet to see any problem, however complicated, which, when you
looked at it in the right way, did not become still more complicated.
-- Poul Anderson