Post Reply 
PC-1211, PC-1250, etc. TVM
06-02-2024, 06:37 PM
Post: #12
RE: PC-1211, PC-1250, etc. TVM
(05-29-2024 09:17 PM)robve Wrote:  B=1 (begin mode)
N=40
PMT=-40
PV=900
FV=-1000

We can make this to END mode, by shift up payment: {PV,FV} ← {PV+PMT, FV-PMT}

N=40, PV=860, PMT=-40, FV=-960

We can split up into 2 loans (combined, we get back original loan)

#1: N=40, PV=860-x, PMT=-40, FV=-(860-x)
#2: N=40, PV=x, PMT=0, FV=(860-x)+(-960) = -(x+100)

Unlike original loan, splitted loans have have direct formula for rate.

From 1st loan, rate = pmt/(x-pv) = 40/(860-x)
From 2nd loan, x*(1+rate)^N = x - (PV+FV)

--> x*((1+rate)^N-1) + (PV+FV) = 0
--> f = x + (PV+FV) / ((1+rate)^N-1) = 0      // flatten curve to make Newton's method efficient

If x=0, 1st loan rate = 40/860 = 4.65%, 2nd loan rate = ∞ --> (x>0, rate > 4.65%)

f(x=10) = 10 + (-100) / ((1+40/850)^40-1) = -8.89363
f(x=20) = 20 + (-100) / ((1+40/840)^40-1) = 1.58000

Interpolate for f=0, we get x = 18.4914 --> rate = 4.75337% (all digits correct)

Below code assumed pmt ≠ 0 (we have direct rate formula for pmt=0)
We use smaller size edge rates [pmt/-pv, pmt/fv] as guess, same as Plus42.
For this example, rate guess = -40 / (-1000+40) ≈ 4.16667%

10 B=1 @ N=40 @ P=900 @ M=-40 @ F=-1000
15 IF B THEN P=P+M @ F=F-M ! Now, B=0
20 DEF FNF(X) @ D=X-P @ I=M/D @ S=(1+I)^N
25 D=1 - (P+F)/(S-1)^2 * N*S/(1+I) * -I/D
30 FNF=X+(P+F)/(S-1) @ END DEF
40 X=(ABS(P)<ABS(F))*(P+F) @ Y=FNF(X)
50 H=-Y/D @ X=X+H @ Y=FNF(X)
60 DISP 100*I,X,Y @ IF X+H*H<>X THEN 50

>run
 4.75245128279      18.32908914         -.1698427457
 4.75336718645      18.4912666946      -.000000398
 4.75336718859      18.4912670746      .0000000071

Interestingly, converge rate seems to match NPMT formula with Newton's method.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
PC-1211, PC-1250, etc. TVM - Dave Britten - 03-30-2021, 04:58 PM
RE: PC-1211, PC-1250, etc. TVM - robve - 03-30-2021, 05:07 PM
RE: PC-1211, PC-1250, etc. TVM - robve - 04-01-2021, 05:50 PM
RE: PC-1211, PC-1250, etc. TVM - robve - 05-29-2024, 09:17 PM
RE: PC-1211, PC-1250, etc. TVM - dm319 - 05-31-2024, 01:11 PM
RE: PC-1211, PC-1250, etc. TVM - Albert Chan - 06-02-2024 06:37 PM
RE: PC-1211, PC-1250, etc. TVM - robve - 06-01-2024, 01:07 PM
RE: PC-1211, PC-1250, etc. TVM - robve - 06-02-2024, 09:46 PM
RE: PC-1211, PC-1250, etc. TVM - robve - 06-03-2024, 06:44 PM
RE: PC-1211, PC-1250, etc. TVM - robve - 06-04-2024, 12:26 AM
RE: PC-1211, PC-1250, etc. TVM - robve - 06-04-2024, 11:35 PM
RE: PC-1211, PC-1250, etc. TVM - robve - 06-05-2024, 07:16 PM
RE: PC-1211, PC-1250, etc. TVM - dm319 - 06-05-2024, 10:06 PM
RE: PC-1211, PC-1250, etc. TVM - dm319 - 06-06-2024, 11:02 PM
RE: PC-1211, PC-1250, etc. TVM - dm319 - 06-08-2024, 06:19 PM
RE: PC-1211, PC-1250, etc. TVM - robve - 06-08-2024, 09:21 PM
RE: PC-1211, PC-1250, etc. TVM - robve - 06-09-2024, 12:06 AM
RE: PC-1211, PC-1250, etc. TVM - rprosperi - 06-09-2024, 01:22 PM
RE: PC-1211, PC-1250, etc. TVM - nickapos - 06-12-2024, 05:20 AM
RE: PC-1211, PC-1250, etc. TVM - dm319 - 06-06-2024, 11:34 PM
RE: PC-1211, PC-1250, etc. TVM - robve - 06-07-2024, 02:30 AM
RE: PC-1211, PC-1250, etc. TVM - robve - 06-08-2024, 08:38 PM
RE: PC-1211, PC-1250, etc. TVM - dm319 - 06-09-2024, 10:12 AM
RE: PC-1211, PC-1250, etc. TVM - robve - 06-11-2024, 07:13 PM
RE: PC-1211, PC-1250, etc. TVM - dm319 - 06-11-2024, 10:32 PM
RE: PC-1211, PC-1250, etc. TVM - robve - 06-12-2024, 12:29 AM
RE: PC-1211, PC-1250, etc. TVM - dm319 - 06-12-2024, 12:45 PM
RE: PC-1211, PC-1250, etc. TVM - robve - 06-12-2024, 04:58 PM
RE: PC-1211, PC-1250, etc. TVM - dm319 - 06-22-2024, 12:12 PM
RE: PC-1211, PC-1250, etc. TVM - robve - 06-22-2024, 08:39 PM



User(s) browsing this thread: 21 Guest(s)