piecewise flat forward algorithm

Posted by Adjriou Belak on
URL: http://quantlib.414.s1.nabble.com/piecewise-flat-forward-algorithm-tp3876.html

Hi ,
 
In the algorithm fo find the zero coupon (with the brent solver 1D) , there is a problem when the curve is downward !! There is an option QL_NEGATIVE_RATES that  prevents the negative rates but it prevents also the downward curve.  In the code :
 
             #if defined(QL_NEGATIVE_RATES)
            // discount are not required to be decreasing--all bets are off.
            // We choose as max a value very unlikely to be exceeded.
            DiscountFactor max = 3.0;
            #else
            DiscountFactor max = discounts_[i-1];
            #endif
            solver.solve(FFObjFunction(this,instrument,i),
                         accuracy_,guess,min,max);
 
The discount factor is set to the last one  so the curve can't be downward. So a downaward curve doesn't mean negative rates !
 
regards,
Adjriou Abdelak



Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
Téléchargez le ici !