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.
-Nick
From: Allen Kuo [mailto:[hidden email]]
Sent: Monday, July 07, 2014 1:14 AM
To: [hidden email]
Subject: Re: [Quantlib-users] Modifying
FittedBondDiscountCurve - 1st Mystery
one 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!
-Nick
Nick: 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.
On 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 pure
virtual and returns a generic bond or its cash
flows.
Derived classes would include helpers for
fixed-rate and zero-coupon bonds. In this way, both
bonds and bills can be used to fit a discount curve
using the exact same machinery. At present, only
fixed-coupon bonds are supported. An even better way to
move
forward might be to get rate helpers to
return
cashflows, in which case this class could be used to fit
any 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.