Math 132
Loans and First-Order Finite Difference Models
by S. R.. Lubkin, based on work by R. White
Application
This lesson deals with the time value of money and compound interest. We
will examine loans with monthly payments. What should our monthly payments
be in order to pay the loan off after a certain number of months?
Math Model
Definitions
Always be clear what your definitions are. We will use the symbol := to
indicate a definition, since that is Maple's notation.
t := time (units are integers)
yt := amount owed in month t (units
are $)
P := monthly payment (units are $)
I := annual interest rate
Note that yt is also called the principal.
Dynamical System
Let's begin with our word equation. The dynamics of the loan are
as follows: The amount you owe each month is based on the amount you owed
in the previous month, plus interest, minus the amount you have paid back.
In a word equation this looks like:
(amount owed this month) = (amount owed last month) + (interest
on last month's principal) - (monthly payment)
We need to make a further model of one of the terms, the interest, noting
that the interest is based on what you owed:
(interest on last month's principal) = (amount owed last month)*(annual
interest rate)/12
Now we can translate. We replace our words with symbols, and combine
the two word equations above to get
yt = yt-1 + yt-1*I/12
-P
Or, simplifying,
yt = (1 + I/12)*yt-1 - P
The above equation is called a finite difference model. It is an
example of a dynamical system, which is a mathematical model of
some process in time.
Notice that the finite difference model could easily be rewritten as
yt+1 = (1 + I/12)*yt - P
just by adding 1 to t, that is, going one month ahead.
Solution of the Model
What is a "solution" of a finite difference model? So far, we have yt
as a function of yt-1, but what we want is yt
as a function of t.
There are two main ways to solve the model, iteration and
algebra.
Iterative method:
We begin at the beginning. If we start with an initial balance of y0
at
time 0, then we can find the balance in month 1 by plugging
y0
into our finite difference equation. Then we can find
y2 by
plugging y1 into the finite difference equation, and
so on.
We have y0. Then
y1 = (1 + I/12)*y0 - P
gives us y1.
y2 = (1+ I/12)*y1 - P
gives us y2. Repeat as necessary. You could see that
this might be tedious unless we used a computer. Unfortunately, the iterative
method is not as powerful as the
Algebraic method:
This is kind of interesting. We want to find some formula which will give
us yt in terms of t directly, without having to
compute each monthly balance in between. Let's begin with a simpler finite
difference model,
yt+1 = a*yt + b
Then
yt+1 = a*yt + b
= a*(a*yt-1
+ b) + b
= a*(a*(a*yt-2
+ b) + b) + b
etc. until we are all the way back to y0
=
at+1*y0 + b*(at + ... + a + 1)
or, rearranging,
yt+1 = at+1*y0 + b*(1-at+1)/(1-a)
or, if you prefer yt in terms of t, which was
what we were trying to find in the first place,
yt = at*y0 + b*(1-at)/(1-a)
This is nice, because we only have one formula to compute to find, say,
y100, instead of 100 formulas with the iterative method.
The tidy result we just derived can be stated in the form of a theorem.
Theorem: For a finite difference equation of the form
yt+1 = a*yt + b
the solution yt is given by
yt = at*y0 + b*(1-at)/(1-a)
Applying the theorem to the specific example of our loan means that we
have a = (1 + I/12) and b = -P. (Careful of that minus sign!)
That gives
yt = (1 + I/12)t*y0 - P*(1-(1+
I/12)t)/(-I/12)
Example
Suppose we want to buy a car. Suppose we want to buy a $10,000 car. This
time Dear Aunt Martha is not feeling so generous, so we decide to take
out a loan for the entire amount. We get a loan for the annual rate of
6%. If our payment is $150 a month, how long will we have to be paying
the loan off? For that matter, suppose we want to have the car paid off
in exactly 2 years. What does our payment need to be each month in order
to pay the loan off in 24 months?
Solution:
Using our finite difference model for the example above gives us a finite
difference equation of
yt = (1 + .06/12)*yt-1 - 150
with an initial condition of y0 = 10,000. We will
implement the iterative method in Excel and check it against the formula
from the theorem.
Implementation in Excel:
Open a spreadsheet.
-
We will keep a parameter table in the spreadsheet so that we can
easily see the parameters, and change them if we want to try different
scenarios.
-
In column A we will put what month it is. Label the column and make a series
from 0 to however many months you want.
-
In column B we will put the balance owed, computed by the iterative method.
Note that in cell B3 we have used B2 to represent yt-1,
which should be different in every row where we are computing yt.
But we have used $F$3 and $E$3 to refer to parameters, and we don't want
Excel to look in a different row every time we are computing a new yt,
so the $ go into the cell references.
-
In column C, we will put the balance computed by the formula from the theorem.
Careful typing the formula! There is a lot of opportunity for error.
-
Copy the formula in B3 down to fill in the rest of column B. Likewise copy
down the formula in C3.
-
The numbers in columns B and C should be the same even though they were
computed by different methods.
| |
A
|
B
|
C
|
D
|
E
|
F
|
G
|
|
1
|
t
|
yt (iterative)
|
yt (formula)
|
|
parameters
|
|
|
|
2
|
0
|
10000
|
10000
|
|
I
|
P
|
|
|
3
|
1
|
=(1+$E$3/12)*B2 - $F$3
|
=(1+$E$3/12)^A3*$C$2 - $F$3*(1-(1+$E$3/12)^A3)/(-$E$3/12)
|
|
0.06
|
150
|
|
|
4
|
2
|
|
|
|
|
|
|
|
5
|
3
|
|
|
|
|
|
|
|
6
|
4
|
|
|
|
|
|
|
|
7
|
5
|
|
|
|
|
|
|
|
8
|
6
|
|
|
|
|
|
|
|
9
|
7
|
|
|
|
|
|
|
When the formulas are entered and copied down the numbers should look
like
|
A |
B |
C |
D |
E |
F |
G
|
|
1
|
t
|
yt (iterative)
|
yt(formula)
|
|
parameters
|
|
|
|
2
|
0
|
10000
|
10000
|
|
I
|
P
|
|
|
3
|
1
|
9900.00
|
9900.00
|
|
0.06
|
150
|
|
|
4
|
2
|
9799.50
|
9799.50
|
|
|
|
|
|
5
|
3
|
9698.50
|
9698.50
|
|
|
|
|
|
6
|
4
|
9596.99
|
9596.99
|
|
|
|
|
|
7
|
5
|
9494.97
|
9494.97
|
|
|
|
|
|
8
|
6
|
9392.45
|
9392.45
|
|
|
|
|
|
9
|
7
|
9289.41
|
9289.41
|
|
|
|
|
and we clearly don't pay it off for 84 months!
What should the payment be in order to pay off the loan in 24 months? We
need to use the algebraic method. The algebraic solution in general is
yt = (1 + I/12)t*y0 - P*(1-(1+
I/12)t)/(-I/12)
and in our case, our numbers give
0 = (1 + .06/12)24*10000 - P*(1-(1+ 0.06/12)24)/(-0.06/12)
since at t=24 we want yt to be zero! How do we
solve this for P? We can do it by hand (tedious and error-prone)
or we can use Maple.
Implementation in Maple:
In the linked worksheet we see that $150 payments
really won't pay it off in 24 months. We have to pay $443.21 per month. OK, but
when I check it in my spreadsheet at that payment level, I have overpaid by $0.10
by the end of 24 months. Why? Because in the real world you have to round payments
to the nearest penny.