-
Compound Interest Part 1 6
-
Lecture1.1
-
Lecture1.2
-
Lecture1.3
-
Lecture1.4
-
Lecture1.5
-
Lecture1.6
-
-
Compound Interest Part 2 3
-
Lecture2.1
-
Lecture2.2
-
Lecture2.3
-
-
Present Value 4
-
Lecture3.1
-
Lecture3.2
-
Lecture3.3
-
Lecture3.4
-
-
Annuities 6
-
Lecture4.1
-
Lecture4.2
-
Lecture4.3
-
Lecture4.4
-
Lecture4.5
-
Lecture4.6
-
-
Perpetuities 2
-
Lecture5.1
-
Lecture5.2
-
-
Bonds 6
-
Lecture6.1
-
Lecture6.2
-
Lecture6.3
-
Lecture6.4
-
Lecture6.5
-
Lecture6.6
-
-
Dividend Discount Model 3
-
Lecture7.1
-
Lecture7.2
-
Lecture7.3
-
-
Risk 8
-
Lecture8.1
-
Lecture8.2
-
Lecture8.3
-
Lecture8.4
-
Lecture8.5
-
Lecture8.6
-
Lecture8.7
-
Lecture8.8
-
-
Capital Asset Pricing Model 6
-
Lecture9.1
-
Lecture9.2
-
Lecture9.3
-
Lecture9.4
-
Lecture9.5
-
Lecture9.6
-
Plotting Compound Interest Part 2
If we wanted an easy way to compute the interest earned each year we could break down the formula. Interest earned would be:
$ I_{t} = A_{t} – A_{t-1} $
$ I_{t} = P * (1+r)^t – P * (1+r)^{t-1}$
In [9]:
years = list(range(1,31))
I = [compoundInterest(p,r,t) - compoundInterest(p,r,t-1) for t in years]
print(I)
[5.0, 5.25, 5.512500000000017, 5.788125000000008, 6.077531250000007, 6.381407812500001, 6.700478203125016, 7.03550211328124, 7.387277218945343, 7.7566410798925745, 8.144473133887203, 8.551696790581587, 8.979281630110677, 9.4282457116162, 9.89965799719701, 10.394640897056803, 10.914372941909733, 11.460091589005145, 12.033096168455472, 12.634750976878166, 13.266488525722139, 13.929812952008263, 14.626303599608605, 15.357618779589075, 16.125499718568562, 16.931774704496945, 17.77836343972183, 18.667281611707892, 19.600645692293313, 20.580677976907964]
In [10]:
import matplotlib.pyplot as plt
plt.plot(years,I)
plt.xlabel("Year")
plt.ylabel("Interest")
plt.title("Compound Interest Payments")
plt.show()
In [11]:
print(A[:-1])
print()
print(A[1:])
[100.0, 105.0, 110.25, 115.76250000000002, 121.55062500000003, 127.62815625000003, 134.00956406250003, 140.71004226562505, 147.7455443789063, 155.13282159785163, 162.8894626777442, 171.0339358116314, 179.585632602213, 188.56491423232367, 197.99315994393987, 207.89281794113688, 218.2874588381937, 229.20183178010342, 240.66192336910856, 252.69501953756404, 265.3297705144422, 278.59625904016434, 292.5260719921726, 307.1523755917812, 322.5099943713703, 338.63549408993885, 355.5672687944358, 373.3456322341576, 392.0129138458655, 411.6135595381588]
[105.0, 110.25, 115.76250000000002, 121.55062500000003, 127.62815625000003, 134.00956406250003, 140.71004226562505, 147.7455443789063, 155.13282159785163, 162.8894626777442, 171.0339358116314, 179.585632602213, 188.56491423232367, 197.99315994393987, 207.89281794113688, 218.2874588381937, 229.20183178010342, 240.66192336910856, 252.69501953756404, 265.3297705144422, 278.59625904016434, 292.5260719921726, 307.1523755917812, 322.5099943713703, 338.63549408993885, 355.5672687944358, 373.3456322341576, 392.0129138458655, 411.6135595381588, 432.1942375150668]
In [12]:
I = [a-b for a,b in zip(A[1:], A[:-1])]
print(I)
[5.0, 5.25, 5.512500000000017, 5.788125000000008, 6.077531250000007, 6.381407812500001, 6.700478203125016, 7.03550211328124, 7.387277218945343, 7.7566410798925745, 8.144473133887203, 8.551696790581587, 8.979281630110677, 9.4282457116162, 9.89965799719701, 10.394640897056803, 10.914372941909733, 11.460091589005145, 12.033096168455472, 12.634750976878166, 13.266488525722139, 13.929812952008263, 14.626303599608605, 15.357618779589075, 16.125499718568562, 16.931774704496945, 17.77836343972183, 18.667281611707892, 19.600645692293313, 20.580677976907964]
Next
Comparing r