APPM 2360 Lab #1: Mortgage 101
Due: October 5, 2015
1 Introduction
A pair of close friends are currently on the market to buy a house in Boulder. Both have obtained
engineering degrees from CU and have an understanding of differential equations but lack the
skills necessary to decide on what type of mortgage to take out on their new house. In the
following sections, you’ll find some research they have done on commonly used mortgage
structures. However, they have become busy and cannot continue their analysis. Since you are in
Differential Equations this semester, they have decided to enlist your help in writing a report to
understand their options.
Your task is to read the following sections and complete the tasks found in Section 3. Your
friends were nice enough to list various problems they would like solved. However, you should be
careful to write your responses in a cohesive report.
2 Background Information
In this section you will find information on some of the most prevalent mortgage structures.
2.1 Interest Compounding
Often, the interest of a loan is expressed as the annual rate, that is, the percent of the
outstanding balance that is charged as interest over a year. However, the frequency with which
the rate is applied to the current balance may vary. This frequency is how often the loan
compounds. If the interest is compounded annually, the formula to calculate the amount of money
owed after the first year is
y(1) = (1 + r)y(0),
where y(t) is the outstanding balance after t years, and r is the annual interest rate.
How would this change if, instead, the loan compounded semiannually? Then, half the interest
rate would be applied to the loan value every 6 months.
y(.5) =
1 +
r
2
y(0)
y(1) =
1 +
r
2
y(.5) =
1 +
r
2
1 +
r
2
y(0) =
1 +
r
2
2
y(0)
This pattern continues for any frequency of compounding. That is, if a loan is compounded n
times per year, the value of the loan after 1 year is
y(1) =
1 +
r
n
n
y(0)
The more frequently that a loan compounds, the higher the value at the end of the year. However,
there is a limit as n goes to infinity. The limit, which models a continuously compounding loan, is:
y(t) = y(0)e
rt
1
This model can also be expressed as a differential equation:
y
0
(t) = ry(t), y(0) = y
0
If the borrower makes a monthly payment of p dollars, the model becomes:
y
0
(t, y) = ry(t) 12p, y(0) = y
0
(1)
2.2 Adjustable vs. fixed rate mortgages
Some mortgages use a fixed annual rate, the r in the model. The interest rate which a borrower
receives depends on his/her credit score, the value of the house, the borrower’s income, the
duration of the loan, and several other factors. Fixed rate loans are sold with a minimum
monthly payment, which ensures that the loan will be paid off within the duration. The bank will
get all of the money back sooner with a shorter duration, so the rate is lower for this type of loan.
Adjustable rate mortgages start at a lower rate than a fixed rate loan, but after a certain period
of time, the interest rate increases and becomes tied to one of several public indexes. This results
in the interest rate increasing above the rate that a fixed-rate mortgage would have for the second
portion of the loan. Common fixed rate periods are 3,5,7, or 10 years. Mathematically, this
results in r being a function of time r(t) instead of a constant.
3 Questions
Your friends recently found a house on the market and needed to borrow $500,000 from the
bank in order to purchase. Your friends are very careful when reading mathematics so in your
analysis you should include as much relevant work as necessary so your friends can follow. They
provided you a list of possible questions that they need answered.
3.1 Analysis of Fixed Rate Mortgages
Your friends have various options when choosing a mortgage structure. The following points
should help you know what to include in your analysis.
1. First, examine the effect of continuous compounding on the value of a loan. Assuming that
r = .05 and the original balance is $500, 000, compute the total cost of the loan after 5 years
for loans compounded 1, 2, 4, 12 times per year, without any payments. Compare these
values to the cost of a loan compounded continuously.
2. Next, gain a broad understanding of the behavior of the loan value by determining whether
there any equilibrium solutions to (1). If so, what are they, and what is their stability?
What do these equilibria represent in real-word terms?
3. Determine the exact behavior of the loan in your friends’ situation by solving (1) using
separation of variables, with y(0) = 500, 000, r = .05.
4. The size of the monthly payment p that your friends are willing to make plays a large role in
deciding the type of loan they should choose. Use the solution to (1) to find the correct p to
pay off a 10 year fixed rate mortgage with rate 3% and initial debt of 500, 000. Do the same
for a 30 year fixed-rate mortgage with rate 5%.
2
5. While having a low monthly payment is nice, you should warn your friends that there is
quite literally a price to pay for this convenience. We can determine the total paid by
summing each monthly payment over the duration of the loan. How much interest is paid in
the 30 year fixed rate mortgage? The 10 year?
6. Buyers often choose to pay as much of the cost as they can up front so that they don’t have
to borrow quite so much. Might this option be worth it for your friends? How much money
would the borrower save in each case if he/she paid $50,000 down on the house? (That is,
the mortgage began at $450,000.)
7. What are the advantages and disadvantages of taking out a 30 year fixed rate mortgage as
opposed to a 10 year mortgage?
3.2 Programming Euler’s method
Often times, the differential equations we wish to solve will be difficult to solve by hand so we
enlist the help of a numerical scheme. Here we will utilize MATLAB to perform Euler’s method.
1. First we want to create each piece we need to calculate y
0
(t). Create functions r(t) and p(t)
which return a constant interest rate of 5%, and monthly payment 8, 000.
2. Now, we put the pieces together. Create a function y
0
(t, y), which takes in t and y as input
arguments, and outputs the value of y
0
at that point. Note that we can put the functions r
and p inside the function y
0
. This is known as a subfunction.
3. Finally, we must program Euler’s method. Use a step size of .01, and use a while loop to
run the method until the mortgage is paid off (y = 0). When will a mortgage initial for
$500,000 be paid off, with a constant interest rate of 5% and a monthly payment $8,000?
Include a plot of the solution y(t).
3.3 Analysis of Adjustable Rate Mortgages
Now we turn to the adjustable rate mortgages. Use the Euler’s method code for these problems.
You may also find the find command helpful. Type ‘help find’ into the command window to learn
more. Suppose that a bank offers an adjustable rate mortgage, with the rate fixed at 3% for the
first 3 years, and then the rate follows an index which behaves as r(t) = .05 + .002t + .003 cos(
π
5
t).
1. Suppose the borrower pays $3000 per month. How long will it take him/her to pay off the
mortgage?
2. What about if he/she pays $4500 per month?
3. How much interest is paid in each case?
4. Plot both scenarios on the same graph. Explain what is going on in it. How does the
interest rate affect the graph?
3.4 Conclusion
1. What do you think accounts for the rise in popularity of adjustable rate mortgages over
fixed rate mortgages? Which type of mortgage would you recommend to your friends who
are buying a house, and why?
3
4 Items to Remember
Your friends want a complete report so you should write full sentences explaining the
questions posed and your responses. Don’t simply number your responses to individual
questions.
All reports must be submitted to D2L by the due date in a .pdf format. Failure to do so will
result in a penalty. Any MATLAB code must also be submitted to D2L.
MATLAB code is bulky and hard to read. If you would like to include it in your report, do
so in an appendix.
Your friends are sticklers for the rules, so they really want you to follow all of the project
guidelines on the APPM 2360 webpage. Be sure to read these carefully before starting your
project!
4