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 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. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)