|
From: Jack G <jac...@gm...> - 2020-11-12 00:28:10
|
Hi Jian, QuantLib relies on another project, which auto-generates interface code, to export functionality to python and other languages - https://github.com/lballabio/QuantLib-SWIG. The reason you can't see fixed/floating risky bond in the python wrap is because an interface for it hasn't been included in this file: https://github.com/lballabio/QuantLib-SWIG/blob/master/SWIG/bonds.i If you want to have a go at adding it yourself (it's an instructive process), you will need to: - fork the QuantLib-SWIG repo, and locally add the code to the file I mentioned above, following the other examples in the file - test your changes, which requires a few sub-steps (the first time, this process will take several hours to set up and run): a) build QuantLib v1.20 locally from source as described here: https://www.quantlib.org/install.shtml (if you're using Windows you can try Visual Studio, but personally I find it easiest to do it using Windows Docker Desktop inside a Docker container in a linux environment) b) build QuantLib-SWIG v1.20 with your modifications c) test the code changes locally using Python - when the wrapper is working, make a pull request with your changes into the QuantLib-SWIG repo, and Luigi will merge your changes after the automated tests pass - optionally, you might consider adding documentation for the new python classes to the repo that generates the online documentation shown here: https://quantlib-python-docs.readthedocs.io/en/latest/ If this sounds too ambitious for you, let me know and I can make the changes to expose the class for you, as it looks like a useful class to have available. Best, Jack On Thu, Nov 12, 2020 at 5:31 AM jian Xu <jia...@gm...> wrote: > Hi, > > There is a RiskyBond class under experimental/credit in the C++ repo. > However, when I'm using the Python interface, it seems that it's not > there. My question is, how to get the RiskyBond in Python? Or is > there a reason that it's not exposed? > > More generally, I am trying to calibrate a survival probability curve > of a fixed rate bond. And I think RiskyBond is the correct one to > use. If it's not in Python, what's the proper object for this task? > Thanks. > > Jian > > > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |