Login  Register

Re: Error when using a Cubic interpolator for PiecewiseYieldCurve

Posted by MonkeyMan-3 on Aug 04, 2010; 1:19am
URL: http://quantlib.414.s1.nabble.com/Error-when-using-a-Cubic-interpolator-for-PiecewiseYieldCurve-tp7607p7612.html

MonkeyMan <feersum_monkey <at> yahoo.com> writes:

MonkeyMan <feersum_monkey <at> yahoo.com> writes:

For what it's worth, here is the data I'm using (not the example data):

Today: Sunday, January 4th, 2004
Settlement date: Wednesday, January 7th, 2004
deposit: sw 0.0108375
deposit: 2w 0.0109125
deposit: 1m 0.0112
deposit: 2m 0.0113
deposit: 3m 0.0115
deposit: 6m 0.012275
deposit: 9m 0.0135
deposit: 1y 0.0151
future: 2004-03-17 98.765
future: 2004-06-16 98.525
future: 2004-09-15 98.145
future: 2004-12-15 97.695
future: 2005-03-16 97.26
future: 2005-06-15 96.855
future: 2005-09-21 96.51
future: 2005-12-21 96.21
swap: 10y 4.758
swap: 12y 4.973
swap: 15y 5.21
swap: 2y 2.245
swap: 20y 5.405
swap: 3y 2.875
swap: 30y 5.484
swap: 4y 3.36
swap: 5y 3.755
swap: 6y 4.045
swap: 7y 4.268
swap: 8y 4.46
swap: 9y 4.622

Then I blow up on the first instrument when I try to price a
1yf2y swap with this error:

1st iteration: failed at 1st instrument, maturity January 14th, 2004,
reference date January 7th, 2004: root not bracketed:
f[2.22045e-16,1] ->[1.083750e-02,1.083750e-02]

For this instance I used the ConvexMonotone:

Real quadraticity = 0.3;
Real monotonicity = 0.7;
bool forcePositive = true;
ConvexMonotone monotone = ConvexMonotone(
   quadraticity,
   monotonicity,
   forcePositive);

boost::shared_ptr<YieldTermStructure> termStructure(
             new PiecewiseYieldCurve<Discount,ConvexMonotone>(
                                       settlementDate,
                                       depoFutSwapInstruments,
                                       termStructureDayCounter,
                                       tolerance,
                                       monotone));

Note that my swap rates are pushed into the RateHelper out of order.
This is the order they come out of the database.
I assume that doesn't matter.

Is there some better way to do this? The parameters for the
ConvexMonotone are the defaults. I have tried using the Hagan
parameters, but that didn't help.

What do other people do to bootstrap their curves?
Am I missing something basic?



------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users