Formula for computing monthly compounding interest from annual compounding interest
Say my bank reports that a given fund earns 7% annually. However, an investor did not allocate the full year's investment on January 1,st but rather, evenly across all 12 months. In this case, only the first month's rent would have received the 7% interest but the remaining 11 investments would have received fractions of the 7%.
What formula allows me convert an annual compounding interest to a monthly?
And even more broadly, what about weekly, daily, or continuous interest conversions, all supposing regularly scheduled investments?
I referenced the formula here, but it breaks when the percentage is less than 1%. In this case, the formula's returned amounts exploded (<1% much higher return than >1% up to a threshold ~4%.)
Note, the formula works in the linked tool, yet when I implement in python, I don't get the same results. Feel free to look at Colab code. This makes me believe that the web page has some other code at work then the listed formula.
Solution 1:
It is imprecise to say that payments that have not had a full year to accrue interest only earn a "fraction of the 7%." They earn interest at the same effective rate, just not over the same time period. The rate of interest tells you how much return you will see for each unit of time, much in the way that a speed tells you how much distance you will travel per unit of time. Two cars each traveling at 60 km/h are traveling at the same speed, but if one stops after 1 minute and the other stops after 2 minutes, the total distance traveled will be different. So it is better to say that such payments accrue less interest, rather than saying they earn a fraction of the rate.
If payments occur at the beginning of the month, then for an annual interest rate of $i$, the formula for the accumulated value at the end of $1$ year is $$\require{enclose} K \ddot a_{\enclose{actuarial}{12} j} = K \left(1 + j \right) \frac{(1 + j)^{12} - 1}{j} = K \frac{(1+j)i}{j},$$ where $K$ is the amount of payment per month, and $j = (1 + i)^{1/12} - 1$ is the effective monthly interest rate. So for $i = 0.07$, we have $j = 0.00565415$, and for $K = 1000$ per month, the accumulated value after $1$ year is $$1000 \frac{(1.00565415)(0.07)}{0.00565415} \approx 12450.30.$$ The total amount of interest accrued through investment is then $12450.30 - 12(1000) = 450.30$. Contrast this result with the situation where the entire amount of $12000$ is invested at the beginning of the year, which would yield $(12000)(1.07) = 12840$ at the end of the year.
In general, if $m$ is the annual compounding rate (number of times of interest is compounded per year), then the nominal $m^{\rm th}$-ly rate of interest is $$i^{(m)} = m \left((1 + i)^{1/m} - 1\right)$$ and the effective $m^{\rm th}$-ly rate of interest is $j = i^{(m)}/m$. Consequently, the accumulated value after $1$ year will be $$K\ddot a_{\enclose{actuarial}{12} j} = K\left(1+\frac{m}{i^{(m)}}\right) i = K \left(1 + \frac{1}{(1+i)^{1/m} - 1}\right) i.$$
The important thing to keep in mind is that if payments occur more frequently, the amount of each payment should be proportionally less in order for the total amount that is paid to be the same. For instance, $1000$ per month is $12000$ per year but it is also approximately $32.88$ per day (assuming $365$ days in a year). Otherwise, the compounding formula will increase without bound, not because it is flawed, but because you are telling the formula to calculate, for example, how much you would accrue if you contributed $K = 1000$ per day rather than $K = 32.88$ per day. To adjust for this, you could say that if $K$ is the annual amount to contribute, then $K/m$ is the $m^{\rm th}$-ly amount to contribute, hence the formula becomes $$\frac{K}{m} \left(1+\frac{m}{i^{(m)}}\right) i = \frac{K}{m} \left(1 + \frac{1}{(1+i)^{1/m} - 1}\right) i.$$ Now if we use $K = 12000$ per year, compounded $m = 365$ times a year, at effective rate $i = 0.07$, we would have $$\frac{12000}{365}\left(1 + \frac{1}{(1.07)^{1/365} - 1}\right)(0.07) \approx 12416.4.$$ Why is this value less than the monthly case? The reason becomes evident if you realize that the fewer periodic payments you make, the greater the fraction of the total annual payment of $12000$ is made at the beginning of the year and thus has had more time to accrue interest. For example, if $m = 1$, there is only one payment at the beginning of the year, and the formula reduces to $K(1+i)$.
In closing, the formula you want to program should be:
$$\frac{K}{m} (1 + i)^{1/m} \frac{(1 + i)^{n/m} - 1}{(1 + i)^{1/m} - 1},$$ where:
- $K$ is the total annual payment, to be divided equally among $m$ periods.
- $m$ is the number of times of compounding per year.
- $i$ is the effective annual interest rate.
- $n$ is the number of periods of investment (in the above discussion, we assumed $n = m$ periods, i.e., one full year).
This formula looks different than the ones previously shown because it does not assume $n = m$. So if you wanted to compute the accumulated value after, say, $2$ years compounded monthly, you would choose $n = 2m = 2(12) = 24$ (i.e., $24$ months = $2$ years). If you wanted to compute the accumulated value after $18$ months, then you would choose $n = 18$, and so forth.