Re: piecewise flat forward algorithm
Posted by
Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/piecewise-flat-forward-algorithm-tp3876p3877.html
On 06/28/2005 10:07:10 AM, Adjriou Belak wrote:
>
> 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 !
I beg to differ. A downward curve might mot mean negative spot rates,
but it does mean negative forward rates.
Later,
Luigi
----------------------------------------
Brady's First Law of Problem Solving:
When confronted by a difficult problem, you can solve it more
easily by reducing it to the question, "How would the
Lone Ranger have handled this?"