Value a level series of payments and build the amortization schedule for a loan.
Why it matters
Most financial promises are not single payments but series of payments: monthly mortgage instalments, yearly pension benefits, quarterly insurance premiums. A series of payments at regular intervals is called an annuity (in this lesson, an annuity-certain: the payments happen no matter what; in module 2 the payments depend on someone being alive). Annuity formulas are the workhorse of Exam FM and of every loan, lease and pension calculation.
Annuity-immediate and annuity-due
Take n payments of 1, one per period, at effective rate i per period, with v = 1/(1+i).
- Annuity-immediate: payments at the end of each period (times 1, 2, ..., n). Its present value is
a_n = v + v^2 + ... + v^n = (1 - v^n) / i
- Annuity-due: payments at the start of each period (times 0, 1, ..., n-1). Every payment arrives one period earlier, so
ä_n = a_n * (1 + i) = (1 - v^n) / d, where d = i / (1 + i)
The accumulated value at time n of an annuity-immediate is s_n = ((1 + i)^n - 1) / i. The formula for a_n is a geometric series, and it is worth deriving once by hand: write a_n and v * a_n, subtract, and almost every term cancels.
Worked example 1: valuing a payout
A lottery pays 50,000 at the end of each year for 20 years. At 6% effective:
v^20 = 1.06^-20 = 0.311805
a_20 = (1 - 0.311805) / 0.06 = 11.469921
PV = 50000 * 11.469921 = 573,496.06
So the 1,000,000 "headline" prize is worth about 573,496 today at 6%. If the payments were at the start of each year, the value would be 573,496.06 * 1.06 = 607,905.82.
Loans: finding the payment
A loan of L repaid by n level end-of-period payments P is fair when the present value of the payments equals the amount borrowed:
L = P * a_n so P = L / a_n
Example: 200,000 borrowed for 30 years at 6% nominal, compounded monthly. Use monthly periods: j = 0.005, n = 360.
a_360 at 0.5% = (1 - 1.005^-360) / 0.005 = 166.791614
P = 200000 / 166.791614 = 1,199.10 per month
The amortization schedule
Each payment first pays the interest due on the outstanding balance; the rest repays principal:
interest_k = j * balance_(k-1)
principal_k = P - interest_k
balance_k = balance_(k-1) - principal_k
A 4-year loan of 10,000 at 8% with annual payments (P = 10000 / a_4 = 3,019.21):
| year | payment | interest | principal | balance |
|---|---|---|---|---|
| 0 | 10,000.00 | |||
| 1 | 3,019.21 | 800.00 | 2,219.21 | 7,780.79 |
| 2 | 3,019.21 | 622.46 | 2,396.74 | 5,384.05 |
| 3 | 3,019.21 | 430.72 | 2,588.48 | 2,795.56 |
| 4 | 3,019.21 | 223.65 | 2,795.56 | 0.00 |
The table shows amounts rounded to cents, but the calculation keeps full precision, so the final balance is exactly zero. Notice that interest falls and principal rises each year. A useful shortcut: the balance after k payments equals the present value of the payments still to come, P * a_(n-k) (the prospective method). That same idea returns as the policy reserve in module 2.
def loan_payment(principal, rate, n):
a_n = (1 - (1 + rate) ** -n) / rate
return principal / a_n
print(round(loan_payment(10000, 0.08, 4), 2)) # 3019.21
Common mistakes
- Due versus immediate. Read the timing of the first payment carefully; the two values differ by a factor of
1 + i. - Period mismatch. Monthly payments need the monthly effective rate and
nin months. - Forgetting the zero-rate case. If
i = 0,a_n = n; the formula divides by zero, so code needs a special case. - Rounding the payment before building the schedule. Lenders do round to cents, which leaves a small final adjustment; know which convention you are using.
Quick recap
a_n = (1 - v^n)/i,ä_n = (1 + i) * a_n,s_n = ((1+i)^n - 1)/i.- Level loan payment
P = L / a_n. - Each payment = interest on the balance + principal; balance after
kpayments =P * a_(n-k).
Try it
In the Do tab, code annuity_pv, loan_payment and a full amortization schedule, and check that the loan is paid off exactly.