The brief
A company treasurer has cash to place for one year. Five banks have sent offers, each quoted in its own convention: once a year, twice a year, quarterly, monthly and continuously.
Headline rates cannot be compared across conventions. The treasurer needs every offer on one footing before choosing.
Your task
- Write
effective_annual(rate, per_year): the effective annual rate of a quoted rate.per_yearis the number of compounding periods in a year, andNonemeans continuous compounding. - Write
continuous_equivalent(rate, per_year): the continuously compounded rate with the same growth over a year. Risk systems store rates in this form. - Write
rank_offers(offers): the offer names, best first.
The data
OFFERS in the code lists the five offers, each with a name, a quoted rate and its convention.
Hint: Where to start
Growth over one year is with periods, and when compounding is continuous. Lesson 1.4.6 works through both.
Hint: Going the other way
To find the continuous rate , set equal to the growth of the quoted rate and take logs of both sides.