Re: Re: piecewise flat forward algorithm

Posted by Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/piecewise-flat-forward-algorithm-tp3876p3879.html

On 07/04/2005 09:17:07 PM, Adjriou Belak wrote:
> I agree with you but this option makes the downward curve impossible.

A downward curve is possible---I bootstrap them all the time :)

If QL_NEGATIVE_RATES is not defined, the algorithm should just prevent  
discount factors from being increasing. If discount factors were to  
increase, i.e., df(t1) < df(t2) for t1 < t2, this would imply a  
negative forward rate---the formula being r = [df(t1)/df(t2)-1]/(t2-t1)

Decreasing positive rates should not be excluded if they result in  
decreasing discount factors. If your 6% 2-year and 4% 3-year rates  
trigger an exception, this probably means they imply not only downward  
rates, but also a negative 2-3 years forward rate.

This said, you can allow negative rates---if you're using Linux, Mac OS  
X, Cygwin or MSYS, just configure with
./configure --enable-negative-rates
If you're on some other platform, edit ql/userconfig.hpp and uncomment  
the line
#define QL_NEGATIVE_RATES 1
so that the symbol is defined. This will allow you to bootstrap---I  
just tested your example and it worked.

Later,
        Luigi

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

There is no opinion so absurd that some philosopher will not
express it.
-- Marcus Tullius Cicero, "Ad familiares"