Skip to content

Export NaturalCubicFitting - #955

Merged
lballabio merged 1 commit into
lballabio:masterfrom
Allan-dq:export-natural-cubic-fitting
Nov 13, 2026
Merged

lballabio merged 1 commit into
lballabio:masterfrom
Allan-dq:export-natural-cubic-fitting

Conversation

@Allan-dq

Copy link
Copy Markdown
Contributor

This exports NaturalCubicFitting (added to the library in lballabio/QuantLib#2378) next to the other fitting methods for FittedBondDiscountCurve. The constructor takes the same arguments as in C++, including the optional optimization method, as NelsonSiegelFitting does.

There were no Python tests for fitted bond curves, so I added test_fittedbondcurve.py with two cases:

  • a curve built from given parameters starts at 1, passes through the knots, matches CubicNaturalSpline between them and is flat after the last one;
  • a fit to ten annual bonds priced off a flat 3% curve stays close to that curve and reprices the bonds.

Built against QuantLib master; the Python test suite passes locally (225 passed, 1 skipped).

I used an AI assistant while preparing this and have reviewed and run all of it myself.

@boring-cyborg

boring-cyborg Bot commented Nov 12, 2026

Copy link
Copy Markdown

Thanks for opening this pull request! It might take a while before we look at it, so don't worry if there seems to be no feedback. We'll get to it.

@CLAassistant

CLAassistant commented Nov 12, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@lballabio
lballabio merged commit 6c79f00 into lballabio:master Nov 13, 2026
8 checks passed
@boring-cyborg

boring-cyborg Bot commented Nov 13, 2026

Copy link
Copy Markdown

Congratulations on your first merged pull request!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants