|
From: Luigi B. <lui...@gm...> - 2022-08-04 11:05:26
|
Hello Claudio,
you can modify the FittedBondDiscountCurve class so that it can use
generic RateHelper instances, but it will miss some features. Also, do
keep into account that while PiecewiseYieldCurve creates a curve that
reproduces the inputs exactly, FittedBondDiscountCurve doesn't, so I would
check if that's acceptable for you.
This said: you can replace BondHelper with RateHelper in the
FittedBondDiscountCurve class, but you'll have to comment out some code
that would not compile. One such place is <
https://github.com/lballabio/QuantLib/blob/master/ql/termstructures/yield/fittedbonddiscountcurve.cpp#L98-L110>;
these are a few checks and you can live without them. Another place is <
https://github.com/lballabio/QuantLib/blob/master/ql/termstructures/yield/fittedbonddiscountcurve.cpp#L98-L110>:
commenting this out means that you can't rely on the curve for calculating
the calibration weights and you'll have to pass them in explicitly.
Hope this helps,
Luigi
On Tue, Aug 2, 2022 at 3:39 PM Claudio D'Angelo <
cla...@so...> wrote:
> Hello all,
>
> let me introduce myself, I'm a java developer, I need to modify an
> application that is usimg quantlib (via SWIG).
>
> Currently this application is creating curves using the class
> PiecewiseYieldCurve and passing rates like RfaRate and DepositRate, both
> using a SimpleQuote containing the yield value of the rate.
>
> Now I would interpolate/fit the curve using the NSS, checking the API
> seems the only class that can implement this fitting is the
> FittedBondDiscountCurve. Unfortunately this class wants in input a
> BondHelper or a Fixed RateBondHelper, both of them work using bond data
> and the price.
>
> Is it possible to implement a curve using the NSS but with rates with
> only yield values (naturally with other data but not a bond and a price
> as input).
>
> I don't know if I was clear, unfortunately I don't have experience with
> quant, quantlib and C++ and I need help in order to understand better
> and resolve my issue.
>
> Thank you very much in advance to all.
>
>
> Claudio
>
>
>
>
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|