Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't require bond helpers when a FittedBondDiscountCurve instance won't use them #2071

Closed
lballabio opened this issue Sep 18, 2024 · 0 comments · Fixed by #2113
Closed

Don't require bond helpers when a FittedBondDiscountCurve instance won't use them #2071

lballabio opened this issue Sep 18, 2024 · 0 comments · Fixed by #2113

Comments

@lballabio
Copy link
Owner

lballabio commented Sep 18, 2024

When passed maxEvaluations=0, a fitted bond curve won't calibrate the parameters of its fitting method; it will use the ones passed, which were precomputed in some other way. However, the constructor still requires that the passed vector of bond helpers is not empty, even if they won't be used; see e.g. https://github.com/lballabio/QuantLib/blob/v1.35/test-suite/fittedbonddiscountcurve.cpp#L45-L50 where a fake bond helper needs to be created. The check should be relaxed.

Note that without bond helpers, we can't determine a max date. We could pass it as a kind-of-optional argument (usually not needed, but required when maxEvaluation = 0), or extrapolate by default (by setting maxDate = Date::.maxDate()); the latter is risky though, since the curve might not make sense long term.

We might also decide that passing a mock bond helper is an easier way to set the max date. It might be confusing, though, and at least it should be documented.

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 a pull request may close this issue.

1 participant