Re: Yield curve generated using Treasury considerably higher than the curve by DOT

Posted by Allen Kuo-2 on
URL: http://quantlib.414.s1.nabble.com/Yield-curve-generated-using-Treasury-considerably-higher-than-the-curve-by-DOT-tp14229p14233.html

my guesses:

1. you're printing out zero rates whereas the treasury [hidden email] is a yield (to maturity) curve.  You probably want to print out a par rates. Not sure there is a direct method for that anymore but can back that out using the discount curve.  See: http://quantlib.org/reference/_fitted_bond_curve_8cpp-example.html

2. The methodology of building the curves is different. Treasury appears to be taking select bond YTMs and interpolating to get values for the key points (e.g. 2,3,5,7,10, 30). Then it takes those key YTM points and uses a "quasi-cubic hermite spline algorithm" to get other points on their yield (to maturity) curve (which should be close to  par curve). 

To do what treasury does (to directly fit yields), I think you'd have to do something along the lines of:
http://quantlib.org/quep/quep003/CurveFitting_8cpp-source.html 


On 4/23/2013 12:19 PM, song xu wrote:
sorry, forgot to attached the files

From: song xu [hidden email]
To: [hidden email] [hidden email]
Sent: Tuesday, April 23, 2013 12:16 AM
Subject: Yield curve generated using Treasury considerably higher than the curve by DOT

The yield curved is generated using 4,13,26, and 52 weeks T-bills, and 2,3,5,7, and 10 year T-notes, and 30 year T-bond that are published in treasurydirect.com. The code is pretty much a knockoff of the bonds.cpp. The curve produced by the code using the treasury from the treasurydirect.com is considerably higher than the Treasury Curve in http://www.treasury.gov/resource-center/data-chart-center/Pages/index.aspx. I checked the calender, daycounter, settlement date, and etc, and they seem fine to me. It would be appreciated if someone could help me to identify the problem.
 
The significant discrepancy between the two curves prevents me from using the 20 year composite rate, because it is considerably smaller than that in the curve I generated. Without using the 20 year composite rate, the long-term portion of the curve will be concave instead convex as shown in the Treasury Curve. 
 
Thanks




------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr


_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users


------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users