Repository navigation
Use dirty price in CallableBond effective duration and convexity - #2671
Merged
lballabio merged 2 commits intoJul 24, 2026
Merged
Conversation
lballabio
reviewed
Jul 24, 2026
Comment on lines
+1091
to
+1093
| BOOST_CHECK_GT(effDur, 0.0); | ||
| BOOST_CHECK_LT(effDur, 15.0); | ||
| BOOST_CHECK_NE(effConv, 0.0); |
Owner
There was a problem hiding this comment.
These checks pass even without your change to the calculations, so they don't really test it.
I would use as a test the example in the original issue instead.
Contributor
Author
There was a problem hiding this comment.
Thanks @lballabio! I've updated the test case in test-suite/callablebonds.cpp to use the parameters from issue #1882 evaluated on 2023-11-30. Because this date has non-zero accrued interest (~2.42), using the clean price in the denominator yields ~4.4171 whereas dirty price yields ~4.3836. The test now explicitly asserts that the calculated duration matches the dirty price formula and differs from the clean price formula.
CallableBond effective duration and convexity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses issue #1882 by using the dirty price (adding accrued interest) in the denominator of effective duration and effective convexity calculations for CallableBond.