Post Reply 
Looking for TVM contributions
06-23-2024, 06:03 PM (This post was last modified: 06-23-2024 06:27 PM by robve.)
Post: #82
RE: Looking for TVM contributions
(06-22-2024 11:58 PM)Albert Chan Wrote:  
(06-22-2024 08:00 PM)robve Wrote:  - The 3rd case FVerror=100 looks really bad, but it means that we computed FV=-900 instead of FV=-1000 which was discussed in this thread before why this happens.

This example jogged my memory. I finally get what you mean by FVerr!

We're firing off too many posts with progress and observations Big Grin Can barely keep up myself at times...

(06-22-2024 11:58 PM)Albert Chan Wrote:  
Quote:It is very hard (impossible?) to improve this result with only 10 digits BCD precision as the least significant digit in i% causes FV to sway.

Perhaps we can! On this thread, post#61, I mentioned with i*n>0, r=(1+i)^n-1 is better.
Since i*n>0 is more common, this r should benefit every part of your code (*)

I had posted some initial observations with respect to S and R in this thread, but that went nowhere, because the impact is not consistent. It's more complicated.

I have experimented a bit more with this idea and found that if pv + fv < -n*pmt then applying "time reversal" is beneficial, meaning that we internally use r = expm1(n*log1p(j)) with rate j instead of r = expm1(-n*log1p(j)) and swapping pv with fv with negating. Note that when pv + fv = -n*pmt the rate is zero.

I collected results for this selective "time reversal" applied. It is almost perfect to improve the accuracy of the results for the set of test cases by reducing both the final npmt and the FV error. However, FV error may be lower simply because of the change in R and S using the "time reversed" FV formula (see here), so there is that. So in the results I've also included npmt (at the root rate) in addition to the FV error. The results are shown in the attached PDF. I marked rows with color background to show when time reversal was applied and when it improved the results (green: 6 cases), made it worse (red: 1 case) or did nothing/little (blue: 2 cases):

.pdf  tvmperfcomp-reversal-newton-hybrid.pdf (Size: 46.52 KB / Downloads: 4)

Both Newton and Hybrid benefit from selective time reversal. Newton does need a second phase (g=1) to produce more accurate results versus Hybrid with one phase (g=0). Hybrid has fewer evals (98 versus 105) and slightly fewer error cases (4 versus 5) but that could be just noise!

- Rob

PS. also compared these results to the results when always reversing, but always reversing also introduces new errors elsewhere and we end up with more error cases overall. But it does show there is still room for improving selective reversal.

"I count on old friends to remain rational"
Visit this user's website 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 - 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: 17 Guest(s)