problem when you try to extrapolate a ZeroSpreadedTermStructure

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

problem when you try to extrapolate a ZeroSpreadedTermStructure

Adjriou Belak
Hi,
 
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.
 
regards
 


Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails !
Créez votre Yahoo! Mail
Reply | Threaded
Open this post in threaded view
|

Re: problem when you try to extrapolate a ZeroSpreadedTermStructure

Luigi Ballabio
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