There are many variations of this sentence I hear when talking with people about getting a mortage:
At first you’re paying mostly interest but over time you pay less interest and more goes to the house.
But I never really stopped to understand what does it mean exactly. Enter the French Loan Amortization System.
What is this?
When you get a mortage loan (or any loan) with a fixed interest rate, every month you’re paying an established amount of money based on the quantity of the loan, the interest rate and the total number of payments (how long will you take to repay that loan).
With those three variables, you can calculate the fixed monthly payments based on a certain formula:
$$ PMT = P \times \frac{r\left(1+r\right)^n}{\left(1+r\right)^n-1} $$Being:
$$ PMT = Monthly \space payment $$ $$ P = Principal \left(the \space amount \space of \space the \space loan \right) $$ $$ r = Periodic \space interest \space rate \left(e.g., monthly \space rate \right) $$ $$ n = Total \space number \space of \space payments $$How does it work?
So, say for example I want to get a 100.000€
loan to buy a house, I negotiated a 3.5%
annual fixed interest rate with the bank, and I intend to repay
the mortgage in 25 years
. To calculate how much am I paying every month:
- I calculate first the monthly interest rate (r):
3.5% / 12 = 0.29166666666 ≈ 0.292%
or0.00292
. - I calculate how many periods I will have to pay (n):
25 years x 12 months = 300 periods
.
I apply the formula:
$$ 100\,000 \times \frac{0.00292\left(1+0.00292\right)^{300}}{\left(1+0.00292\right)^{300}-1} ≈ 500.84 \,€ /monthly $$Ok that’s great. So now I know exactly how much I will be paying every month based on the terms of my loan. My next question then is:
What does it mean that some of it goes to interest repayment and the other part goes to the principal repayment?
I know that every month I pay interest on the remaining part of the loan, which means that for the first month I pay in interest:
$$ 100\,000 \times 0.00292 = 292\,€ $$If I subtract that amount from the monthly payment, the result is the part that goes to my part of the house (home equity):
$$ 500.84 - 292 = 208.84 \,€ $$What if I calculate it for the second month?
What is left now to pay is the difference between the initial loan amount minus the part of my payment that went to the home equity (because the other part went straight to repaying the interest of the loan):
My new principal is then:
$$ 100\,000 − 208.84 = 99,791.16 \,€ $$And if I calculate again the interest I pay on the second month:
$$ 99,791.16 \times 0.00292 = 291.39 \,€ $$So what goes to the home equity is then:
$$ 500.84 - 291.39 = 209.45 \,€ $$Which means that a whopping additional 61 cents
went this month to repay the home equity!
If we put this in a tabular way we can visually see how every month the part of the monthly payment that goes to repay the principal increases:
Month | Payment (EUR) | Interest (EUR) | Principal (EUR) | Balance (EUR) |
---|---|---|---|---|
1 | 500.84 | 100,000 × 0.00292 = 292.00 | 500.84 − 292.00 = 208.84 | 100,000.00 − 208.84 = 99,791.16 |
2 | 500.84 | 99,791.16 × 0.00292 ≈ 291.39 | 500.84 − 291.39 = 209.45 | 99,791.16 − 209.45 = 99,581.71 |
3 | 500.84 | 99,581.71 × 0.00292 ≈ 290.78 | 500.84 − 290.78 = 210.06 | 99,581.71 − 210.06 = 99,371.65 |
4 | 500.84 | 99,371.65 × 0.00292 ≈ 290.17 | 500.84 − 290.17 = 210.67 | 99,371.65 − 210.67 = 99,160.98 |
The formulas that formalize the interest for the period, principal repaid and new balance are:
$$ Interest \space for \space the \space period \left(I_t\right) = Balance_{t-1} \times r $$ $$ Principal \space repaid \left(A_t\right) = Monthly \space payment \left(PMT\right) - I_t $$ $$ Balance_t = Balance_{t-1} - A_t $$How about automating this?
A small python script does the trick. It doesn’t give me the exact amounts but it’s close enough to illustrate the point.
import pandas as pd
def french_amortization_schedule(P, annual_rate, years):
# Convert annual interest rate to monthly rate
rf = annual_rate / 12
r = round(rf, 5)
print('monthly_rate', r)
n = years * 12 # total number of monthly payments
print('total months', n)
# Calculate fixed monthly payment
montly_payment = P * (r * (1 + r) ** n) / ((1 + r) ** n - 1)
schedule = []
balance = P
for month in range(1, n + 1):
interest = balance * r
principal = montly_payment - interest
balance = balance - principal
schedule.append({
'Month': month,
'Payment': round(montly_payment, 3),
'Interest': round(interest, 3),
'Principal': round(principal, 3),
'Balance': round(balance, 3)
})
return pd.DataFrame(schedule)
# Example usage:
P = 100000 # Loan amount
annual_rate = 0.035 # 3.5% annual interest
years = 25 # 25-year term
amortization_df = french_amortization_schedule(P, annual_rate, years)
print(amortization_df.head(5)) # Print the first 5 months of the schedule
monthly_rate 0.00292
total months 300
Month Payment Interest Principal Balance
0 1 500.838 292.000 208.838 99791.162
1 2 500.838 291.390 209.448 99581.714
2 3 500.838 290.779 210.060 99371.654
3 4 500.838 290.165 210.673 99160.982
4 5 500.838 289.550 211.288 98949.693
I asked ChatGPT if there’s any library that does these kinds of calculations and pointed me to numpy-financial, where it uses
the numpy_financial.pmt(interest_rate, number_of_periods, principal)
function to calculate the fixed monthly payment:
# Calculate the fixed monthly payment using npf.pmt.
# Note: npf.pmt returns a negative value (cash outflow), so we multiply by -1.
payment = -npf.pmt(r, n, P)
And the numpy_financial.ipmt(interest_rate, payment_period, number_of_periods, principal)
to calculate the interest for a specific period.
interest = -npf.ipmt(r, month, n, P)
Where does the formula come from?
Ok, so I understand how I get the fixed monthly payment by virtue of applying the formula at the beginning, and the split between the amount that progressively goes to interest and then flows into home equity.
But, where does it come from? Also, it sort of evokes how the discounted cash flow method for estimating the value of a startup (or any investment where you expect a predictable stream of cash flows) works.
Well, turns out it is the case. The french amortization formula is a direct application of the Discounted Cash Flow method for valuing the viability of an investment. It estimates the present value of an investment today based on projections of the periodic cash flows that the investment will generate over a period of time.
The formula is:
$$ PV = \sum_{t = 1}^{n} \frac{CF_{t}}{\left(1 + r\right) ^ t} $$In this context, the bank I am asking for the loan is making an investment 🐼in me🐻❄️ by giving me the money and expecting a series of fixed cash flows in the future at a certain rate of interest.
So the amount of money they give me today is the Present Value of their investment, and applying the formula using the fixed payments as the cash flows should yield the same amount. Right?
monthly_rate 0.00292
total months 300
rf = 0.035 / 12
r = round(rf, 5)
periods = years * 12
summation = 0
for i in range(1, periods + 1):
summation += 500.838 / (1 + r) ** i
print('summation', summation)
# summation 99999.97572290635 €
Not even 3 cents off so I am taking this as a win 🎉.
Yes but how do you clear the monthly payment from a summation formula?
I had to brush up on my university calculus for this, but certain algebraic formulas have what is called a “closed-form solution”, which is an equivalent formula using a fixed set of constants, variables and functions considered “basic”.
The closed-form formula for the Present Value is:
$$ PV = PMT \cdot \frac{1 - \left(1 +r\right) ^ {-n}}{r} $$Solving for PMT we get:
$$ PMT = PV \cdot \frac{r}{1-\left(1+r\right)^{-n}} $$And if we multiply the numerator and denominator by (1 + r) ^ -n
we get the initial formula for the PMT shown in the first section, we went full circle.
Hopefully now it’ll make a bit more sense where is your money going when making fixed payments in a mortgage, assuming they use the French amortizacion formula.
Have fun!