Posted by
Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/Problem-within-the-Bond-YieldSolver-class-tp4278p4279.html
On 12/06/2005 07:27:50 PM, Toyin Akin wrote:
> Okay, after playing around a bit within the Bond classes, there can
> be situations where the implied Yield will not reprice the bond
> exactly (yield() function of the Bond class). This is because there
> is a minor difference between the implementation between the
> computation of the dirty price within the YieldSolver
> (dirtyPriceFromYield() function) and the performCalculation class of
> the Bond class.
>
> [...]
>
> In my local copy, I thought about changing the code within the
> performCalculation() function so that for the first accrual period, I
> compute a 'Time' variable instead of using the 'Date' variable and
> then passing this to the discount() function.
Maybe, but this can give an incorrect discount when the yield term
structure is not constant (as you're basically passing a time
corresponding to a different date.)
I'm not sure of how to go about this one. We might ask the term
structure for the rates over the coupon and compound them to get the
discount...
Luigi
----------------------------------------
Just remember what ol' Jack Burton does when the earth quakes, the
poison arrows fall from the sky, and the pillars of Heaven shake. Yeah,
Jack Burton just looks that big old storm right in the eye and says,
"Give me your best shot. I can take it."
-- Jack Burton, "Big trouble in Little China"