Post Reply 
Request TVM formula guidance
12-28-2014, 06:46 AM
Post: #15
RE: Request TVM formula guidance
(12-25-2014 12:42 PM)Dieter Wrote:  
(12-24-2014 05:17 AM)iMatt04bit Wrote:  Dieter I have to ask: how did you determine that formula? Its awesome.

Quote:It's trivial. ;-)
Sure, for you... I was staring at it in amazement. :0

That's simply the next approximation you get with Newton's method if you start with r=0, using the TVM formula as stated in the documentation for the WP34s TVM solver. So it's nothing but

r   ≈   0 – TVM(0) / TVM'(0)

You can also do this with the TVM formula as it is given in the 12C manual. In this case the result is

r   ≈   –2 * (pv + n*pmt + fv) / (n * (pmt*(n+2*k-1) + 2*pv))

In other words: you could just as well start with r=0 and you'd get these approximations after the first iteration step. ;-)

However, this would require special handling of the (removable) singularity at r=0 where the TVM function and its derivative are not defined (both approach a limit as r→0, and these limits are used for the first guess). If the mentioned approximation is used as the first guess and the next iteration step still yields r=0, the solution is r=0. Else we can expect the following iterations to lead away from r=0, thus avoiding problems with the singularity at that point.

In many cases these two approximations bracket the true interest rate, or their mean is an even better estimate that comes quite close. Using your original example (n=10, PV=50, PMT=–30, FV=400, k=0) the two approximations are 9,836% and 17,647% (mean = 13,74%) while the exact rate is 14,436%.

However, this (one approximation a bit low, the other one a bit high) is not the case under all circumstances. ;-)

Quote:Addendum (Dec 26): Obviously we ain't seen nothing yet. I just read HP Journal 10/1977 on the new HP92 financial calculator. The article mentioned the "new" TVM formula (with signed parameters) and the problems when solving for the interest rate. Most of these problems look quite familar, and the author stresses the importance of a decent initial guess. Quote: "...a strategy was developed that produces inital guesses accurate to five decimal places". Well, that's awesome. :-)
I am still trying to figure out how that is done - 5 decimal places on the 1st guess!
Sure sounds like rocket science to me. ; )

Quote:BTW there also is an interesting read on the way the good old HP80 tries to solve for the interest rate (at least in a standard case like FV=0) which is described in HP Journal 5/1973 (cf. Appendix A following the article). Here the author even describes how the formula for the first guess was developed. Please note that at that time all variables were entered unsigned, i.e. usually positive.
I am so impressed with the minds behind those HP innovations.
Maybe I can deduce how to plot some of this... my graphing skills are a bit rusty.

We now can see whether we can develop a strategy that produces decent guesses for various scenarios. We can tell quite easily whether a solution exists and if there are multiple or no solutions at all. Upper limits for the interest rate can be given for some standard cases, e.g. FV=0 or PV=0, where the interest rate approaches a limit as n approaches infinity (which helps solve these ciritcal cases for large n where convergence may become extremely slow – which is also mentioned in the HP Journal article). Designing an algorithm that estimates the interest rate for different scenarios will be a tricky task, but I think it can be done. However, compared to HP's, I assume my skills are too limited to get a result with five valid digits in the initial guess. On the other hand, for large n and FV=0 or PV=0 this can be accomplished quite easily.

Your turn now. :-)

Dieter

Thanks for the info, I am reading the journal now.

I revisited the 2nd root prediction and have a solution that seems to be working.
I can get a first approximation in 4-5 iterations, and then feed that to the Newton solver for an exact value.

Essentially I scan in 10ths of the first root between root-1/10th and 0 + 1/10.
I scan to convergence from top-down, bot-up; and for both pos and neg values simultaneously.
If there is either a pos or neg solution, then the loop breaks on convergence.

I am using the TVM formula to evaluate for the best solution (within the loop).

I am working on the hypothesis that the absolute value of the 2nd root is less than the absolute value of the primary root (and greater than zero). Does this seem sane?

This method solves 2 scenarios (the only ones I have at the moment) which have double roots:
N:10 PV:50 PMT:-30 FV:100 with 58.203829688346610, -28.443599888025595
N:10 PV:50 PMT:-30 FV:400 with 53.172213268384720, 14.435871328079967

-matt
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Request TVM formula guidance - iMatt04bit - 12-02-2014, 05:33 AM
RE: Request TVM formula guidance - Dieter - 12-03-2014, 09:17 PM
RE: Request TVM formula guidance - Dieter - 12-11-2014, 06:36 PM
RE: Request TVM formula guidance - Dieter - 12-14-2014, 04:24 PM
RE: Request TVM formula guidance - Dieter - 12-17-2014, 01:21 PM
RE: Request TVM formula guidance - Dieter - 12-21-2014, 06:14 PM
RE: Request TVM formula guidance - Dieter - 12-25-2014, 12:42 PM
RE: Request TVM formula guidance - iMatt04bit - 12-28-2014 06:46 AM
RE: Request TVM formula guidance - Dieter - 12-29-2014, 07:47 PM



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