0
$\begingroup$

I'm trying to use Bloomberg yield-to-maturity data for sets of sovereign bonds of different maturities to fit to a yield curve. I looked into using the QuantLib library (the FittedBondCurve functionality) but it seems to only take coupon & price data as input, to first bootstrap the bonds before calculating the zero rate yield curve.

Is there a way in Quantlib (or any other opensource code that I haven't yet found) to fit the curve (probably to Nelson Siegel) directly from yield-to-maturity data points? I'm using C++.

Thanks in advance.

$\endgroup$
4
$\begingroup$

Unless all of your yields are par yields (yield of bonds trading at par), you'll get very unreliable results if you fit your curve using yields alone. This is because yields can be distorted by the coupon effect – given two bonds maturing on the same day and assuming the yield curve is upward sloping, a higher coupon bond will always have lower yield.

What you should do is to get the actual bonds (hence their coupon rates and maturity dates) and their prices (or yields, which can be easily converted into prices), and go from there.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.