Posted by
Roland Lichters on
Jul 22, 2006; 3:01pm
URL: http://quantlib.414.s1.nabble.com/piecewise-yield-curve-with-cubic-spline-interpolation-tp4943.html
Hello all,
I am experimenting with yield curve building in QuantLib version 0.3.12.
If the list of instruments contains swaps, I cannot make a piecewise yield curve work with cubic spline interpolation ...
boost::shared_ptr<YieldTermStructure> ts (
new PiecewiseYieldCurve<ZeroYield, Cubic>(asof,
instruments,
termStructureDayCounter,
tolerance));
It does work with deposits and futures. Adding only one swap rate leads already to a "root not bracketed" error:
terminate called after throwing an instance of 'QuantLib::Error'
what(): root not bracketed: f[2.22045e-16,3] -> [3.743160e+00,2.719709e+00]
I have reduced the tolerance from 1e-6 to even 1e-3 without success.
Attached is a simple program that demonstrates this. Did anyone encounter this before, any ideas, counter examples?
It is clear that the interpolation type affects already the zero rates at grid points (instrument maturities) if the bootstrap requires interpolation to an "unknown" rate at a date which is not the maturity of a curve instrument. This happens usually already when the rate for the first future maturity is computed. Bootstrap in the swap segment may be even more sensitive to interpolation because of the quarterly, semiannual, annual cash flows and "rare" quotes. But so far I do not see why cubic spline interpolation cannot be built into the bootstrap process with swaps.
I am using a front/back office system in business that takes a different approach: It first builds a "raw" curve with local interpolation (linear zeros or loglinear discounts like piecewise flat forward in QuantLib). It then feeds the zero rates into a cubic spline interpolated curve. This curve does not reprice the curve instruments, so that the zero rates at grid points are "modified" somehow until repicing works again.
I would be grateful for any hint, idea!
Roland
_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000071