wilsonfreitas / python-fixedincome

A prototype module for fixed income calculation in Python
4 stars 9 forks source link

Implement interest rate conversion funcions #4

Open wilsonfreitas opened 11 years ago

wilsonfreitas commented 11 years ago

We have several parameters to specify an interest rate. Firstly, we can start to convert interest rates by changing only one parameter on each conversion.

For example: We want to convert a daily interest rate to a monthly one. To do that we could call the function monthly(.) passing the interest rate ir as a parameter. For periods we can use:

We should also consider compounding conversions.

and we can't forget DayCount and Calendar, but for now I don't have a clear idea how to implement those.

wilsonfreitas commented 11 years ago

Maybe this is a related issue. https://github.com/wilsonfreitas/python-fixedincome/issues/10

wilsonfreitas commented 11 years ago

All interest rate conversion thing relies on the conservation of compounding factor. Two interest rates are equivalent if they have the same compounding factor. So, if I want to see some rate in monthly basis, for example, what I have to do is to compute the CompoundingFactor for that InterestRate object and extract the implied rate of that CompoundingFactor with a monthly frequency. Taking this approach into account I can vary more than one parameter when I convert InterestRate's from one setup to another.