Lets suppose I have the next values
$$0, 7, 8, 5, 6$$
And the next formula
$$4250 = \frac{0}{(1+r)} + \frac{7}{(1+r)^2} + \frac{8}{(1+r)^3} + \frac{5}{(1+r)^4} + \frac{6}{(1+r)^5}.$$
What is the easiest way to find the $r$?
I need a formula that supports $n$ values
Thanks, Radu
Can you, please, describe your question in more details? You can use any iterative procedure to solve it... You could use Newton-Raphson, for example. You need an algorithm, is that right?
You can define your functions as:
$$ g(r) = -b + \sum _{i = 1} ^N a_{i}(1 + r)^{-c_{i}} $$
$$ g'(r) = \frac {dg}{dr} = \sum_{i=1}^N -c_ia_i(1+r)^{-(c_i+1)} $$
The Newton-Raphson algorithm is as follows:
$$ r_{j+1} = r_j + \frac{g(r_j)}{g'(r_j)} $$
In the present case, N = 5, $a_i$ = {0, 7,8,5,6} , $a_i$ = {1, 2, 3, 4, 5} and b = 4250.