How do mortgage calculators work?
Mortgage maths with huge consequences.
· 7 min read
Change one number, and your mortgage payment jumps. But why? Let’s break down how mortgage calculators actually work in Singapore.
The mortgage formula #
A mortgage is a loan collateralised and secured (hence the term secured loan or secured line of credit) by the value of the home itself. Each monthly payment made to the mortgage goes partly towards the principal and partly towards interest. How do we determine how much to pay each month? To build intuition, let’s first see what happens if you skip payments, and how the loan balance grows over time.
We’ll be ignoring fees, penalties, or other charges. Let $L$ be the loan balance at a certain point in time, and $r$ the monthly interest rate.1 If you miss a payment, the loan balance will balloon to $\left(1 + r\right) L$ after a month. If you miss the next payment again, the loan balance will become $\left(1 + r\right)^2 L$. In general, the passing of each month increases the loan balance of the previous month by a factor of $\left(1 + r\right)$.
This means the payment made to the mortgage each month must be big enough not only to offset the increase in the loan balance but also to reduce it further, so that by the end of the loan tenure, the balance reaches zero. What complicates things is that the loan balance shrinks over time, but the repayment amount is fixed. The payment has to be “just right”, large enough to cover interest each month and still reduce balance, while ensuring it hits zero exactly at the end of the tenure. How do we calculate this “right” amount?
Let $N$ be the tenure of the mortgage, expressed in months. Let $L_k$ be the loan balance in the $k$-th month. So $L_0$ is the initial loan amount, and we need $L_N = 0$. Let $p$ be the monthly payment amount. As per the discussions above, we need $p$ so that for all $k \ge 0$ we have the constraint $$L_{k+1} = \left(1 + r\right) L_k - p.$$ This is a recurrence relation with the general solution (I’m omitting the mechanical steps here) $$L_N = \frac{\left(1+r\right)^N \left(rL_0 - p\right) + p}{r}$$ for all $N \in \{0,1,\ldots\}$. Letting $L = L_0$, setting $L_N = 0$, and solving for the monthly payment $p$ yields $$\boxed{p = \frac{r}{1 - \left(1 + r\right)^{-N}} L} \quad (r \ne 0).$$ For example, if $L = \$1000000$, $r = 2.4\% / 12 = 0.002$, and $N = 30 \cdot 12 = 360$, we have $p \approx \$3899.41$. We could plot the quantity $p/L$ (in percentage) against $r$ and $N$ as follows:
What does this mean? #
It’s one thing to take the formula as it is. But we can learn more by playing with the variables.
We first see that the monthly payment amount is directly proportional to the loan balance $L$. Double the $L$, double the $p$, while holding other variables constant.
Unsurprisingly, as the interest rate $r$ goes to zero, the monthly payment tends to $L/N$ (by l’Hôpital’s rule). Basically, at zero interest rate, the loan balance is split evenly across every month. This sets the floor for monthly payment. To understand the dependence of $p$ on $r$ more qualitatively, we note that the Taylor series expansion of $p/L$ at $r = 0$ is $$\frac{p}{L} = \frac{1}{N} + \frac{N + 1}{2N} r + O(r^2).$$ Here we see that $p/L$ is approximately linear in $r$, though not directly proportional. Furthermore, observe that $$\frac{d(p/L)}{dr} = \frac{N + 1}{2N} + O(r) \approx \frac{1}{2},$$ implying that the sensitivity of $p/L$ relative to $r$ is approximately constant and unaffected by the loan tenure. Using an example of $N = 12 \cdot 30 = 360$, we have the following graph:
We also see that increasing $N$ decreases $p$, which should correspond to most people’s intuition. As $N$ increases to infinity, $p$ tends towards $rL$. This makes sense: as the mortgage becomes perpetual, the payment each month exactly equals the increase in loan balance due to interest, with no reduction to the loan balance itself. On the other hand, as $N$ tends towards zero, $p$ tends towards infinity. We have the following graph:
This clearly shows that extending the loan tenure has diminishing returns.
Loan balance at a given month #
We find the loan balance at the $M$-th month by simply substituting the mortgage formula into the general formula for $L_M$, giving $$\boxed{L_M = \frac{1 - \left(1 + r\right)^{-\left(N - M\right)}}{1 - \left(1 + r\right)^{-N}} L}.$$ As an example, let $N = 12 \cdot 30 = 360$. A plot of the ratio $L_M/L$ as a percentage is as follows:
As expected, the percentage starts off at 100% then gradually declines at a higher and higher rate towards 0% at the end of the tenure. At each point in time, the equity in the home is simply the home price (asset) minus the loan balance (liability).
Refinancing at the same rate #
Many people misunderstand what refinancing does when the interest rate is kept the same. Some believe that because the “amortisation schedule is restarted”, the new monthly payment must be higher. This is nonsense. We can show why mathematically.
Let $N$ be the loan tenure in number of months as usual, and $p_1$ the initial monthly payment. Suppose we refinance at month $0 \le M \le N$ for a monthly payment of $p_2$. Let the loan balance at the $M$-th month be $L_M$. After refinancing, the new monthly payment amount is $$p_2 = \frac{r}{1 - \left(1 + r\right)^{-\left(N - M\right)}} L_M.$$ Substituting $L_M$ for the formula found in this section, we get $$p_2 = \frac{r}{1 - \left(1 + r\right)^{-\left(N - M\right)}} \cdot \frac{1 - \left(1 + r\right)^{-\left(N - M\right)}}{1 - \left(1 + r\right)^{-N}} \cdot L = \frac{rL}{1 - \left(1 + r\right)^{-N}} = p_1$$ as required. As long as the interest rate stays the same and the loan tenure isn’t extended, the new and old monthly payment amount must be the same.
Refinancing at a lower rate #
If refinancing at the same rate without extending the tenure keeps the monthly payment the same, then refinancing at a lower rate must reduce the monthly payment. This is intuitive. However, you might not know that the benefit of refinancing at a lower rate diminishes as you pay down the loan balance over time. In other words, as the loan balance decreases over time, the monthly payment is reduced by a smaller and smaller amount after refinancing, given the same reduction in interest rate.
Suppose we refinance from rate $r_1$ to rate $r_2$ at month $M$. Let $N$ be the original loan tenure. The loan balance at month $M$ is $$L_M = \frac{1 - \left(1 + r_1\right)^{-\left(N - M\right)}}{1 - \left(1 + r_1\right)^{-N}} L$$ and the monthly payment for the first $M$ months is $$p_1 = \frac{r_1}{1 - \left(1 + r_1\right)^{-N}} L.$$ After the $M$-th month, the new monthly payment is $$p_2 = \frac{r_2}{1 - \left(1 + r_2\right)^{-\left(N - M\right)}} L_M.$$ Dividing, $$\frac{p_2}{p_1} = \frac{ \displaystyle\left(\frac{r_2}{1 - \left(1 + r_2\right)^{-\left(N - M\right)}}\right) }{ \displaystyle\left(\frac{r_1}{1 - \left(1 + r_1\right)^{-\left(N - M\right)}}\right) }.$$ As an example, consider a case where $r_1 = 3\% / 12 = 0.0025$, new interest rate $r_2 = 2.4\%/12 = 0.0020$, and $N = 12 \cdot 30 = 360$ representing a 30-year mortgage.
The ratio $p_2/p_1$ increases over refinance time, implying refinancing at a later date results in a smaller reduction in $p_2$ relative to $p_1$, all else being equal. In other words, over time, the monthly payment becomes less sensitive to interest rate changes. This also means that refinancing to a lower rate earlier is better than later, and that the interest rate risk of the mortgage from the debt holder’s point of view decreases over time, as being less sensitive to interest rate changes also means rate hikes affect the debt holder less.
Banks typically quote annual interest rates. To get the monthly interest rate, we would simply divide the annual interest rate by 12. In some sense, this is not exactly right. If $r$ is the annual rate, the monthly rate should’ve been $$\left(1 + r\right)^{1/12} - 1,$$ which corresponds to the effective monthly compounding rate. But in practice, this is not how banks in Singapore design their mortgages. In addition, since $r$ is small, the results from the two methods don’t differ by much. We can see this by noting the Taylor series expansion at $r = 0$: $$\left(1 + r\right)^{1/12} - 1 = \frac{r}{12} + O(r^2)$$ implying the two differs only by an order of $O(r^2)$, which is tiny. ↩︎