Showing posts with label mortgage. Show all posts
Showing posts with label mortgage. Show all posts

Saturday, February 15, 2025

HP Prime and fx-CG 50: Percentage of a Mortgage Paid

HP Prime and fx-CG 50: Percentage of a Mortgage Paid


Introduction


The program PERMORTGAGE for the HP Prime, and PERMORT for the Casio fx-CG 50 calculates the percentage of mortgage paid off any time during the mortgage’s term.


Inputs:

N = The length of the mortgage (or loan) in number of monthly payments. The payments are assumed to be made at the end of the month.

R = The annual rate of the mortgage. Assume that this loan is fixed.

L = The amount of the loan.

D = The number of payments already made.


Assume that there is no balloon payment.


The % of mortgage paid is calculated by the following steps:


Step 1: Let P by the monthly payment: P = PMT(N, R, L, 0, 12, 12)

(the last two arguments are payments per year and compounding periods per year, both set at 12)


Both calculators featured use the cash flow convention. That is, all cash inflows (receipts) are positive and cash outflows (payments) are negative. In this case, the monthly payment (P) and balance remaining (B) are negative.


Step 2: Let B be the approximate balance using the FV (future value) function:

B = FV(D, R, L, P, 12, 12)


Step 3: Calculate the % of mortgage paid:

T = (1 + B / L ) * 100%



HP Prime Program Code: PERMORTGAGE


Syntax: PERMORTGAGE( nterm, rate, loan, npaid )

nterm = number of monthly payments for the entire term. Example for a 30 year term, nterm = 360

rate = annual rate of a mortgage

loan = loan amount

npaid = number of payments made


Result: % of the principal paid


Code:


EXPORT PERMORTGAGE(nt,rate,loan,np)

BEGIN

// n term, rate, loan,,n paid

// Percent of a Mortgage Paid

// Monthly payments assumed, end mode assumed

// Assume no balloon payment

// EWS 2024-11-01


LOCAL pymt,prct,baln;

pymt:=Finance.TvmPMT(nt,rate,loan,0,12,12);

baln:=Finance.TvmFV(np,rate,loan,pymt,12,12);

// PMT and FV will be negative

prct:=(1+baln/loan)*100;

RETURN prct;

END;



Casio fx-CG 50 Program: PERMORT


The program asks for a single calculation or range of calculations which is stored in Matrix Mat A. (The first row is has two zeros, and is used as a “header”.) The first column is the number of payments made, the second is the percentage of mortgage (loan) paid.


Code:


PmtEnd

“N (TERM)”? → N

“RATE”? → R

“LOAN AMT”? → L

Menu “TYPE”,”SINGLE”,1,”RANGE”,2

Lbl 1

Cmpd_PMT(N,R,L,0,12,12) → P

Cmpd_FV(D,R,L,P,12,12) → B

(1+B÷L)×100 → T

“PERCENT PAID =”

T

Stop

Lbl 2

“N1”? → A

“N2”? → B

“STEP”? → C

[ [ 0 ] [ 0 ] ] → Mat A

For A → D To B Step C

Cmpd_PMT(N,R,L,0,12,12) → P

Cmpd_FV(D,R,L,P,12,12) → B

(1+B÷L)×100 → T

Augment(Mat A, [ [ D ] [ T ] ]) → Mat A

Next

Trn Mat A → Mat A

“IGNORE TOP ROW - “

“ [ N PER ]” ◢

Mat A

Stop



Example


$100,000 loan over 30 years (360 payments). Screen shots were taking with the HP Prime emulator.


Percent of Mortgage Paid Example


Note that the % paid takes on a curve, the later we get into the term, the more principal is paid off. This program can be a demonstration of how amortization works.


Until next time,


Eddie


All original content copyright, © 2011-2025. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

Sunday, May 15, 2022

Python: Financial Functions (2nd Edition)

Python:  Financial Functions (2nd Edition)


This is an update to the python file, which I first released on May 17, 2020:


