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

Bond Key Rate Duration Calculator #33

Closed
domokane opened this issue Oct 1, 2020 · 8 comments · Fixed by #176
Closed

Bond Key Rate Duration Calculator #33

domokane opened this issue Oct 1, 2020 · 8 comments · Fixed by #176
Labels
enhancement New feature or request Finance Quant good first issue Good for newcomers

Comments

@domokane
Copy link
Owner

domokane commented Oct 1, 2020

No description provided.

@domokane domokane added enhancement New feature or request Finance Quant good first issue Good for newcomers labels Oct 1, 2020
@badalsarkar
Copy link

Hello @domokane ,
I would like to work on this issue. Please let me know if it is alright.
Thanks you.

@domokane
Copy link
Owner Author

domokane commented Mar 9, 2021 via email

@badalsarkar
Copy link

Thank you. I am looking at the code base. And once I have a plan, I will discuss with you.

@sagayev
Copy link
Contributor

sagayev commented Feb 22, 2023

Dear @domokane I have done some calculations. I will send you a notebook for your review. If I am on the right track I can incorporate into code together with the test cases.

@sagayev
Copy link
Contributor

sagayev commented Feb 22, 2023

I am attaching the notebook here. Someone else may have an opinion or suggestion.

KRD_draft_by_sagayev.zip

.ipynb file inside a zipped file.

@sagayev
Copy link
Contributor

sagayev commented Mar 16, 2023

Hello @domokane ,

The Periscope example in the above link does not seem to calculate the modified duration correctly. Their modified duration and the sum of key rate durations are consistent with each other. However, the modified duration is not in line with FinancePy and MS Excel.

@sagayev
Copy link
Contributor

sagayev commented Mar 17, 2023

KRD_draft_by_sagayev_Bloomberg.pdf

Dear @domokane,

I have compared my numbers with Bloomberg. They are very close. I also added more comments to explain the code. Please let me know if it seems OK.
Also if there is a better approach let me know. I have not used function here. If we can agree on the path I will add it to Bond class as a method.

@domokane
Copy link
Owner Author

domokane commented Apr 9, 2023

Hi - this looks pretty good. The differences are probably due to small details in the price-yield formula. Maybe try implementing it as a function. Please think about where it should go - should it be part of a separate key rate class ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Finance Quant good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants