-
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
Let’s graphically investigate the effect of compounding. What if we invest \$100 into an investment or bank account that guarantees us 5% annual return over 30 years? What will our investment look like over time? The first step is to create a list to denote each year.
In [6]:
#Create a list to denote each year
years = list(range(31))
print(years)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]
Now, we can make a list to denote the value at each point in time.
In [7]:
p = 100
r = .05
A = [compoundInterest(p,r,t) for t in years]
print(A)
[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, 432.1942375150668]
Finally, graph the values, and notice how the slope gets larger and larger!
In [8]:
import matplotlib.pyplot as plt
plt.plot(years,A)
plt.xlabel("Year")
plt.ylabel("Value")
plt.title("Compound Interest")
plt.show()
Prev
Basics