https://edspi31415.blogspot.com/2020/05/numworkscasio-micropythonpython.html


I am able to transfer and test the python file to a Numworks calculator through the online editor, and TI-84 Plus CE Python through the TI Connect CE.  Because only the math module is used, the python file can be run in most, if not all calculators with Python, as well as Python 3.  


What is included?


*  time value of money calculations

*  net present value and internal rate of return

*  net present value (xnpv) and internal rate of return (xirr) when periods between flows are not consistent, a 365 day-year is assumed

*  simple interest:  calculating interest, total, and solving for principal

*  profit calculations: cost-sell-markup

*  adding sales tax

*  percent change

*  present and future value uniform stream factors

*  compound interest calculations of a single stream:  solve for present value, future value, number of periods, and periodic interest

*  days between dates

*  specific applications:  monthly payment, PITI, qualifying loan amount, sinking fund, expressing a list of amounts as a percent of the sum, prorating an amount among a list of flows


Download the Python file and the instructions (pdf file) here:

https://drive.google.com/file/d/1l7Xg9dM-RHfekKkU7A1Wjay76-yVc56S/view?usp=sharing


Size: about 3,800 bytes.  


Eddie


All original content copyright, © 2011-2020.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Saturday, March 13, 2021

Retro Review: Texas Instruments Personal Banker

Retro Review:   Texas Instruments Personal Banker


Quick Facts:


Models:  Personal Banker

Company:  Texas Instruments

Years:  1987 - 1988

Memory Register:  1 independent memory, 5 financial registers

Battery:  Solar


Finance in a Clamshell Calculator


The Texas Instruments Personal Banker is a basic solar financial calculator.   The calculator opens up like a book.  The gray case gives the calculator a professional look.


On the left side, we have the arithmetic functions with the memory functions (M+, M-, MRC).   There are three keys of note:


[ AC ]:  The key clears everything, resets the format to 2 decimal fixed mode, clear the memory register, and the financial register.  


[ CE/C ]:  Clear the last entry but keeps everything in the memory register and financial registers intact.


[ DEC ]:  This sets the fixed decimal format.  The default is 2 places.  [ DEC ] [ . ] (decimal point) sets the Personal Banker to floating mode.  


On the right side are the Time Value of Money keys:


[ 1st Amt ]:   Present Value  (PV)


