04-18-2015, 02:19 PM (This post was last modified: 04-08-2022 06:10 PM by Thomas Klemm.)
Post: #34
 Thomas Klemm Senior Member Posts: 1,770 Joined: Dec 2013
(04-16-2015 10:04 PM)bshoring Wrote:  I believe for solving for i (interest rate) which must use Newton's Method, the single storage register is also used.

The algorithm used to calculate i when n, PMT and PV are given can be found in APPENDIX A of A Pocket-Sized Answer Machine for Business and Finance.

Quote:For a variety of reasons the best technique to try is the Newton-Raphson one and this was used for the annuity functions.

There's also flow chart in Fig. 3 but the initial value i0 has a typo: the number 2 should be in the numerator:
$i_0 = \frac{2(n-P)}{n(n+1)}$

A similar flow-chart can be found in Fig. 32 of United States Patent 3863060 on page 25 where it is correct.

I was wondering how they arrived at that initial guess:
Quote:First we sum the first three terms of the binomial expansion for f(i) and solve for i.

It turns out they just used the Taylor series as can be seen using Wolfram|Alpha:

Series[P-(1-(1 + r)^(-n))/r, {r, 0, 1}]

$$(P-n)+\frac{1}{2}n(n+1)r+O(r^2)$$

Solve[(P-n)+1/2 n (n+1) r, r]

$$r=\frac{2n-2P}{n^2+n}$$ and $$n(n+1)\neq0$$

Cheers
Thomas
 « Next Oldest | Next Newest »