Annuities Conclusion
Extending to 4 Periods¶
Now that we get how to do this with two periods, we can move on to four periods (or in general any number of periods). If we have 5 years at an annualzied rate of 6% paid in quarters, the following is the calculation of the annuity value. We can say that each year $1000 is paid, meaning the coupon is $250 a quarter.
In [24]:
#Set up the basic variables
#Variable to track the present value
PV = 0
#The number of payment periods
n = 5*4
#The annualzied rate
r = .06
#The quarterly payment
coupon = 1000/4
#Go through each period
for x in range(1,n+1):
#The time is in quarter years so divide by 4
t = x/4
#Add in the present value
PV += coupon / (1+r)**t
print(PV)
In [25]:
#Then way 1 to do nominal interest rates for the same
PV = 0
n = 5*4
r = .06/4
coupon = 1000/4
for x in range(1,n+1):
t = x
PV += coupon / (1+r)**t
print(PV)