1% MortgageLoanDerivation.tex
  2%
  3%  Used as an example of how to write a short mathematical article.
  4%  Run the "Typeset" command twice in TexShop, otherwise you won't get the table of contents.
  5
  6\tracinglostchars=3  % Generate an error message if a UTF-8 character is not supported.
  7
  8
  9
 10\documentclass{article}
 11
 12\author{ Sean E. O'Connor}
 13\title{Mortgage Loan Derivation}
 14
 15
 16
 17\usepackage{amssymb}  % American Mathematical Society math symbols and equation formats.  For more packages, see  https://www.ctan.org/
 18
 19\usepackage{amsthm}     % Help in writing theorems.
 20
 21\newtheorem{lemma}{Lemma}[section]  % variable name, caption, section number.
 22\theoremstyle{definition} % Bold title, Roman text body.
 23
 24\newtheorem{theorem}{Theorem}[section]
 25\theoremstyle{definition} % Bold title, Roman body.
 26\RenewDocumentCommand{ \qedsymbol }{}{ \(\blacksquare\)  }  % Redefine the Q.E.D. symbol as a mathematical black square.
 27
 28\newtheorem{remark}{Remark}
 29\theoremstyle{remark} % Italic title, Roman body.
 30
 31
 32\usepackage{booktabs}
 33
 34
 35
 36\usepackage[
 37  colorlinks
 38]{hyperref} % Hyperlinks.  This must be the last package loaded.
 39
 40\hypersetup{
 41   urlcolor=red,
 42   citecolor=purple,
 43   linkcolor=blue
 44 }
 45  
 46  
 47  
 48\begin{document}
 49
 50\maketitle
 51
 52
 53
 54\begin{abstract}
 55We derive the equations for a \emph{mortgage} loan and give several useful formulas
 56\footnote{Using using \LaTeX and \TeX Shop.  See \url{https://www.ctan.org}} 
 57\end{abstract} 
 58
 59
 60
 61\tableofcontents
 62
 63
 64
 65\pagebreak 
 66
 67\section{The Repayment Structure of a Mortgage Loan}
 68
 69\subsection{Definition of Interest Rate}
 70
 71The interest rate on the loan note is quoted as a yearly amount but is applied periodically for $m$ periods per year, giving
 72
 73\begin{equation}
 74i =  {{Annual  \: interest    \:  percent / 100} \over m}
 75\end{equation}
 76
 77Most house and car loans have a monthly period, $m = 12$.    % Inline math can use dollar sign delimiters like MathJax
 78
 79\emph{NOTE:}  This is NOT the APR, which is the interest percentage as if the loan were compounded yearly instead of monthly.  I would ignore the APR.
 80
 81\subsection{Periodic Payments of Principal + Interest}
 82
 83The $j^{th}$ payment PMT consists of interest $I_j$ on the previous unpaid balance $BAL_{j-1}$
 84
 85This payment is a fixed amount every month by design.
 86
 87Only the remainder of the payment after interest  $R_j$ actually reduces the principal of the loan.
 88
 89Payments from the initial payment to the end payment have the form,
 90
 91\begin{tabular}{ clll }
 92\toprule
 93Payment Number & Payment Amount  & Interest & Balance \\
 94\midrule
 95${1^{st}}$   &   $PMT = R_1 + I_1$   &   $I_1 = i \: BAL_0$   &  $BAL_1 = BAL_0 - R_1$  \\
 96$2^{nd}$    &   $PMT = R_2 + I_2$   &  $I_2 = i \: BAL_1 $   & $BAL_2 = BAL_1 - R_2$ \\
 97\ldots & \ldots & \ldots & \ldots \\
 98$j^{th}$      &  $PMT = R_j + I_j$      & $I_j = i \: BAL_{j-1}$  &  $BAL_j = BAL_{j-1} - R_j$ \\
 99\ldots & \ldots & \ldots & \ldots \\
100$n^{th}$      &  $PMT = R_n + I_n$  & $I_n = i \: BAL_{n-1}$ &  $BAL_n= BAL_{n-1} - R_n = 0 $ \\
101\bottomrule
102\end{tabular}
103
104n = the number of periods of the loan
105
106\begin{remark}
107The loan amount is $PV = BAL_0$ which is the original balance before any payments are made.
108\end{remark}
109
110\begin{remark}
111The last balance is 0 because the loan is paid off, $BAL_n = 0$.
112\end{remark}
113
114We could write an Excel, Perl or Python script to compute this, but there are closed form solutions as we'll show.
115
116\pagebreak 
117
118\section{Closed Form Solution}
119
120\subsection{Difference Equation}
121
122Substituting we get a difference equation for the balances in terms of interest i and constant periodic payment PMT,
123
124\begin{equation}
125BAL_j = BAL_{j-1} - PMT + I_j
126\end{equation}
127
128\begin{equation}
129BAL_j = BAL_{j-1} - PMT + i BAL_{j-1}
130\end{equation}
131
132\begin{equation}
133BAL_j = (1+i) BAL_{j-1} - PMT
134\end{equation}
135
136Let's solve this difference equation.  But first, some lemmas,
137
138\begin{lemma}{}
139The geometric progression
140
141\begin{equation}
142g = 1 +  b + b^2 + \ldots + b^{n-1}
143\end{equation}
144
145has the formula,
146
147\begin{equation}
148g = {{1 - b^n} \over {1 - b}}
149\end{equation}
150
151\end{lemma}
152
153\begin{proof}
154
155Multiply by b and subtract,
156
157\begin{equation}
158g - b g = g(1 - b) = \left( 1 +  b + b^2 + \ldots + b^{n-1}  \right) - \left( b +  b^2 + b^3 + \ldots + b^n \right) = 1 - b^n
159\end{equation}
160
161to get
162
163\begin{equation}
164g = {{1 - b^n} \over {1 - b}}
165\end{equation}
166
167\end{proof}
168
169\begin{lemma}{}
170 If
171
172\begin{equation}
173u_k = a + b u_{k-1}
174\end{equation}
175
176then 
177
178\begin{equation}
179u_n = a {1 - b^n  \over 1-b } + b^n u_0
180\end{equation}
181
182\end{lemma}
183
184\begin{proof}   Expand out terms to see the pattern and use mathematical induction if you like,
185
186\begin{equation}
187u_1 = a  + b u_0
188\end{equation}
189
190\begin{equation}
191u_2 = a  + b u_1 = a + b(a + b u_0) = a (1 +  b) + b^2 u_0
192\end{equation}
193
194\begin{equation}
195u_3 = a  + b u_2 = a + b [ (1+b) + b^2 u_0] = a (1 +  b + b^2) + b^3 u_0
196\end{equation}
197
198The general formula is
199
200\begin{equation}
201u_n = a (1 +  b + b^2 + \ldots + b^{n-1}) + b^n u_0
202\end{equation}
203
204Now use the geometric progression lemma above.
205
206\end{proof}
207
208\subsection{Closed Form Solution for $BAL_k$}
209
210To solve the balance difference equation let $u_k = BAL_k$, $a = -PMT$, and $b = i+1$
211
212The balance AFTER payment k is then
213
214\begin{equation}
215BAL_k = {(-PMT) {1 - (1+i)^k \over 1 - (1+i) } + (1+i)^k BAL_0}
216\end{equation}
217
218rearranging,
219
220\begin{equation}
221BAL_k =  {1 \over  (1+i)^{-k} }   \left(  PV + PMT  { (1+i)^{-k} -1 \over i }   \right)
222\end{equation}
223
224Now set $BAL_n = 0$ because the last nth payment PMT finishes the mortgage.
225Check:  $BAL_0 = PV$
226
227\pagebreak 
228
229\section{Other Useful Closed Form Solutions}
230
231\subsection{Periodic Payment PMT From PV, n and i}
232
233The constant periodic payment is then
234
235\begin{equation}
236PMT =  {i PV \over  1-(1+i)^{-n}} 
237\end{equation}
238
239\subsection{Number of Periods n from PV, i and PMT}
240
241The number of periods (months) comes from the loan amount PV and the periodic payment PMT after inverting,
242
243\begin{equation}
244n = -{ ln \left(     {1 - i {PV \over PMT}}    \right) \over { ln( 1 + i ) } }
245\end{equation}
246
247where we're using the natural logarithm, but any log will work.
248
249\subsection{Reduced Number of Periods $n'$ from Increasing the PMT}
250
251You can use this to determine the reduced number of periods if you prepay principal.  Change $PMT$ to $(PMT + additional\:  principal \: prepayment)$
252
253\begin{equation}
254n' = -{ ln \left(     {1 - i {PV \over {PMT + additional\:  principal \: prepayment}}}       \right) \over { ln( 1 + i ) } }
255\end{equation}
256
257\subsection{Equivalent Simple Interest $i'$}
258
259Equivalent simple interest $i'$ on the loan is how much interest would have been had it been payable up front immediately.
260
261We use this formula to deduce it,
262
263\begin{equation}
264PV + i' PV = n PMT
265\end{equation}
266
267Equivalent simple interest is then
268
269\begin{equation}
270i' =  {n i \over  1-(1+i)^{-n}} -1
271\end{equation}
272
273\subsection{Accumulated Interest Payments j though k}
274
275What is the accumulated interest for payments j though k inclusive?
276
277\begin{equation}
278Int_{j \rightarrow k} = I_j + \ldots + I_k
279\end{equation}
280
281\begin{equation}
282Int_{j \rightarrow k} = \left( k - j + 1 \right) PMT - \sum_{l=j}^k R_l
283\end{equation}
284
285but
286
287\begin{equation}
288BAL_l - BAL_{l-1} = -R_l
289\end{equation}
290
291We get a telescoping sum
292
293\begin{equation}
294- \sum_{l=j}^k R_l = BAL_k - BAL_{j-1}
295\end{equation}
296
297Interest AFTER the kth payment is
298
299\begin{equation}
300Int_{1 \rightarrow k}  = k PMT + BAL_k - PV
301\end{equation}
302
303Check:  When $k=n$,
304
305\begin{equation}
306Int_{1 \rightarrow n}  = n PMT + BAL_n - PV = n PMT - PV
307\end{equation}
308
309as expected because the total n payments of PMT include repaying PV plus interest.
310
311\end{document}