How do you calculate the discount margin of a floating rate bond using flat yield? What is the formula?
2 Answers
-
1
I am a co-author of that paper. You may want to check out FinancePy which is a beta version of a finance library where I have implemented the code for calculating the discount margin. Here is an example Jupyter notebook that reproduces (almost exactly) a Bloomberg example.
The underlying code is in
https://github.com/domokane/FinancePy/blob/master/financepy/products/bonds/FinBondFRN.py
Contact me at [email protected] if you have any issues or questions regarding FinancePy.
-
$\begingroup$ Can your library also be used for bonds with irregular cashflows? Eg if I have modelled the cashflows from an ABS / RMBS / bespoke investment separately (I don't want your library to do that), can I use your library to calculate the DM of those cashflows? $\endgroup$ Commented Feb 9, 2021 at 23:09
-
$\begingroup$ It should be possible - you would need to set the internal date and flow schedule (one is a list of dates and the other is a list of floats) - as everything is open in Python this should be possible. Can you add this as a request on github issues github.com/domokane/FinancePy/issues and I can see if I can add a method which makes it easier to do and has some validation checks. Or contact me via [email protected] $\endgroup$– DomCommented Feb 10, 2021 at 9:30
-
$\begingroup$ Could you elaborate on what $L_{\text{stub}}$ is or how it is calculated? $\endgroup$ Commented Apr 30, 2023 at 3:29