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

DOC: Requesting a Cookbook Example of fitting a bond curve #155

Open
Stochastic-Adventure opened this issue May 3, 2024 · 1 comment
Open
Labels
documentation Improvements or additions to documentation user question

Comments

@Stochastic-Adventure
Copy link

Hi @attack68 ,

I've come across your excellent rateslib and books via this Quant Stackexchange post:
https://quant.stackexchange.com/questions/78698/bond-curve-fitting-practical-question

I wonder if a real example, based on the discussion in that post, of fitting such a bond curve (preferably US Treasury, but other DM Sovereign bonds work too) using rateslib could be added to the cookbook in the future.

Also, can rateslib extract the zero curve and the forward curve from a fitted curve?

Thanks!

@attack68
Copy link
Owner

attack68 commented May 3, 2024

A fitted Curve in rateslib is just a series of (date, discount factor) pairs interpolated with some specific interpolation scheme.
The plot function plots forward rates of any tenor by extracting the discount factors from that Curve and making the necessary calculations to derive the rates and show it on a chart.
Curves in rateslib have a rate method which allows forward rates to be calculated.

The zero rate is technically probably an even easier calculation becuase it requires looking up just one discount factor per date instead of two, however it is not implemented because personally I have found little use for zero rates, but I imagine it would be quite an easy pull request.

I will bear the docs request in mind. Thanks for message.

@attack68 attack68 added documentation Improvements or additions to documentation user question labels May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation user question
Projects
None yet
Development

No branches or pull requests

2 participants