Post Reply 
Looking for TVM contributions
06-13-2024, 09:28 PM (This post was last modified: 06-25-2024 10:32 PM by Albert Chan.)
Post: #40
RE: Looking for TVM contributions
(06-12-2024 08:48 PM)robve Wrote:  | 11 | robve | 60x24x365 | 1/6% → ? | 0 | -0.01 | ?→ FV | =N | yes |
Sharp PC-1421 FV=5258.756614 => I%=1.073741824E+09 !!!
(06-12-2024 11:56 PM)dm319 Wrote:  Very interesting! Weird how they can be similar and so different, and what is going on with 11?!

Initial guess (hard coded?) may be too high for the problem.

Edge guess is not the best, but will converge without issue.
Plus42 does not allow user-input rate guess on purpose!

lua> n = 365*24*60 -- = 525600
lua> i = 1/(600*n) -- = 3.1709791983764586e-09
lua> fv = tvm(n,i,0,-1,nil)
lua> fv -- unit = cents
526038.2426000326
lua> tvm(n,nil,0,-1,fv) * n -- APR
0.0016666666666665247

Or, we can use a quickie formula
(04-09-2022 05:47 PM)Albert Chan Wrote:  \(\displaystyle I ≈ \frac{1}{P} - \frac{P}{N^2}\)

This is even better, and work well with big N.

P = -PV/PMT, so we apply time reversal, to FV/PMT. (negated N make no difference here)
1/P is edge rate, time reversal simply switched to other edge.

lua> p = -fv
lua> n/p - p/n -- APR estimate
0.001666895167500626

What if we supply a guess, say 0.1% ?

lua> tvm(n,1e-3,0,-1,fv, true)
0.001                                      -1
-5.137033888903107e+219     -nan
-nan                                       -nan
false

Why does it fail? Because we use Newton's method from the wrong edge!
The other edge = pmt/-pv = ∞, but 1e-3 is just as bad. (technically, ∞ is not an edge)

(06-11-2024 03:32 PM)Albert Chan Wrote:  For extreme rate, npmt(i) is basically linear, slope = (pv if n>0 else -fv)

With pv=0, npmt(i) look like L shape. Guess must be from the left of L
tvm() rate guess = pmt/fv ≈ -2e-6

For plots, I dropped fractional cents --> fv = 526038

This is what npmt look like from the left, and the right
npmt = ((pv+fv)/((1+x)^n-1) + pv)*x + pmt

plot 526038*x/((1+x)^525600-1)-1, x=-2e-6 .. 2e-6

plot 526038*x/((1+x)^525600-1)-1, x = 0 .. 1e-3



NPV is not the same as npmt, but same kind of issue apply.
NPV = (fv-pmt/x) * ((1+x)^-n-1) + (pv+fv)

plot (526038+1/x) * ((1+x)^-525600-1) + 526038, x = -2e-6 .. 2e-6

plot (526038+1/x) * ((1+x)^-525600-1) + 526038, x = 0 .. 1e-3
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Looking for TVM contributions - dm319 - 05-12-2024, 06:58 PM
RE: Looking for TVM contributions - dm319 - 05-12-2024, 08:48 PM
RE: Looking for TVM contributions - dm319 - 05-12-2024, 08:49 PM
RE: Looking for TVM contributions - dm319 - 05-12-2024, 08:00 PM
RE: Looking for TVM contributions - dm319 - 05-14-2024, 11:04 AM
RE: Looking for TVM contributions - dm319 - 05-14-2024, 05:58 PM
RE: Looking for TVM contributions - dm319 - 05-14-2024, 05:59 PM
RE: Looking for TVM contributions - dm319 - 05-14-2024, 08:34 PM
RE: Looking for TVM contributions - dm319 - 05-14-2024, 08:31 PM
RE: Looking for TVM contributions - dm319 - 05-15-2024, 01:00 PM
RE: Looking for TVM contributions - dm319 - 05-15-2024, 12:57 PM
RE: Looking for TVM contributions - dm319 - 05-24-2024, 10:05 PM
RE: Looking for TVM contributions - dm319 - 05-25-2024, 01:43 PM
RE: Looking for TVM contributions - dm319 - 05-25-2024, 08:40 PM
RE: Looking for TVM contributions - dm319 - 05-24-2024, 11:22 AM
RE: Looking for TVM contributions - dm319 - 05-24-2024, 02:58 PM
RE: Looking for TVM contributions - dm319 - 05-24-2024, 09:22 PM
RE: Looking for TVM contributions - dm319 - 06-02-2024, 02:46 PM
RE: Looking for TVM contributions - robve - 06-09-2024, 02:04 AM
RE: Looking for TVM contributions - dm319 - 06-09-2024, 12:15 PM
RE: Looking for TVM contributions - robve - 06-09-2024, 03:29 PM
RE: Looking for TVM contributions - dm319 - 06-09-2024, 06:05 PM
RE: Looking for TVM contributions - dm319 - 06-09-2024, 10:00 PM
RE: Looking for TVM contributions - robve - 06-12-2024, 08:48 PM
RE: Looking for TVM contributions - Albert Chan - 06-13-2024 09:28 PM
RE: Looking for TVM contributions - robve - 06-14-2024, 03:23 PM
RE: Looking for TVM contributions - robve - 06-14-2024, 10:11 PM
RE: Looking for TVM contributions - robve - 06-15-2024, 03:54 AM
RE: Looking for TVM contributions - dm319 - 06-12-2024, 11:56 PM
RE: Looking for TVM contributions - robve - 06-15-2024, 03:05 AM
RE: Looking for TVM contributions - robve - 06-15-2024, 05:48 PM
RE: Looking for TVM contributions - robve - 06-15-2024, 09:52 PM
RE: Looking for TVM contributions - robve - 06-15-2024, 01:38 PM
RE: Looking for TVM contributions - robve - 06-16-2024, 05:18 PM
RE: Looking for TVM contributions - Werner - 06-17-2024, 05:11 PM
RE: Looking for TVM contributions - robve - 06-16-2024, 08:26 PM
RE: Looking for TVM contributions - dm319 - 06-16-2024, 11:55 PM
RE: Looking for TVM contributions - robve - 06-17-2024, 09:03 PM
RE: Looking for TVM contributions - robve - 06-18-2024, 03:27 AM
RE: Looking for TVM contributions - robve - 06-19-2024, 12:57 AM
RE: Looking for TVM contributions - robve - 06-19-2024, 02:01 AM
RE: Looking for TVM contributions - robve - 06-19-2024, 03:47 PM
RE: Looking for TVM contributions - robve - 06-20-2024, 04:03 AM
RE: Looking for TVM contributions - robve - 06-20-2024, 05:07 PM
RE: Looking for TVM contributions - robve - 06-20-2024, 04:30 PM
RE: Looking for TVM contributions - robve - 06-20-2024, 06:27 PM
RE: Looking for TVM contributions - robve - 06-20-2024, 02:33 AM
RE: Looking for TVM contributions - robve - 06-21-2024, 09:04 PM
RE: Looking for TVM contributions - robve - 06-22-2024, 08:00 PM
RE: Looking for TVM contributions - robve - 06-23-2024, 06:03 PM
RE: Looking for TVM contributions - dm319 - 07-05-2024, 09:39 PM
RE: Looking for TVM contributions - dm319 - 07-05-2024, 09:44 PM



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