Repository navigation
Add shifted short-rate support to BDTTree (#20) - #406
Merged
Merged
Conversation
Allow BDTTree and its Numba tree calibration helpers to accept an optional shift parameter (default 0.0) so that the shifted short rate (r + shift) follows a lognormal process and negative interest rates above -shift can be calibrated and priced. Fixes domokane#20
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.
Summary
Implements shifted short-rate support in
BDTTree(financepy/models/bdt_tree.py) to allow calibration and derivative valuation under negative interest rates, resolving #20.Mathematical Formulation & Changes
Extends the constant-volatility Black–Derman–Toy short-rate dynamics to:
where$s$ (
shift: float = 0.0by default) uses the same sign convention asBlackShiftedandSABRShiftedfor full backward compatibility.f,search_root,build_tree_fast,BDTTree):rt[m, i], so Arrow–Debreu state price updates and backward-induction pricers (bond_option,bermudan_swaption,callable_puttable_bond_tree) discount at the true (possibly negative) short rate without modification.FinErrorwhen the shift is insufficient for a negative-rate curve.Testing
tests/unit/test_FinModelRatesBDT.py:test_shifted_bdt_negative_rates_calibration_and_spacing: Verifies Arrow–Debreu state price calibrationtest_shifted_bdt_zero_vol_shift_invariance_and_pricing: Verifies that atshift.test_shifted_bdt_rejects_rates_below_negative_shift: Verifies thatFinErroris raised whenFixes #20