On 07/11/2005 07:27:52 PM, Guowen Han wrote:
> I use the following statement to get the zero curve
>
> boost::shared_ptr<InterpolatedZeroCurve<Linear> >
> myTermStructure(new
> InterpolatedZeroCurve<Linear>(dates,
>
> yields,
> termStructureDayCounter));
>
> However, with the linear interplation, there is a jump for the forward
>
> curve. Does anyone here know
> how to apply the cubic spline for the forward rate?
Replace 'Linear' with 'Cubic'. If you want to specify spline
parameters, you can write
boost::shared_ptr<InterpolatedZeroCurve<Cubic> >
myTermStructure(new InterpolatedZeroCurve<Cubic>(
dates, yields, termStructureDayCounter,
Cubic(...your parameters...)));
See ql/Math/cubicspline.hpp for the parameters you can pass to Cubic or
the defaults you get if you don't.
Later,
Luigi
----------------------------------------
The wisdom of the wise and the experience of the ages are perpetuated
by quotations.
-- Benjamin Disraeli