We want to understand the relationships between the mortgage
payment rate of a fixed rate mortgage, the principal (the amount borrowed), the
annual interest rate, and the period of the loan. We are going to assume (as is usually the case in the U. S.) that
payments are made monthly, even though the interest rate is given as an annual
rate. Let's define
peryear =
1/12; percent = 1/100;
So the number of payments on a thirty-year loan is
360
and an annual percentage rate of 8% comes out to a monthly
rate of
0.0067
Now consider what happens with each monthly payment. Some of the payment is applied to interest
on the outstanding principal amount, P,
and some of the payment is applied to reduce the principal owed. The total amount, R, of the monthly payment, remains constant over the life of the
loan. So if J denotes the monthly interest rate, we have R = J*P + (amount
applied to principal), and the new principal after the payment is applied is
P + J*P - R = P*(1 + J) - R =
P*m - R ,
where m = 1 + J.
So a table of the amount of the principal still outstanding after n payments is tabulated as follows for a
loan of initial amount A, for n from 0 to 6:
disp([n, P]),
P = simplify(-R + P*m);
end
[ 1, -R+A*m]
[ 2,
-R-m*R+A*m^2]
[ 3,
-R-m*R-m^2*R+A*m^3]
[ 4, -R-m*R-m^2*R-m^3*R+A*m^4]
[
5, -R-m*R-m^2*R-m^3*R-m^4*R+A*m^5]
[ 6, -R-m*R-m^2*R-m^3*R-m^4*R-m^5*R+A*m^6]
We can write this in a simpler way by noticing that P = A*mn + (terms divisible by R).
For example, with n = 7 we
have:
-R*(1+m+m^2+m^3+m^4+m^5+m^6)
.
So we see that the principal after n payments can be written as
P = A*mn - R*(mn- 1) / (m - 1).
A*m^N*(m-1)/(m^N-1)
A*(J+1)^N*J/((J+1)^N-1)
for rate = 1:10,
disp([rate,double(subs(R,[A,N,J],[150000,360,rate*percent*peryear]))]),
end
2.00 554.43
3.00 632.41
4.00 716.12
5.00 805.23
6.00 899.33
7.00 997.95
8.00 1100.65
9.00 1206.93
10.00 1316.36
Note the use of format bank to write the floating-point
numbers with two digits after the decimal point, and of syms to reset n to an undefined symbolic quantity.
There's another way to understand these calculations that's
a little slicker, and that uses MATLAB's linear algebra capability. Namely, we can write the fundamental
equation
Pnew = Pold*m - R
in matrix form as
vnew = B vold
where v is the
column vector and B is the square matrix
.
We can check this using matrix
multiplication:
[ m*P-R]
[ 1]
which agrees with the formula we had above. Thus the column vector [P; 1] resulting after n
payments can be computed by left multiplying the starting vector [A; 1] by the matrix Bn. Assuming m > 1, that
is, a positive rate of interest, the calculation
[eigenvectors, diagonalform] = eig(B)
[ 1, 1]
[ 0, (m-1)/R]
diagonalform =
[ m, 0]
[ 0, 1]
shows us that the matrix B
has eigenvalues m, 1, and corresponding
eigenvectors [1; 0] and [1; (m -1)/R] = [1; J /
R]. Now we can write the vector [A; 1] as a linear combination of the
eigenvectors: [A; 1] = x[1;
0] + y [1; J / R]. We can solve for the coefficients:
[x, y] = solve('A = x*1 + y*1', '1 = x*0 + y*J/R')
(A*J-R)/J
y =
R/J
and so
[A; 1] = (A - (R / J))*[1; 0] + (R / J)*[1; J]
and
Bn× [A; 1] = (A - (R / J))*mn*[1; 0] + (R / J)*[1; J].
So the principal remaining after n payments is:
P = ((A* J - R )*mn + R ) / J = A*mn - R *(mn - 1) / J.
This is the same result we obtained earlier.
To conclude, let's determine the amount of money A one can afford to borrow as a function
of what one can afford to pay as the monthly payment R. We simply solve for A in the equation that P = 0 after N payments.
R*(m^N-1)/(m^N)/(m-1)
For example, if one is shopping for a house and can afford
to pay $1500 per month for a 30-year fixed-rate mortgage, the maximal loan
amount as a function of the interest rate is given by:
disp([rate,double(subs(ans,[R,N,m],[1500,360,1+rate*percent*peryear]))]),end
2.00 405822.77
3.00 355784.07
4.00 314191.86
5.00 279422.43
6.00 250187.42
7.00 225461.35
8.00 204425.24
9.00 186422.80
10.00 170926.23