Post Reply 
(11C) TVM for HP-11C
05-14-2022, 12:26 PM
Post: #19
RE: (11C) TVM for HP-11C
(05-11-2022 01:07 PM)Albert Chan Wrote:  XCas> ICOEFS := [n^2*pv*fv, n^2*pmt*(-pv+fv), -(n*pmt-pv-fv)*(n*pmt+pv+fv)]
XCas> proot(ICOEFS(n=36, pv=30000, pmt=-550, fv=-15000))

[0.00582443202789,0.0491755679721] // keep the small root.

There is a weakness with I ≈ 1/P - P/N^2, extended with non-zero FV

For guess_i(), to avoid solving quadratics with "√", I use pade approximation.
(it is not just for speed, we simply don't want complex rate guess)

[b/3/c, -2, 4c]      → "small" root = 4c/(1+√(1-4b/3)) ≈ c*(b-3)/(b-1.5)

Updated guess_i() coefs (there was an eariler version with (N^2-1) replaced with N^2)

[(N^2-1)*(FV+PV)/12, (-FV*N+N*PV+FV+PV)/2 , N*PMT+FV+PV]

Above pade approx won't work if linear term goes 0, or FV = PV*(N+1)/(N-1)
With N≥1, this implied PV and FV have same sign, and FV bigger in size.
For rate with unique solution, this almost never happen      (*)

Now, compare I ≈ 1/P - P/N^2 derived rate coefs:

[PV*FV, -PMT*(PV-FV), ((PV+FV)/N+PMT)*((PV+FV)/N+PMT)]

If PMT=0 or PV=FV, linear term goes 0
Even if linear term is nonzero (but small, relative to others), pade approximation may fail.

Example: N=32, PV=-6000, PMT=1, FV=10000, True Rate = 0.016223

With guess_i() coefs:

[341000,-254000,4032] --> roots = [0.016228, 0.728640] --> paded = 0.016227

With "1/P-P/N^2" coefs:

[-60000000,16000,15876] --> roots = [-0.016134, 0.016400] --> paded = -0.488317 ?

"Small" root is the wrong root. How to pick ?
Apply pade on wrong root make it worse

c = -0.4796125
b = -11162.8125
c*(b-3)/(b-1.5) ≈ c*b/b = c

Normally, we expected c*(b-3)/(b-1.5) ≈ c*3/1.5 = 2c
Example, for guess_i(), with n,pv,pmt,fv = N,P,-1,0

c = (N-P)/(P*(N+1))
b = (1-N)*c

2c matched a good rate guess formula
(04-09-2022 12:50 PM)Albert Chan Wrote:  
(10-16-2020 04:02 PM)Albert Chan Wrote:  XCas> C := I*N / (1 - (1+I)^-N)       // C = |N*PMT/PV|, "compounding factor"
XCas> series(C,I,polynom)

\(1
+\frac{I(N+1)}{2}
+\frac{I^2 (N^2-1)}{12}
+\frac{I^3 (-N^2+1)}{24}
+\frac{I^4 (-N^4+20N^2-19)}{720}
+\frac{I^5 (N^4-10N^2+9)}{480}\)

This may be a better rate estimate, by dropping compounding factor O(I^2)
With previous defined P, solve for I, we have:

\(\displaystyle I ≈ \frac{2\;(N-P)}{P\;(N+1)}\)

(*) Rate is unique if 1 sign change: (PV, PMT+FV) with opposite sign.
(01-06-2020 01:57 PM)Albert Chan Wrote:  Some real roots for rate are meaningless, say with r ≤ -100%.
Let x = 1+r, and consider only positive x as valid, we get:

\( NFV = FV + PV x^n + PMT\left({x^n-1 \over x-1}\right)\)

\(\large {NFV \over PMT} = \left({PV \over PMT}\right) x^n + x^{n-1} + x^{n-2} + \;... +\;x + \left(1 + {FV \over PMT}\right)\)

If above has one sign change, we have exactly one positive solution for x.

For 2 sign changes, x has 0 or 2 positive roots (see Descartes' sign rules)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(11C) TVM for HP-11C - Gamo - 05-09-2019, 01:15 AM
RE: (11C) TVM for HP-11C - Gamo - 12-03-2019, 10:12 AM
RE: (11C) TVM for HP-11C - Gamo - 02-13-2020, 06:14 AM
RE: (11C) TVM for HP-11C - bshoring - 12-02-2020, 09:02 PM
RE: (11C) TVM for HP-11C - Gamo - 12-03-2020, 08:23 AM
RE: (11C) TVM for HP-11C - Dave Britten - 12-03-2020, 01:48 PM
RE: (11C) TVM for HP-11C - bshoring - 12-03-2020, 05:53 PM
RE: (11C) TVM for HP-11C - Dave Britten - 12-03-2020, 06:08 PM
RE: (11C) TVM for HP-11C - Albert Chan - 12-03-2020, 08:53 PM
RE: (11C) TVM for HP-11C - Albert Chan - 12-04-2020, 08:01 PM
RE: (11C) TVM for HP-11C - Albert Chan - 12-05-2020, 01:05 AM
RE: (11C) TVM for HP-11C - Albert Chan - 12-05-2020, 03:46 AM
RE: (11C) TVM for HP-11C - Albert Chan - 05-10-2022, 09:35 PM
RE: (11C) TVM for HP-11C - Albert Chan - 05-11-2022, 01:07 PM
RE: (11C) TVM for HP-11C - Albert Chan - 12-06-2020, 02:32 PM
RE: (11C) TVM for HP-11C - Albert Chan - 12-06-2020, 04:41 PM
RE: (11C) TVM for HP-11C - Albert Chan - 12-07-2020, 06:55 PM
RE: (11C) TVM for HP-11C - Albert Chan - 12-08-2020, 03:05 PM
RE: (11C) TVM for HP-11C - Albert Chan - 05-14-2022 12:26 PM



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