Looking for TVM contributions
|
06-15-2024, 05:48 PM
Post: #49
|
|||
|
|||
RE: Looking for TVM contributions
(06-15-2024 02:36 PM)Albert Chan Wrote: Newton's method, with a single point, f and f' need to be accurate. Thanks. I have already used, tested and compared (offline) the "original formula" as had mentioned in a previous post and didn't find it that different in terms of results. I did that to make sure I'm not injecting unnecessary calculation errors. I'm aware of such numerical problems and the differences pertaining cancellations and roundoff. Sorry to disappoint, but Secant still wins with smallest FVerror (the losing values are marked red): tvmperfcomp-formulas.pdf (Size: 41.84 KB / Downloads: 3) These results are with Newton g=4 but g=5,6 are the same as it bottoms out so I stuck to g=4 for now. The first column is Newton with the "simpler" formulas of npmt and npmt' I've used before, the next column is Newton with the above formulas in your post. The third column is Secant with the simpler npmt formula. The edge case of a tiny rate to branch is not the culprit, but it does badly affect this single test case for Newton when Secant is OK: n=480.000000 pv=100000.000000 pmt=-208.333333 fv=0.000000 => I%=0% FVerror=540000 I also implemented a prototype hybrid algorithm. This uses g=3 (g=2 is not as good). Here compared to Secant (with g=2) it performs well: tvmperfcomp-hybrid.pdf (Size: 37.14 KB / Downloads: 2) The number of evals is between Newton and Secant, which is to be expected. The FVerror looks alright, a bit better than Newton and a little less good than Secant. But this is preliminary. There is some room for improvement. - Rob "I count on old friends to remain rational" |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 8 Guest(s)