|
-
Nov 23rd, 2009, 05:52 PM
#1
Thread Starter
Hyperactive Member
Repaying a Loan with Compound Interest
Hi,
does anyone have an algorithm for loan repayments?
For example, a $10000 loan, with interest of 5%pa, but calculated daily, and repayments of $200 a month? (of course, those have to be variables).
I've search this forum, and googled too, but with no luck. I know it's not rocket science, I'm just a bit hungover and my client wants it asap!
cheers.
"The passion lives to keep your faith, though all are different, all are great" ... Michael Hutchence 1960-1997.
Windows & Web Developer
Specialising in Visual Basic .Net & Client Server Programming & Client/Customer Relations Databases
Sutherland Shire, Sydney Australia
www.stingrae.com.au
Developer of Arnold - Gym & Martial Arts Database Management System
www.gymdatabase.com.au
-
Nov 25th, 2009, 10:58 AM
#2
Fanatic Member
Re: Repaying a Loan with Compound Interest
if i get this right, someone loans $10000 he made a deal that he will pay $200 a month until he payed the $10000 + interest($500)?
-
Nov 25th, 2009, 03:38 PM
#3
Re: Repaying a Loan with Compound Interest
Naw, not quite, as I understand it. Someone takes out a $10000 loan. They have 5% interest over the course of a year, though it's compounded daily. That's 5%/365days = 0.014% / day, so that each day you add 0.014% to the total amount of the loan as interest.
The payments are made every (say) 30 days, which eventually decreases the total. One way to do this is to use the compound interest formula for every period between repayments:
- Say interest rate per year is A, and interest rate per day is a. Make 'em decimals (shockingly, I'm a purist and dislike percentages). Say initial principal is P0, principal on day n is Pn, interest is compounded daily, and repayments occur every T days for R dollars.
- We take out our loan on day 0 for P0 dollars. We begin compounding interest between days 0 and 1 at midnight; compounding always occurs at midnight. We mail a loan repayment (which is instantly received) at dawn on day T, 2T, 3T, .... That is, the principle Pn on day T, 2T, 3T, ... figures in the most recent repayment.
- Calculate accrued interest between day 0 and day T in order to calculate the principal on day T, before figuring in loan repayment; call this quantity R_T. Calculate this with the usual compound interest formula
R_T = P0 * (1 + a)^T
Note that we've compounded between days 0-1, 1-2, 2-3, ..., T-1 - T. This gives T compoundings [T-1 - 0 + 1 = T]; hence, the T in the exponent.
- Now let's subtract off the payment received. This will be the principal on day T. It will be used for the next cycle of compound interest calculations as the initial principal.
P_T = R_T - R
- The next cycle is then just
R_2T = P_T * (1 + a)^T
P_2T = R_2T - R
...
In general, for n>=1,
R_nT = P_(n-1)T * (1 + a)^T
P_nT = R_nT - R
In the base case, P_(1-1)T = P_0 is known, so you can calculate the principle on any repayment day with this quite easily, as well as the life of the loan--if you ever get a negative or zero principle on a repayment day, you've overpayed or are done repaying the loan.
- You can also calculate the principle on an arbitrary day easily. Given a day nT+k for 0<=k<T (intuitively, k is the number of days since the last repayment), we will go through k compoundings and no repayments. Applying the standard compound interest formula again,
P_(nT+k) = P_nT * (1 + a)^k
Hopefully that's clear.
Last edited by jemidiah; Nov 25th, 2009 at 04:02 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|