How to calculate the monthly interest rate?

In summary, the author is trying to find the monthly interest rate given the loan amount, number of monthly payments, and monthly payment. They are using a continuous compounding approximation and Newton's Method.
  • #1
h1a8
87
4
Homework Statement
Given the monthly payment A, loan amount P, and the number of months to payoff loan n, calculate the monthly interest rate i.
Relevant Equations
A = [Pi(1+i)^n] /[(1+i)^n-1]
First, I'm not sure if this is the right forum to post this question. It's not a homework problem or any assignment. Just doing this as an exercise. Ill just post it here just in case.

I’m trying to write a c++ program to calculate the monthly interest rate 'i' given the loan amount 'P' , number of monthly payments to payoff loan 'n' , and monthly payment 'A'. My background is a BA in mathematics.

Im familiar with the amortization formula
1) A = [Pi(1+i)^n] /[(1+i)^n-1]
I rearrange
->2) A/P = [i(1+i)^n] /[(1+i)^n-1]
Let c = A/P
->3) c = [i(1+i)^n] /[(1+i)^n-1]
->4) c(1+i)^n-c= i(1+i)^n
->5) c = c(1+i)^n-i(1+i)^n
->6) c = [(1+i)^n] (c-i)

I just don’t see an elementary way to solve for the rate i. Maybe some numerical technique? Taylor series perhaps?

I attempted 2nd degree Taylor series centered at 0, but the accuracy wasn't good enough. In higher order polynomials wasn't able to solve without computer software.

I Haven't tried Newton's method yet though.

So the question is what method(s) can I use to accurately get the rate i, given A, n, and P, so that I can apply it to a c++ program (or just in general)? And what algorithm do typical financial calculators use?
 
Physics news on Phys.org
  • #2
Use Newton's method to solve Eqn. 3.
 
  • #3
Chestermiller said:
Use Newton's method to solve Eqn. 3.
Continuous compounding is a pretty good approximation, with the formula $$\frac{P}{nA}=\frac{1-e^{-x}}{x}$$where x = n i. So first solve that to get a first approximation to i. Then do a Newton iteration on the non-linear actual equation.
 
  • #4
Chestermiller said:
Continuous compounding is a pretty good approximation, with the formula $$\frac{P}{nA}=\frac{1-e^{-x}}{x}$$where x = n i. So first solve that to get a first approximation to i. Then do a Newton iteration on the non-linear actual equation.
Thanks. But how do I solve the continuous compounding equation you posted for the approximation?
 
  • #5
h1a8 said:
Thanks. But how do I solve the continuous compounding equation you posted for the approximation?
Newton method also, starting with Taylor series to linear or quadratic terms.
Or, you can make a general table of the left hand side vs x, and, to get your initial guess for i , interpolate in the table.
 
Last edited:
  • #6
It converges quickly and surely so the initial guess doesn't really matter: ## \dfrac{nA-P}{nP} = \dfrac{A}{P} -\dfrac{1}{n} ## is where I'd start.
 
  • #7
pbuk said:
It converges quickly and surely so the initial guess doesn't really matter: ## \dfrac{nA-P}{nP} = \dfrac{A}{P} -\dfrac{1}{n} ## is where I'd start.
Where is i in your equation?
 
  • #8
The linearized solution for continuous compounding is $$x=ni=2\left(1-\frac{P}{nA}\right)$$
 
  • #9
Chestermiller said:
Where is i in your equation?
Edit: That's not an equation, that's an expression stated two different ways.
Made a hash of that didn't I? Hang on a bit...
 
  • #10
From Eqn. 1, $$\frac{P}{nA}=\frac{1-(1+i)^{-n}}{ni}$$To linear terms in i, this gives $$i=\frac{2}{n+1}\left(1-\frac{P}{nA}\right)$$
 
  • Like
Likes pbuk
  • #11
pbuk said:
Edit: That's not an equation, that's an expression stated two different ways.
Made a hash of that didn't I? Hang on a bit...
Not too much of a hash, missed out a factor of 2.

$$ i \approx \frac{2(nA-P)}{nP} = 2 \left( \frac{A}{P} -\dfrac{1}{n} \right) $$
 
  • #12
Chestermiller said:
From Eqn. 1, $$\frac{P}{nA}=\frac{1-(1+i)^{-n}}{ni}$$To linear terms in i, this gives $$i=\frac{2}{n+1}\left(1-\frac{P}{nA}\right)$$
Yes that is mathematically more sound than my approximaiton (once I remembered the factor of 2!) however for large ## n ## e.g. ## n = 300 ## (i.e. a 25 year loan) my approximation is closer. I think I prefer yours though.
 
  • #13
Thanks!
Using f(x) = (1+x)^n*(P*x/A-1) +1
I worked out that f(x) is both increasing and concave up when x > (An - P)/[P*(n+1)]
and that f{(An - P)/[P*(n+1)] } < 0 and f(A/P) = 1 > 0.
So f(x) = 0 implies that A/P < x < (An - P)/[P*(n+1)] .
Therefore, x is approximately the average of the two endpoints or 1/2 * {A/P + (An - P)/[P*(n+1)] } and is guaranteed to converge with Newton's Method.

I know this expression is not as simple looking as the linear ones you two gave, but it works well in my program after 10 iterations (for even the craziest of numbers). I had a few issues with the other two approximations in some cases but that could have been the programming and not the theory.
 

Related to How to calculate the monthly interest rate?

1. How do I calculate the monthly interest rate?

To calculate the monthly interest rate, you will need to know the annual interest rate and the number of compounding periods per year. Then, divide the annual interest rate by the number of compounding periods per year to get the monthly interest rate.

2. What is the formula for calculating the monthly interest rate?

The formula for calculating the monthly interest rate is:
Monthly Interest Rate = (Annual Interest Rate / Number of Compounding Periods) * 100

3. How does the number of compounding periods affect the monthly interest rate?

The number of compounding periods per year can affect the monthly interest rate because the more frequent the compounding, the higher the effective interest rate will be. This means that the monthly interest rate will be higher if the number of compounding periods is higher.

4. Can the monthly interest rate be negative?

Yes, the monthly interest rate can be negative. This can happen if the annual interest rate is negative or if there is a deflationary period. In these cases, the monthly interest rate will be a negative number.

5. How can I use the monthly interest rate to calculate my monthly payments?

To calculate your monthly payments, you can use the formula:
Monthly Payment = (Loan Amount * Monthly Interest Rate) / (1 - (1 + Monthly Interest Rate)^(-Number of Monthly Payments))

Similar threads

  • Precalculus Mathematics Homework Help
Replies
1
Views
924
  • Calculus and Beyond Homework Help
Replies
12
Views
1K
  • Calculus and Beyond Homework Help
Replies
6
Views
2K
  • Materials and Chemical Engineering
Replies
1
Views
526
  • Calculus and Beyond Homework Help
Replies
1
Views
1K
  • Precalculus Mathematics Homework Help
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
1
Views
552
  • General Math
Replies
1
Views
2K
Back
Top