简体   繁体   中英

Quantlib reconstruct the bond curve using a model with fixed parameters

I'm new using QuantLib. I would like to construct a bond curve using some parameters of NS model. All I found was the other way around, give some bonds and get the parameters.

For example, I want to construct a bond curve using NS with parameters [0.03;-0.02;0; 0.17; 0.08].

I tried to use "setPricingEngine" or "DiscountingBondEngine" what I was not lucky.

Any comment would be very helpful.

Thank You

There's no such possibility at this time. To enable it, you could do something like:

  • Add a constructor to the NelsonSiegelFitting class that takes the parameters and uses them to fill the solution_ array;
  • Add a constructor to the FittedBondDiscountCurve class that takes a pre-built fitting method and no bonds.
  • modify the calculate method of FittedBondDiscountCurve so that it skips the optimization if no bonds were given.

This way, you could build the NS fitting with the desired parameters, pass it to the curve, and then use the curve in the discounting engine.

If you manage it, please consider contributing your changes to the library.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM