RE: A question concerning Bond Yield Calculation...

Posted by Toyin Akin on
URL: http://quantlib.414.s1.nabble.com/C-wrapper-tp4263p4269.html

Hi,

Problem sorted... I was using a different DayCounter within the YieldCurve
than that used by the bond. (YieldCurve object is passed to be Bond
constructor)

In this situation, the solved yield may not price your bond correctly as a
different DayCounter is used by the YieldCurve during the NPV bond function.

In fact the Bond's Yield solver calls it's NPV() function which will use the
YieldCurve's DayCount, but then solve for the Yield with the Bond's
dayCounter.

This really shows up when you have accural periods.
Thus make sure that you use the same DayCounter for both the YieldCurve and
the Bond Object.

Toy out.


>From: "Toyin Akin" <[hidden email]>
>To: [hidden email]
>Subject: RE: [Quantlib-users] A question concerning Bond Yield
>Calculation...
>Date: Mon, 05 Dec 2005 05:35:51 +0000
>
>
>Actually I think my logic on this may be seriously flawed...
>
>Still looking at it...
>
>Toy out.
>
>
>>From: "Toyin Akin" <[hidden email]>
>>To: [hidden email]
>>Subject: [Quantlib-users] A question concerning Bond Yield Calculation...
>>Date: Mon, 05 Dec 2005 04:02:00 +0000
>>
>>
>>Hi,
>>
>>Maybe my logic is flawed here but I will present what I have and hopefully
>>somebody can put me right.
>>
>>Within the Bond Yield solver, you take the clean price add on the accured
>>and then solve for the yield.
>>
>>However the accured calculation itself never has use of the yield value.
>>It's simply
>>
>>Accruedyearfraction*Coupon*Notional
>>
>>But by adding the accured value to the Clean price and then solving for
>>the yield, the accrued part is now sensitive to the yield parameter as the
>>whole first period (that includes the accured) will be discounted.
>>
>>Hence the solved Yield will not recover the clean price (nor the dirty
>>price for that matter as the logic to compute the dirty price within the
>>solver and the logic used to compute the dirty price within the Bond class
>>is different...).
>>
>>Toy out.
>>
>>
>>
>>
>>-------------------------------------------------------
>>This SF.net email is sponsored by: Splunk Inc. Do you grep through log
>>files
>>for problems?  Stop!  Download the new AJAX search engine that makes
>>searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
>>http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
>>_______________________________________________
>>Quantlib-users mailing list
>>[hidden email]
>>https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
>
>
>
>-------------------------------------------------------
>This SF.net email is sponsored by: Splunk Inc. Do you grep through log
>files
>for problems?  Stop!  Download the new AJAX search engine that makes
>searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
>http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
>_______________________________________________
>Quantlib-users mailing list
>[hidden email]
>https://lists.sourceforge.net/lists/listinfo/quantlib-users