I need to calculate APR for loans. Constant repayment loans were covered clearly here Calculating annual percentage rate (need some help with inherited code)
My problem is where the repayment amount is not constant. The monthly repayments can differ and therefore Newton-Raphson does not seem applicable.
The formula is still 0 = loan amount - sum[Rp/(1+x)^p] where Rp is the repayment amount for repayment p. There are n repayments. Is there a way to solve this or is there a good way to make a good second guess to x based on the results of previous guesses?