finmath / finmath-lib

Mathematical Finance Library: Algorithms and methodologies related to mathematical finance.
Apache License 2.0
488 stars 168 forks source link

add bond calibration test #83

Closed noittom closed 3 years ago

noittom commented 3 years ago

adding a test with bond calibration of a Nelson-Siegel-Svensson curve to a given set of bond. currently I think I have some problems with using finmath lib as interpolated yield values are quite different from actual yields.

I would appreciate it if you could have a look.

The main idea is that Solver should be used with some current bond prices to calibrate NSS curve

Alexey Monakhov

noittom commented 3 years ago

any updates ?

cfries commented 3 years ago

Sorry for the delay! Will have a look at it now!

cfries commented 3 years ago

There were two small issues:

Everything is our fault, because the documentation should have been better ;-)

cfries commented 3 years ago

I am merging this and will make some updates in the master branch. Maybe you can have a look there!

cfries commented 3 years ago

Your unit test is now on the master branch. I have added an assertion, checking for the price differences. Since the NSS curve has only a few parameters, there are some deviations, but overall it looks OK. Please have a look at your unit test in the master branch. Thanks for the PR and feedback.

I have removed the "Example Curve" you had added, because it looked worse to me.

Please get back to me if you have questions. I try to be quicker this time.