Showing posts with label interest rate. Show all posts
Showing posts with label interest rate. 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, January 24, 2021

HP 12C: Solving Two Actuarial Problems

 HP 12C: Solving Two Actuarial Problems


Solve for Interest and Number of Periods Given Present Value Annuity Factor and Future Value Annuity Factor


Given the following:


* Present Value Annuity Factor (PVAF)

* Future Value Annuity Factor (FVAF)


Solve for both:


*  the interest rate

*  the number of periods of the annuity


Keep in mind that present value and future value annuity factors are not the same of present value and future value, respectively.


Recall that:


PVAF = (1 - (1 + i)^-n) / i


FVAF = ((1 + i)^n - 1) / i


Note that:

FVAF = ( (1 + i)^n - 1 ) / i

FVAF = (1 + i)^n * (1 - (1+i)^-n) / i

FVAF= (1 + i)^n * PVAF


Then:

FVAF / PVAF = (1 + i)^n

ln (FVAF / PVAF) = ln (1 + i)^n

ln (FVAF / PVAF) = n * ln(1 + i)

ln (FVAF / PVAF) / ln(1 + i) = n



Also:

1 / FVAF + i 

= i / ((1 + i)^n - 1) + i

= i / ((1 + i)^n - 1) + (i * (1 + i)^n - 1)) / ((1+ i)^n - 1)

= (i + i * (1 + i)^n - i) / ((1 + i)^n - 1)

= (i * (1+i)^n) / ((1 + i)^n - 1)

= (1 + i)^n / (1 + i)^n * ( i / (1 - (1 + i)^-n)

= 1 * ( i / (1 - (1 + i)^-n)

= 1 / PVAF


Then:

1 / FVAF + i = 1 / PVAF

i = 1 / PVAF - 1 / FAVF


To summarize: 

i = 1 / PVAF - 1 / FAVF

n = ln (FVAF / PVAF) / ln(1 + i)


The following program solves for interest and number of payments. 


HP 12C (Classic) Program


Stack set up:

Y: PVAF

X:  FVAF


Step: Key: Code

01:  STO 1 :  44, 1

02:  x<>y :  34

03:  STO 2 :   44, 2

04:  1/x :   22

05:  x<>y :   34

06:  1/x :   22

07:  - :   30

08:  STO 3 :  44, 3

09:  ENTER :  36

10:  ENTER :  36

11:  1 :   1

12:  + :   40

13:   LN : 43, 23

14:  RCL 1 : 45, 1

15:  RCL 2 : 45, 2

16:  ÷  :  10

17:  LN :  43, 23

18:  x<>y : 34

19:  ÷  : 10

20:  STO 4 :  44, 4

21:  GTO 00 :  43, 33, 00


Example:


Input:

Y:  PVAF = 22.3965

X:  FVAF = 40.5681


Results:

Y:  i = 0.02   (2%)

X:  n = 30  (30 periods)


Present Value of an Annuity Due with an Effective Discount Rate


The problem determines the present value of an annuity due with an effective discount rate.  The effective discount rate is different from the interest rate (i).  Convert the effective discount rate to interest rate by:


i = d / (1 - d)   [i, d are in decimal form]



HP 12C (Classic) Program


Stack set up:

Clear TVM values

Store n:  [ n ]

Store payment: [ PMT ]

X:  discount rate (as a percentage.  Example: for 10%, enter 10)


Step: Key: Code

01:  BEG  : 43, 7

02:  ENTER  : 36

03:  CLx  :  35

04:  R↓   :  33

05:  1   :  1

06:  %  :  25

07:  1   :  1

08:  x<>y   :  34

09:  -  :  30

10:  LSTx  : 43, 36

11:  x<>y   :  34

12:  ÷  : 10

13:  1  :  1

14:  EEX  : 26

15:  2  :  2

16:  ×  :  20

17:  [ i ] :  12

18:  [ PV ]  :  13

19:  GTO 00  :  43,33,00


Example:


Input:

n = 36, PMT = -250.00

X:  d = 5%;  (5  [R/S])


Results:

X:  4211.10


Present Value:  $4,211.10


Source:


Finan, Marcel B.  A Basic Course in the Theory of Interest and Derivatives Markets:  A Preparation for the Actuarial Exam FM/2   Arkansas Tech University, 2017.  


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. 


DM42 and HP 42S: Quadratic Equation, Characteristic Polynomial, and Eigenvalues

DM42 and HP 42S: Quadratic Equation, Characteristic Polynomial, and Eigenvalues The programs are listed for the Swiss Micros DM42 an...