Trying to solve the loan amortization formula $a=\frac{pi}{1-(1+i)^{-n}}$ (https://en.wikipedia.org/wiki/Amortization_calculator) for $i$, the interest rate per period. Have tried root solver on excel to no avail. Any help would be much appreciated. Thanks in advance.
-
2Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Aug 22 '22 at 09:07
-
Is that $\pi$ or $pi$ on the numerator? – FShrike Aug 22 '22 at 09:23
-
For large $n$ you might run into ‘unsolvable’ polynomials: you may then have to resort to the user of funky special functions or numerical methods – FShrike Aug 22 '22 at 09:24
-
@FShrike sorry mate thats p*i and n is a constant 364, reckon it can work? – iHaveAQuestion Aug 22 '22 at 10:12
-
@FShrike. Look at the Padé approximant I added in my edit. Cheers :-) – Claude Leibovici Aug 22 '22 at 10:59
1 Answers
Rewriting it as in the linked Wikipedia page, let $k=\frac A P$ and you want to solve for $i$ $$k=\frac{i \,(i+1)^n}{(i+1)^n-1}$$ which is a polynomial of degree $(n+1)$; so, no explicit solution if $n>3$ (even for $n=3$, it would be ugly).
So, you need a numerical method or approximations.
By chanve, we know that $i \ll 1$. So, use the binomial expansion and long division or Taylor expansion. You should obtain $$k=\frac{1}{n}+\frac{ (n+1)}{2 n}i+\frac{ \left(n^2-1\right)}{12 n}i^2-\frac{ \left(n^2-1\right)}{24 n}i^3-\frac{\left(n^4-20 n^2+19\right)}{720 n}i^4 +O\left(i^5\right)$$ Now, using series reversion $$i=t-\frac{n-1}{6} t^2+\frac{(n-1) (2 n+1)}{36} t^3-\frac{(n-1) (2 n+1) (11 n+7) }{1080}t^4+O\left(t^{5}\right)$$ where $$t=\frac{2 (k n-1)}{n+1}$$
How good or bad is it ? Try with $k=\frac 7 {100}$ and $n=20$. The above formula will give $$i \sim \frac{563678644}{16409334375}=0.0343511\cdots$$ while the solution given by Newton method is $i=0.0344321\cdots$. No too bad but the error will increase quite fast with $k$; for example, for $k=\frac 1 {10}$ and $n=20$, the formula will give $$i\sim \frac{1883464}{26254935}=0.0717375\cdots$$ while the solution given by Newton method is $i=0.0775469\cdots$
So, the most appropriate is to use Newton method with $i_0=0$ which gives $i_1=\frac{2 (k n-1)}{n+1}$ (this is the $t$ in the previous formula) and repeat $$i_{p+1}=i_p-\frac {f(i_p)} {f'(i_p)}$$ where $$f(i)=\frac{i \,(i+1)^n}{(i+1)^n-1}-k$$ $$f'(i)=n\frac{i \, (i+1)^{n-1}}{(i+1)^n-1}+\frac{(i+1)^n}{(i+1)^n-1}-n\frac{i \, (i+1)^{2 n-1}}{\left((i+1)^n-1\right)^2}$$
Trying the second example, the iterates will be $$\left( \begin{array}{cc} p & i_p \\ 0 & 0.0952381 \\ 1 & 0.0779815 \\ 2 & 0.0775472 \\ 3 & 0.0775469 \end{array} \right)$$
You would need a very short time to implement it in Excel.
Edit
In terms of approximation, what we can also do is to build a simple $[2,2]$ Padé approwimant of the rhs. This would then write as $$k n \sim \frac{1+\frac{2(n+3)}{5} i +\frac{(n+2)(n+3)}{20} i^2 }{1-\frac{n-7}{10} i +\frac{(n-2) (n-1)}{60} i^2 }$$ which is just a quadratic equation in $i$. Solve it and retain the positive root.
For the second example, it gives $$i=\frac{\sqrt{4871}-59}{139}=0.0776442\cdots$$
- 260,315
-
thanks very much for your response mate I really appreciate it! – iHaveAQuestion Aug 22 '22 at 10:41
-
+1 I still remember you teaching me about Padé approximants (maybe ~ 7 months ago) for the first time! – FShrike Aug 22 '22 at 11:03
-
1