(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)] 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" (*) 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%. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 8 Guest(s)