Hi Nick :
1. Note the yield to maturities for each bond, calculated by hand, but assuming slight number
of difference in days as the tenors (which I define as "remaining maturity") :
yield to maturity tenor (days)
5.69530% 364 [date diff between 8/22/1996 and 8/21/1997]
5.67926% 365
5.66331% 366
2. Tho I don't have excel addin installed or any of the latest quantlib versions, in your excel addin,
I see you specified both maturity date and "tenor" (6M or 1Y). Though you can construct a bond's cash flows
using either, see if you can leave out the "tenor" and to get the excel addin to give you a response just
based on the maturity date you input. This will reduce the number of variables we are looking at. It could be
that because you specified a 1Y tenor for your "fake" bill, QuantLib 1.4.0/VS2010 assumed the tenor was
exactly one year, and thus gave you the 5.67926% response above. For your real zero coupon bond, appears
you only specified the exact maturity date, and are thus getting the the 5.69530% number above.
3. This doesn't explain the Github / VS 2012 results but lets take it a step at a time. I don't understand
the "6M tenor" fake bond- no real need to test with that bond either, because if the tenor (defining
tenor as "remaining maturity") were 6M, the yield to maturity would be very different than your real zero
coupon bond of tenor 1Y (remaining maturity), assuming both have the same prices. Or I just don't understand
"tenor" in Excel add-in....
AllenOn Monday, 7 July 2014, 15:38, Nicholas Manganaro <[hidden email]> wrote:
Hi, Allen.Thanks for getting back to me.I’ve attached my small test worksheet so you can see it for what it is. There are 2 pages: one with formulae; and one with the values saved so you can still see it if you do not have the xll add-in.The bill yield of 5.69530% is the cash flow yield from qlBondYieldFromCleanPrice from .\QuantLibXL\qlxl\functions\bonds.cpp, as are the others. That seems to call QuantLib::BondFunctions::yield.The “fake” notes with the 0% coupons were constructed using qlFixedRateBond. The bill was created with qlZeroCouponBond.The maturities are the same for all, despite the differences in the tenor. I used the same price for all as well, calculated from the pricing discount quote on the bill.The cash flows are the same, since the periodicity of receiving a 0% coupon does not change the amounts or actual timing of the cash flows to be received, as you can see in the attached sheet.The compounding frequency input does not affect whether the bill and the fake note with the 1Y tenor have the same yield, which you can play with on the spreadsheet.With the same cash flows and the same prices, I am perplexed that I am not getting the same yields while using the same function with the same compounding, day count and frequency inputs.-NickFrom: Allen Kuo [mailto:[hidden email]]
Sent: Monday, July 07, 2014 1:14 AM
To: [hidden email]
Subject: Re: [Quantlib-users] Modifying FittedBondDiscountCurve - 1st Mysteryone thing I'm not understanding is that if you have the exact same price for a 6M and 1Y tenor bill, the yield to maturity (annualized) should be quite different, assuming they both pay par at their respective maturities. You confirmed the final cash flows were the same ?
For your analysis below, what was your constructor or function to obtain the "BILL" yield of 5.69530% (or is that a Bloomberg yield) ? And for the "Fake" bills, you were using the FixedRateBond constructor ?
On 7/7/2014 4:25 AM, Nicholas Manganaro wrote:In response to Allen’s advice, I went looking into the best method of modeling a discount instrument as a fixed rate bond with a 0% coupon and ran into what seems an inconsistency.I used the terms for a T-Bill, then modeled it as a 0% note with a 6m tenor and another with a 1Y tenor. The yields are not the same, even though I confirmed the cash flows are. I got the following results whether I used the most recent version of the add-in for QuantLibXL 1.4.0 I built with Visual Studio 2012 or the xll add-in downloaded from GitHub.Results:Not happy with that, I tried in using the QuantLibXL I built from the version of Quantlib from February 27, 2014, also named 1.4.0, but using Visual Studio 2010.Results:The same pattern of results is evident if I use Semiannual compounding, although the numbers themselves are different. At least the bill’s yield is the same from version to version.On the plus side, if I think the new results are accurate, I can go forward using the fake note with 1Y tenor approach to try out the curve fitting, as it leads me to expect results that are more representative of the discount instruments I want to add to the curve fitting process.On the down side, the fact that the yields are not uniform and that there are changes from the old to the new version make one wonder what is really going on here.Any insights? I’d be happy to forward my spreadsheet if there is interest.Cheers!-NickFrom: Allen Kuo [[hidden email]]
Sent: Friday, July 04, 2014 8:10 AM
To: [hidden email]; [hidden email]
Subject: Re: [Quantlib-users] Modifying FittedBondDiscountCurveNick: I haven't looked at this in a long time but could you created instances of discount bonds as special cases of a fixed rate bonds with a single cash flow, i.e. would the current code still work with FixedRateBondHelpers ?If so, then I probably should change the To Do in the documentation.AllenOn Friday, 4 July 2014, 19:54, Nicholas Manganaro <[hidden email]> wrote:I was taking a look at<ql/termstructures/yield/fittedbonddiscountcurve.hpp> and saw the note:\todo refactor the bond helper class so that it is purevirtual and returns a generic bond or its cashflows. Derived classes would include helpers forfixed-rate and zero-coupon bonds. In this way, bothbonds and bills can be used to fit a discount curveusing the exact same machinery. At present, onlyfixed-coupon bonds are supported. An even better way tomove forward might be to get rate helpers to returncashflows, in which case this class could be used to fitany set of cash flows, not just bonds.I would like to include discount instruments in curve construction, if possible. Has anyone made progress along that path, perhaps on the line of the steps identified in this note?I would appreciate advice or comments on the work necessary to use generic cash flows in this process, if it would not require a major re-write of the library.Thanks.-Nick
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
| Free forum by Nabble | Edit this page |