Post Reply 
Request TVM formula guidance
12-20-2014, 05:47 AM (This post was last modified: 12-20-2014 06:47 AM by iMatt04bit.)
Post: #10
RE: Request TVM formula guidance
I found an improvement for the Secant method where it will solve much faster:
Code:
x0 = x0 - fx0 * ((x0 - x1)/(fx0 - fx1));

This should follow the other line with similar code.
Now the secant method decrements from both x0 and x1 points as it solves.

I have run some preliminary tests using a variety of TVM scenarios with good results.
Min/max number of iterations to solve for 21 scenarios tested are:
Newton: 2,6 and Secant: 5,9
The Newton method appears to offer the best accuracy.

I left out the stats for the double root scenarios because I am still looking for a formulaic method for determining:
1) a double root exists 2) an approximation of the 2nd root value - with an indication of sign.

I used the Euler methods (thanks Dieter) which have shown improved results.
A code sample:
Code:
f1 = Math.exp(N * Math.log1p(R));  // (1+R)^N
f2 = Math.exp(-N * Math.log1p(R));         // (1+R)^-N
f3 = Math.exp( (-N-1) * Math.log1p(R));  // (1+R)^(-N-1)

I attached 2 files for anyone interested.
The pdf file shows a comparison of values between emu-calculators and both solver methods. And the text file shows the output giving an indication of how well the methods are solving.


Attached File(s)
.pdf  tvm-solver-results.pdf (Size: 38.17 KB / Downloads: 10)
.txt  results.txt (Size: 69.96 KB / Downloads: 4)
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 - iMatt04bit - 12-20-2014 05:47 AM
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 - Dieter - 12-29-2014, 07:47 PM



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