Number of compounding periods
Payment
Present value
Future value
When payments are due ('begin' or 'end')
Starting guess for solving the rate of interest
Required tolerance for the solution
Maximum iterations in finding the solution
the rate of interest per period (or NaN
if it could
not be computed within the number of iterations provided)
v0.0.16
Use Newton's iteration until the change is less than 1e-6 for all values or a maximum of 100 iterations is reached. Newton's rule is:
r_{n+1} = r_{n} - g(r_n)/g'(r_n)
where:
g(r)
is the formulag'(r)
is the derivative with respect to r.The rate of interest is computed by iteratively solving the (non-linear) equation:
fv + pv * (1+rate) ** nper + pmt * (1+rate * when) / rate * ((1+rate) ** nper - 1) = 0
for `rate.
Generated using TypeDoc
Compute the rate of interest per period