The Math Behind Loans

The other day, JLP at All Things Financial put up a post demonstrating how to calculate the present value of an annuity. In it, he demonstrated how you can use the present value formula to calculate how much you’d need to invest today at a given rate of interest in order to generate a fixed income for a number of periods.

I’d like to piggy-back on JLP’s post and show you another application where you can use this concept: to make a number of loan calculations. Once people find out I’m a finance professor, I often get questions about their mortgages. Here’s a somewhat lengthy example that shows how to use the present value of an annuity formula to do some calculations related to amortized loans (like mortgages). The following example demonstrates how to use the formula to calculate loan payments, how to calculate what the loan balance will be at any point in time, and also how to figure out how much of a given year’s payments goes towards principal and how much towards interest. It’s a bit involved, but it does work through all the basic calculations.

First, here are a few basic concepts that you need to know to go before you go further

  • On an amortized loan, payments are applied to both principal and interest (first towards interest and then principal).
  • The balance on an amortized loan goes down over time. In fact, the term “amortized” comes from the Latin word for death (i.e. the loan balance “dies off” over time).
  • The outstanding balance of an amortized loan at any point in time will be the Present Value of the remaining payments on the loan.

So, without further ado, let's look at a simple example that I give to students in my introductory finance class:

Assume you take out a $200,000 mortgage with a 30-year term, monthly payments, and an annual interest rate of 6%. (1) What’s the monthly payment on the loan? (2) What will the outstanding balance on the loan be in a year’s time (i.e. after you’ve made 12 payments)? (3) How much of your total payments in the first year will go towards principal (i.e. reduction of the loan balance), and (4) how much towards interest?

1) Calculating the monthly payment on the loan:

To calculate the monthly payment, you first must calculate the “Present Value of an Annuity” factor. The formula for this factor is

PV factor = 1/r – (1/r) x [1/(1+r)] ^ n

= (1/0.005) – (1/0.005) x (1/1.005)^360 = 166.7916.

NOTE: in the notation abve, “r” is the interest rate per month (since it’s a monthly loan), “n” is the number of periods covered by the loan (360 in this case, since it’s a 30-year loan and it’s paid monthly) and the “^n” means “raised to the nth power”.

When calculating a loan payment, you divide the present value factor into the $200,000 initial balance on the loan. This give us a payment of 200,000/166.7916 = $1,190.10 per month.

Note: this is for principal and interest only. Your actual payment may also include property taxes, insurance, and PMI, but those are separate from the “basic” payment on the loan.

2) Calculating the the outstanding balance on the loan be in one year’s time:

The loan balance after one year will be the present value of the remaining 348 payments (29 years times 12 months) of $1,190.10 that are still owed on the loan as of the end of the first year. To calculate this present value, first calculate the Present Value Factor using the formula from the previous section. However, after a year has goen by, “n” would be 348 instead of 360 (after a year's time, there are only 348 months remaining on the loan):

PV factor = (1/0.005) – (1/0.005) x (1/1.005)^348

= 164.7438

In step 1, we calculated the payment based on the outstanding balance. In that step, we divided the factor into the outstanding balance of $200,000 to get the monthly payment. Now, we’re going the opposite way – we know the payment, and we want to determine the outstanding balance. So, in this case we multiply the payment of $1,190.10 by the new present value factor to get an outstanding balance of 1,190.10 x 164.7438 = $197,543.98.

Note: after two years have gone by, the calculation would be based on “n” being 336 (28 years times 12 months per year). After two years in the mortgage, the present value factor would be 162.5688, and the outstanding balance would be $194,935.47.

3) Calculating how much of the total payments in the first year goes towards principal:

We began the first year with a balance of $200,000 on the loan and ended it with a balance of $197,543.98. The difference between these two numbers ($200,000 - $197,543.98) is the amount we paid towards principal during the first year. In other words, we paid off $2,456.02.

This might not seem like you've paid off a big chunk of the loan. After all, you pay almost $1200 per month, so paying off only $2,456 in a year’s time seems like a rip-off, right? Keep in mind that you’ve borrowed $200,000, and the interest on the loan is 0.5% per month (i.e. 6% per year, divided by 12). So, the interest owed on the loan in the first month is $1,000. This means that in the first month of the loan, since you paid “only” $1,199.10, the first $1,000 goes towards paying the interest on the $200,000, leaving $199.10 to go towards paying down the loan. In the second month of the loan, the amount of the payment going towards principal is a tiny bit more than $199.10, since your outstanding balance is a bit less than $200,000 (remember, you paid down the loan by $199.10 in the first month). So, looked at it this way, the $2,456 paid off in the first year doesn’t seem too far off the mark. It’s a bit more than the $199.10 you paid off in the first month times 12.

4) Calculating how much of the total payments in the first year goes towards interest:

To calculate the amount of interest paid in the first year, remember that all payments on an amortized loan go towards a combination of principal and interest. In the first year, you made total payments of $1,199.10 per month times 12 months, or $14,389.20. In Step 3, you calculated that the loan balance went down by $2,456.02 over the course of the year. So, of the $14,389.20 that you paid, $2,456.02 went towards principal repayment. This means that the remainder of $14,389.20 -$2,456.02= $11,933.18 went towards interest.

Just as a “seat of the pants” check to make sure that this is a reasonable figure, take the annual interest rate of 6% and multiply it times the initial balance of $200,000, and you’d get $12,000. The total interest paid over the first year’s time is actually a bit less than $12,000 because each payment decreases the outstanding balance a bit (remember – it’s an “amortized” loan, so the balance “dies off” over time). Therefore, since the interest owed each month is based on the outstanding balance, it goes down a bit each month, and the amount paid towards principal goes up.

So there you have it. Of course, most people don’t make loan calculations by hand – you’d use either a financial calculator or spreadsheet to do the calculations. But now (hopefully), you can see what goes on “behind the scenes) in a loan.

In a future post, I’ll show how to use the built-in functions of a spreadsheet like Microsoft Excel to do the same calculations in a much more efficient fashion.