[ # Pmts ]:  Number of Payments (n)


[ Int Rate ]:  Interest Rate per Period (i%)


[ Pmt Amt ]:  Payment (PMT)


[ Final ]:  Future Value (FV)


The [ Solve ] and [ Recall ] keys work exactly the way you expect.  


The cash flow convention (positive for inflows, negative for outflows) is followed.


It is very simple.  A four function calculator with a full time value of money solver.


To help the user, included with the Personal Banker are four cards:


Blue Car Symbol:  Loans & Mortgages


Red Dollar Symbol:  Savings with Periodic Deposits


Gold Stock Graph Symbol:  Investments


Green House Symbol:  Loans & Mortgage with a Balloon Payment












Keyboard


The feel of the keys are solid.  However, the keys take a small fraction of a second for the key to register, so make sure the key registers before typing the next key.  


Verdict


The Personal Banker is a basic financial calculator.  I really like the folding design on this calculator and how the keys work.  Unfortunately, the high price point of $50 (see source) and it's basic set of functions (arithmetic, percent, time value of money, but no cost-sell-margin solver, amortization, statistics, logarithms, or exponents) did not help sales of the Personal Banker.  


It is a good collector item, since vintage solar-powered Texas Instruments financial calculators yield premium prices.


Source


Woerner, Joerg.  "Texas Instruments TI-2600 Personal Banker"  Datamath.  Updated July 22, 2002.  Retrieved January 23, 2021.  http://www.datamath.org/Sci/Modern/PersonalBanker.htm


On Sunday, we'll take another trip back in time.  

Eddie


All original content copyright, © 2011-2021.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Sunday, May 17, 2020

Numworks/Casio MicroPython/Python: Financial Functions

Numworks/Casio MicroPython/Python:  Financial Functions 

My first python script for the Numworks calculator:  finance.py

Great calculator and glad I finally have one. 

Introduction

The following scripts creates the user functions for the following financial functions:

pchg(old, new):  Returns the percent change between two numbers
Example:  pchg(1400,2600) returns 85.71

taxlplus(amt, tax): Adds the tax rate to an amount. amt + tax%.  Results are rounded up to 2 decimal places.
Example:  taxplus(59,9.5) returns 64.6

uspv(n,i):  Takes n (number of payments) and i (periodic interest rate) and calculates the uniform present value factor.  PV = PMT * USPV.  Future value is assumed to be 0.
Example:  n = 36 payments, i = 0.25%.  uspv(36,0.25) returns 34.39

usfv(n,i):  Takes n (number of payments) and i (periodic interest rate) and calculates the uniform future value factor.  FV = PMT * USFV.  Present value is assumed to be 0.
Example:  n = 36 payments, i = 0.25%.  usfv(36,0.25) returns 37.62

mopmt(yrs,rate,loan):  Calculates the monthly payment of a loan with monthly payments.  Payments are assumed to be due at the end of each month.   Results are rounded to up to 2 decimal places. 
Example:  Loan of $238,000 for 30 years at 4.28% annual rate.  mompt(30,4.28,238000) returns 1175.0

annrate(ppy,cpy,rate):  Calculates the equivalent annual rate given ppy (payments per year), cpy (compounding payments per year), rate (estimated periodic rate).
Example:  ppy = 12, cpy = 2, periodic rate = 0.74%.   annrate(12,2,0.74) returns 9.0459

Source for annrate:
Roger F. Farish and The Staff of the Texas Instruments Learning Center.  Calculator Analysis for Business and Finance.  Texas Instruments, Inc.  1977.  ISBN 0-89512-015-1

sinkfund(yrs,rate,pymt):  Calculates the balance of a sink fund (savings account)  of monthly deposits.   Number of years and the annual interest rate are needed.  Deposits are assumed to be due at the end of each month.   Results are rounded to up to 2 decimal places. 
Example:  Monthly deposits of $400.00 for 5 years, at a rate of 2.9%.  sinkfund(5,2.9,400) returns 25793.77

piti(yrs,rate,loan,tax,insur):   Calculates the monthly payment of a mortgage given:  the term of the loan in years (yrs), the annual interest rate (rate), the mortgage (loan), the annual property tax (tax), and the annual property insurance (insur).  Payments are assumed to be due at the end of each month.  Results are rounded to up to 2 decimal places.
Example:  piti(30,3.3,160000,1349,240) returns 833.15

qualinc(inc,debt,taxins,rate,yrs):  Calculates the qualifying amount given the following parameters:  monthly income (inc), monthly debt payments (debt), monthly proper taxes and insurance (taxins), interest rate (rate), and term of the mortgage in years (yrs).   Mortgage payments are assumed to be due at the end of each month.   The standard debt:income ratio of 28:36 is used.  Results are rounded to up to 2 decimal places.
Example:  qualinc(4485,375,126.83,5.30) returns 207288.6


Python Script: finance.py

# 2020-04-12 EWS

from math import *

# percent change
def pchg(old,new):
  pch=(new-old)/old*100
  return pch

# add sales tax  
def taxplus(amt,tax):
  total=amt*(1+0.01*tax)
  return round(total,2)

# uniform pv factor pv=pmt*uspv
def uspv(n,i):
  factor=(1-(1+0.01*i)**(-n))/(0.01*i)
  return factor

# uniform fv factor fv=pmt*usfv
def usfv(n,i):
  factor=((1+0.01*i)**n-1)/(0.01*i)
  return factor
  
# monthly payment
def mopmt(yrs,rate,loan):
  pymt=loan/uspv(yrs*12,rate/12)
  return round(pymt,2)
  
# equivalent annual rate
def annrate(ppy,cpy,rate):
  irate=cpy*100*((1+0.01*rate)**(ppy/cpy)-1)
  return irate
  
# sinking fund
def sinkfund(yrs,rate,pymt):
  sink=pymt*usfv(yrs*12,rate/12)
  return round(sink,2)

# piti
def piti(yrs,rate,loan,tax,insur):
  pymt=loan/uspv(yrs*12,rate/12)+(tax+insur)/12
  return round(pymt,2)

# qualifying income 28:36 ratio
def qualinc(inc,debt,taxins,rate,yrs):
  a=min(inc*0.36-debt,inc*0.28)-taxins
  qual=a*uspv(yrs*12,rate/12)
  return round(qual,2)

Eddie

All original content copyright, © 2011-2020.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

Wednesday, March 6, 2019

HP 12C and HP 11C: Loan Amount Using the Annual Loan Constant

HP 12C and HP 11C:  Loan Amount Using the Annual Loan Constant

Introduction

The program calculates the theoretical loan amount using the following factors:

*  NOI:  Net Operating Income. The estimated net operating income the property is expected to earn annually.  An average is usually used.

*  DCR:  Debt Coverage Ratio.  The ratio of net operating income to annual debt service, describing a company's ability to pay its debts.  Generally, the larger the DCR, the better.  We really don't want DCR to be below 1.

*  Number of payments per year, number of years, and annual interest rate of the potential loan. 

The ALC, or the annual loan constant is calculated by:

*  Either divided the annual debt service by the loan amount (when the amount is known), or

*  Determining the periodic payment to amortize a $100 loan given number of payments and interest rate.

Set up:
Number of payments -> N
Interest Rate -> I%YR  (or periodic interest rate -> i)
-100 -> PV
0 -> FV
Solve for PMT

The ALC is expressed as a percentage. 

The theoretical loan amount is calculated by:

Loan = NOI / (DCR * ALC%)

HP 12C Program: Loan Amount Using the Annual Loan Constant

Instructions:
Store the following:
NOI in R1
DCR in R2
Number of payments per year in R3
Number of periods in [ n ]
Periodic Interest rate in [ i ]

Program:
Step;  Key;  Code
01;  1;  1
02;  0;  0
03;  0;  0
04;  CHS;  16
05;  PV;  13
06;  0;  0
07;  FV;  15
08;  PMT;  14
09;  RCL 3;  45, 3
10;  *;  20
11;  RCL 2; 45, 2
12;  x<>y;  34
13;  %;  25
14;  RCL 1; 45, 1
15;  x<>y;  34
16;  ÷;  10
17;  GTO 00;  43, 33, 00

(* HP 12C Platinum, step 17:  GTO  000; 43, 33, 000)

HP 11C Program:    Loan Amount Using the Annual Loan Constant

Instructions:
Store the following:
NOI in R1
DCR in R2
Number of payments per year in R3
Number of periods in R4
Periodic Interest rate in R5

Program:
Step; Key; Code
001;  LBL A; 42, 21, 11
002;  1;  1
003;  ENTER; 36
004;  ENTER; 36
005;  RCL 5;  45, 5
006; %;  43, 14
007;  +;  40
008;  RCL 4;  45, 4
009;  CHS;  16
010;  y^x; 14
011;  *;  30
012;  1;  1
013;  RCL 5; 45, 5
014;  %;  43, 14
015;  x<>y;  34
016;  R↓;  33
017;  ÷;  10
018;  1;  1
019;  0;  0
020;  0;  0
021;  x<>y; 34
022;  ÷;  10
023;  RCL 3; 45, 3
024;  *;  20
025;  RCL 2; 45, 2
026;  x<>y; 34
027;  %;  43, 14
028;  RCL 1; 45, 1
029;  x<>y;  34
030;  ÷; 10
031;  RTN; 43, 32

Examples

Example 1: 

NOI:  $58,000.00
DCR:  1.25
P/Y:  12
Number of Years: 30
Annual Interest Rate:  5%

Loan Amount:  $720,288.92

Example 2:

NOI:  $40,000.00
DCR:  1.35
P/Y:  12
Number of Years: 20
Annual Interest Rate:  6.8%

Loan Amount: $323,464.95

Source: 

Goldman, Mark H. and Stephen D. Messner "HP 12C Real Estate Applications Handbook"  Hewlett Packard Rev. B. March 1984

Eddie

All original content copyright, © 2011-2019.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

Thursday, July 12, 2018

Fun with the Radio Shack EC-4026



Fun with the Radio Shack EC-4026 

(Equivalent of the Casio fx-4500P)

Programming Notes

 


The syntax for prompting for variables and displaying results are slightly different from the usual Casio programming language (as I mentioned, the EC-4026 is a clone of the fx-4500P).  Check out the unusual If-Then-Else-End structure as well. 

Prompting Syntax:
{var} : var “prompt string”

Example:
 {X}: X”ENTER X”

Display Syntax:
Calculation
“Display string”   (solid right triangle, [2ndF] [↑])

Example: 
X
“F(X)=”

The If-Then-Else-End Structure:
If condition do if the condition is true do if condition is false   (clear right triangle, [2ndF] [√])

Note:  I symbolize the [x^y] by ^.

Finding the Monthly Payment of a Mortgage with Total Interest Paid and Total Cash Outflow

Program MORTGAGE:

L1  Fix 2
L2 {A}: A”LOAN AMOUNT”
L3 {Y}: Y”YEARS”
L4 {I}: I”RATE”
L5 I = I/1200
L6 N = Y*12
L7 P = A*(I(1+I)^N)/((1+I)^N-1)
L8 “MONTHLY PMT”
L9 N*P
L10 “OUTFLOW”
L11 N*P-A
L12 “TOTAL INTEREST”
L13 Norm

Example:

A:  Loan is $250,000.00
Y:  30 years
I: Interest rate of 4%

Results:

P:  Payment:  $1,193.59
Outflow:  $429,673.77
Total Interest:  $179,673.77

Midlength, Height, and Area of a Trapezoid



Program TRAPEZIOD:

L1 {A}
L2 {B}
L3 {C}
L4 {D}
L5 H = √((-A+B+C+D)*(A-B+C+D)*(A-B+C-D)*(A-B-C+D))/(2*Abs(B-A))
L6 M = (A+B)/2
L7 K = M*H
L8 M
L9 “MIDLENGTH”
L10 H
L11 “HEIGHT”
L12 K
L13 “AREA”


Quadratic Equation A*x^2 + B*x + C = 0

Program QUAD:

L1 {A}: A”A”
L2 {B}: B”B”
L3 {C}: C”C”
L4 D = B^2-4*A*C
L5 D<0 Goto 1
L6 X = (-B + √D)/(2A)
L7 Y = (-B - √D)/(2A)
L8 Goto 0
L9 Lbl 1
L10 X = -B/(2A)
L11 “REAL”
L12 Y = √(Abs D)/(2A)
L13 “IMAG”
L14 Lbl 0
L15 “DONE”

Example:

3x^2 + 6x – 1 = 0; A = 3, B = 6, C = -1
Result:  0.154700538, -2.154700538

3x^2 + 6x + 10 = 0; A = 3, B = 6, C = 10
Result:  REAL: -1, IMAG: 1.527525232.  -1 ± 1.527525232i

Minimum Loss Matching



Variables:

Input: Y = Z0, Z = Z1

Output:

R = R1
S = R2
L = Loss Marching

Program MINLOSS:

L1 1:  “Z1<Z0”
L2 {Y}: Y”Z0”
L3 {Z}: Z”Z1”
L4 L = √(1 – Z/Y)
L5 R = Y*L: “R1”
L6 S = Z/L: “R2”
L7 L = 20 log (√(Y/Z) + √(Y/Z – 1)): “LOSS”

Example:

Input:


Y: Z0: 15
Z: Z1: 10

Output:

R1: 8.66025 Ω
R2:  17.32051 Ω
Loss:  5.71948

Add Two Polar Numbers

Polar and Rectangular conversions

Variable
Rectangular Results
Polar Results
V
x
r
W
y
θ

Program ADDPOLAR:

L1 {R}: R”R1”
L2 {S}: S”ANG1”
L3 Rec(R,S)
L4 R = V: S = W
L5 {V}: V”R2”
L6 {W}: W”ANG2”
L7 Rec(V,W)
L8 R = R+V: S = S+W
L9 Pol(R,S)
L10 V: “R SUM”
L11 W: “ANG SUM”

Example:

4 20° + 3 11 ° (In Degrees Mode)

Result (rounded to 4 digits): 6.9789 16.1442°

How to Handle a Tax Bracket (Simple Sample)

Take a sample (and simplified) tax bracket, where income is X:

0 < X ≤ 200:  tax rate is 10% of X
200 < X ≤ 600:  tax rate is 13% of X
600 < X: tax rate is 16% of X

Program:

L1 {X}: X”X”
L2 X > 600 P = 16: Goto 1
L3 X > 200 P = 13: Goto 1
L4 P = 10
L5 Lbl
L6 X * P/100


Eddie

All original content copyright, © 2011-2018.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.  Please contact the author if you have questions.

Wednesday, February 14, 2018

HP Prime and TI-84 Plus CE: Graduated Mortgage Payments

HP Prime and TI-84 Plus CE:  Graduated Mortgage Payments

Introduction

The program GRADMORT calculates the payment schedule of a graduated mortgage.  A graduated payment mortgage (GPM) is a mortgage option that allows home buyers, particularly young, first-time home buyers, to purchase a home.  The payments increase by a set percentage of at annual rate for several years until it reaches a plateau. 

According to Daniel T. Winkler’s and G. Donald Jud’s article, “The Graduated-Payment Mortgage: Solving the Initial Payment Enigma” (see Source at the end of the blog entry), the HUD (United States Department of Housing and Urban Development), offers five graduated payment schedule plans, known as Section 245 loans. 

In the article Winkler and Jud derive a formula for solving for the first tier payment.  The article states the solution for a two-tier case and a general case.  The program GRADMORT covers the general case.

Variables:

A = amount of the mortgage (PV).

I = periodic monthly interest of the mortgage, I%YR/1200.

T = Number of years the payment increases.  For example, if T = 5, then the payment would increase 5 times, once a year, until it reaches the final constant payment on year 6

C = The payment’s annual percent increase, C%/100.

N = The term of the mortgage, in years.

P = The initial payment (PMT).  To calculate the payments for subsequent years, multiply the last result by (1 + C).  (hence, add C% every year for each tier)

The general formula:

P = A / ( (1 + Σ((1 + C)^(k)/(1 + I)^(12*k), k, 1, N-1) * ( 1/I * (1 + I)^(-12) )
+  (1 + C)^N/(1 + I)^(12*N) * (1/I * (1 – (1 + I)^-(12*T – 12*N) )

The program breaks the formula into smaller parts for calculation purposes.

GRADMORT returns a two column matrix, the first column is the year and the second column is the payment.  The last row shows the payment when it stabilizes (stops increasing).

Monthly payments and end of period payments (end of month) are assumed.  Property taxes and interest are not calculated in this program.

HP Prime Program GRADMORT

EXPORT GRADMORT()
BEGIN
// Graduated Mortgage
// Winkler, Jud
// 2018-02-11 EWS

LOCAL A,I,N,C,T,mat;
LOCAL P,X,Y;

INPUT({A,I,N,C,T},"Graduated
Mortgage",{"Loan Amount:",
"Loan Rate: ","# Tiers: ",
"% Increase: ","Term (yrs): "});

I:=I/1200;
C:=C/100;

X:=Σ((1+C)^K/(1+I)^(12*K),K,0,N-1);
X:=X/I*(1-(1+I)^(−12));
Y:=(1+C)^N/(1+I)^(12*N);
Y:=Y/I*(1-(1+I)^−(12*T-12*N));
P:=A/(X+Y);

mat:=[[1,P]];
LOCAL k;
FOR k FROM 1 TO N DO
mat:=ADDROW(mat,
[k+1,mat[k,2]*(1+C)],k+1);
END;

RETURN mat;

END;

TI-84 Plus CE Program GRADMORT

"GRADUATED MORTGAGE"
"WINKLER/JUD"
"EWS 2018-02-11"
Input "LOAN AMT: ",A
Input "LOAN RATE: ",I
I/1200→I
Input "NO. TIERS: ",N
Input "INCREASE: ",C
C/100→C
Input "LOAN TERM (YRS): ",T

Σ((1+C)^K/(1+I)^(12*K),K,0,N-1)→X
X/I*(1-(1+I)^(­12))→X

(1+C)^N/(1+I)^(12*N)→Y
Y/I*(1-(1+I)^­(12T-12N))→Y

A/(X+Y)→P
{1}→L1
{P}→L2
For(K,1,N)
augment(L1,{K+1})→L1
augment(L2,{L2(K)*(1+C)})→L2
End
List→matr(L1,L2,[A])
Disp [A]

Example

A young couple, who just graduated from college and starting on their careers, have qualified to participate in a GPM.  They will finance a $200,000 mortgage at a fixed annual interest of 4.4%.  Payments increase 2.1% for the first five years of the 35 year mortgage. 

Variables (the program will prompt you for the amounts):

Loan Amount:  200000
Loan Rate:  4.4
# Tiers:  5
% Increase: 2.1
Term (yrs): 35

Results:

Matrix:
[ [1, 855.231019434]
[2, 873.190870842]
[3, 891.52787913]
[4, 910.249964592]
[5, 929.365213848]
[6, 948.881883339] ]

Year 1:  $855.23
Year 2:  $873.19
Year 3:  $891.53
Year 4:  $910.25
Year 5:  $929.37
Year 6 (years 6 – 35):  $948.88

Source 

Winkler, D.T. an G.D. Jud.  “The Graduated Payment Mortgage:  Sovling the Initial Payment Enigma”  Journal of Real Estate Practice and Education, vol. 1, 1998, pp 67-79.  Retrieved February 10, 2018.  Link:  https://libres.uncg.edu/ir/uncg/f/D_Winkler_Graduated_1998(MULTI%20UNCG%20AUTHORS).pdf

Eddie


This blog is property of Edward Shore, 2018.

Friday, July 27, 2012

Finding the Balance Point in a Mortgage

Greetings!

Today's blog entry is about mortgages. When someone takes out a mortgage, or any loan that is to paid over time, the lender charges interest as a price for borrowing the money. Each payment that is made has two components: principal, that actually reduces the loan balance, and interest.

The beginning of the term is where the most amount of interest is paid. If the length of the loan is long enough and the interest rate is high enough, the interest eats more of the payment.

Example 1:

I take a loan for 5%, 3-year, $20,000 to finance the purchase of a computer network. Payments are to be made at the end of each month. Assume that there is no balloon amount. I would have a monthly payment of $599.41.

For the first payment I would pay $83.33 in interest ($20,000 × .05 / 12), which results in $516.08 ($599.41 - $83.33) going towards the principal. So after the first payment, the balance is $19,483.92 ($20,000.00 - $516.08). Clearly, each payment contribute to principal than interest. Happy day.

Unfortunately, mortgages are not so friendly.

Example 2:

A couple finances a purchase of a home for $264,000. They were able to secure a 30 year term at 4%. Payments are due at the end of reach month which come out to $1,260.38 a month.

For the first payment, the couple would pay $880.00 in interest, leaving only $380.38 for the principal.

Fast forward five years, the 61st payment (with balance of $238,781.43), the amount of payment contributing to interest is $795.94, leaving $464.44 for the principal.

Fast forward another five years, the 121st payment (with balance $207,989.65), the amount that contributes towards interest is $693.30, with $567.08 for the principal.

In fact it will take until the 152nd payment is made (12 years, 8 months) that more of the payment is contributed towards principal than interest. I refer to payment 152 as the balance point.

Balance Point: The Math Behind It

To find the balance point, we will take a two step approach:

1. Find the balance of the loan where the amount of interest and principal paid is equal. I call this the magic balance.
2. Use the balance to determine the payment number.

Step 1 is fairly simple.

For any payment:

I = B × R / PY
P = PMT - I = PMT - B × R / PY

Where:

I = portion of the payment that goes towards interest
P = portion of the payment that goes towards principal
PMT = payment amount
B = balance of the previous period
PY = payments per year, usually 12
R = interest rate, in decimal. (i.e. 5% = .05)

To find the required magic balance, as I will name it, equate P and I.

P = I
PMT - B × R / PY = B × R / PY
PMT = 2 × (B × R / PY)
which implies that
B = (PMT × PY) / (2 × R)

Now we can proceed to Step 2, where we can find our balance point.

Let B0 = initial loan amount, B1 = balance after 1 payment, B2 = balance after two payments, and so on.

Simply enough:
B1 = B0 - P0
B1 = B0 - (PMT - B0 × R / CY)
B1 = B0 × (1 + R / CY) - PMT

And
B2 = B1 - P1
B2 = B1 - (PMT - B1 × R / CY)
B2 = B1 × (1 + R / CY) - PMT

If we want B2 in terms of B0...

B2 = (B0 × (1 + R / CY) - PMT) × (1 + R / CY) - PMT
B2 = B0 × (1 + R / CY)^2 - P × (2 + R / CY)

Quickly we realize if we what to find B3, B4, etc...in terms of B0, the expression will grow complicated very quickly.

Thankfully, our TVM (Time Value of Money) solvers will come to our rescue! We can find the balance point simply by setting our TVM variables as such:

I/YR = R
PV = B0
PMT = PMT
FV = B from Step 1
PY = PY
Solve for N.

The balance point is ceiling(N). The ceiling function of N is N rounded up to the next integer. In essence, if N > 0, ceiling(N) = integerpart(N) + 1.

Interesting...

1. The amount of the loan has no bearing on the balance point.
2. A 5%, monthly payment loan has a balance point of 194 months (16 years, 2 months) in a 30 year term, but a balance point of 314 months (26 years, 2 months) in a 40 year term.
3. Not surprising, the balance point is bigger when the interest rate is higher. At 7%, the balance point is 241 months (20 years, 1 month) for a 30 year term, and 361 months (30 years, 1 month) for a 40 year term.
4. The terms "magic balance" and "balance point" are names I created. I am not aware of any official names used for these values (if you know, I would appreciate it).

Coming up is a program that finds the balance point. I use the TI-84+ for this program.

Note that the tvm_Pmt and tvm_N commands are from the Finance App, which is accessed by pressing APPS, 1, then 2 and 5, respectively.

TI-84+ Program PMTOFBAL

: Input "LOAN:",P
: Input "I/YR:", I
: Input "NO. PMTS:", N
: Input "P/Y:", C
: tvm_Pmt(N,I,P,0,C,C) →M
: M*C/(.02I) → X
: tvm_N(I,P,M,X,C,C) → O
: iPart(O)+1→O
: Disp "PAYMENT:", -M
: Pause
: Disp "MAGIC BALANCE:", -X
: Pause
: Disp "BALANCE POINT:",O
: Pause


Input: Loan amount, annual interest rate, number of payments (years × payments per year), payments per year

Output: Periodic payment, magic balance, and balance point. If the balance point is negative, this means for each payment, more of it will contribute towards principal than interest for the entire loan.

Thank you very much. Have a great weekend.

Eddie




This blog is property of Edward Shore. © 2012


HP 48G Collection

 HP 48G Collection  Contents:  Intensity of Spherical Light Source  Speed of Light in Dry Air  Pressure of Air  Earth's Gravity a...