Looking for TVM contributions
|
06-20-2024, 05:07 PM
(This post was last modified: 06-21-2024 02:36 AM by robve.)
Post: #76
|
|||
|
|||
RE: Looking for TVM contributions
(06-20-2024 03:07 PM)Albert Chan Wrote:(06-20-2024 04:03 AM)robve Wrote: ... I'm literally using the same parameters to find the root at npmt()=0 and to compute the errors: double npmt() { j = 0.01*i; k = 1.0 + j*b; l = log1p(j); r = expm1(-n*l); s = r + 1.0; return k*pmt - (pv + fv*s)*j/r; } After root finding with npmt()=0 all global parameters are set accordingly. I only need to make sure to use the previous j, r, s when I use the previous i% rate that is more precise when the last step overshot. Then fabs(fv - (k*pmt*r/j-pv)/s) is the FV error. It's just the TVM FV formula. The npmt() is zero or close of course, because we solve using npmt. Also nfv(0 and npv probably are also zero or close. But the TVM reverse computation of PV, PMT and FV should not have large errors like that. I really want to maintain TVM model equilibrium, i.e. inputs and outputs are reversible, at least with minimal drift, in the presence of roundoff. - Rob "I count on old friends to remain rational" |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 16 Guest(s)