http://quantlib.414.s1.nabble.com/Problem-within-the-Bond-YieldSolver-class-tp4278p4280.html
Maybe you could add an IsFlat() method to the YieldCurve class. (Internally
testing to see if the array size is 1). Then you could switch between the
depending on the value of this IsFlat() function.
is obviously a good thing.
Just an idea...
Toy out.
>From: Luigi Ballabio <
[hidden email]>
>To: Toyin Akin <
[hidden email]>
>CC:
[hidden email]
>Subject: [Quantlib-users] Re: Problem within the Bond YieldSolver class...
>Date: Fri, 09 Dec 2005 13:34:50 +0000
>
>
>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"
>
>
>
>-------------------------------------------------------
>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!
><a href="http://ads.osdn.com/?ad_idv37&alloc_id865&op=click">http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
>_______________________________________________
>Quantlib-users mailing list
>
[hidden email]
>
https://lists.sourceforge.net/lists/listinfo/quantlib-users