Hi Stephen,
There's an example in the test files
(test-suite/piecewiseyieldcurve.cpp) which is a bit convoluted to
interpret.
It's been a while since I wrote it but - if I remember correctly - you
need to specify a different bootstrap class:
new PiecewiseYieldCurve<ForwardRate, ConvexMonotone,
LocalBootstrap>(.....)
The LocalBootstrap is designed to make the convex monotone interpolation
method local to the neighbouring yieldcurve points (so risk is not
spread down the curve and calibration is stable).
Note that ConvexMonotone is designed to work solely with the
ForwardRate.
You can also pass in the exact version of the ConvexMonotone that you
want in the "interpolator" parameter for the PiecewiseYieldCurve class
constructor.
The are three parameters for the ConvexMonotone interpolator class:
1) quadraticity; the higher this number is (minimum of 0.0, maximum of
1.0), the more quadratic (smooth) the forward rate is
2) monotonicity; the higher this number is (minimum of 0.0, maximum of
1.0), the more monotonicity is enforced (if quadraticity is a low value)
- this can lead to sharp gradients in the forward rate.
3) forcePositive; boolean, if TRUE it prevents negative forward rates;
this can mean calibration is impossible.
Try graphing the forward rates and adjust the parameters to suit your
needs.
If you have any problems, let me know.
Simon
-----Original Message-----
From: StephenWong [mailto:stephenwong1128@gmail.com]
Sent: 13 January 2012 01:26
To: quantlib-users@lists.sourceforge.net
Subject: [Quantlib-users] ConvexMonotone Interpolator compatible with
PiecewiseYieldCurve?
Hi all,
Does anyone know if the class PiecewiseYieldCurve can be used with the
ConvexMonotone Interpolator or not?
I seem to be able to only use the Linear, LogLinear or Cubic
Interpolator with PiecewiseYieldCurve but not ConvexMonotone. If I use
the latter exactly like how I use the formers with the
PiecewiseYieldCurve in pricing something, say some bonds, I run into
problems.
Anyone is able to use it successfully?
Thanks!
--
View this message in context:
http://old.nabble.com/ConvexMonotone-Interpolator-compatible-with-PiecewiseYieldCurve--tp33131655p33131655.html
Sent from the quantlib-users mailing list archive at Nabble.com.
------------------------------------------------------------------------