Skip to content

Use dirty price in CallableBond effective duration and convexity - #2671

Merged
lballabio merged 2 commits into
lballabio:masterfrom
AIM-IT4:fix-callable-effective-duration
Jul 24, 2026
Merged

lballabio merged 2 commits into
lballabio:masterfrom
AIM-IT4:fix-callable-effective-duration

Conversation

@AIM-IT4

@AIM-IT4 AIM-IT4 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Addresses issue #1882 by using the dirty price (adding accrued interest) in the denominator of effective duration and effective convexity calculations for CallableBond.

@coveralls

coveralls commented Jul 21, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 74.983% (+0.03%) from 74.954% — AIM-IT4:fix-callable-effective-duration into lballabio:master

Comment thread test-suite/callablebonds.cpp Outdated
Comment on lines +1091 to +1093
BOOST_CHECK_GT(effDur, 0.0);
BOOST_CHECK_LT(effDur, 15.0);
BOOST_CHECK_NE(effConv, 0.0);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@lballabio
lballabio merged commit d51150b into lballabio:master Jul 24, 2026
45 checks passed
@lballabio lballabio changed the title fix: use dirty price in CallableBond effective duration and convexity Use dirty price in CallableBond effective duration and convexity Jul 24, 2026
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