-
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
-
Bond Valuation
In [1]:
#Face value
FV = 1000
#Coupon Rate
cr = .02
#Coupon payment
coupon = FV*cr
#Periods
periods = 5
#We get one payment every year
payments = [coupon]*periods
#Last period we also get the face value
payments[-1]+=FV
print(payments)
[20.0, 20.0, 20.0, 20.0, 1020.0]
Now if our discount rate is 5% we can also find what the present value is going to be as we did before.
In [2]:
time = list(range(1,6))
#Get the present value for each year
PV = [x/(1.05)**t for x,t in zip(payments,time)]
print(PV)
#Find the sum over the years
PV = sum(PV)
print(PV)
[19.047619047619047, 18.140589569160998, 17.27675197062952, 16.454049495837637, 799.196689797828]
870.1156998810752
In [3]:
#Bringing back our timeline function
import matplotlib.pyplot as plt
def timelinePlot(periods,values):
#Create our plot
fig = plt.figure(figsize=(12, 4))
ax = fig.add_subplot(111)
#Set the limits of our plots (in terms of values, not dimensions)
ax.set_xlim(0,10)
ax.set_ylim(0,10)
#Set the minimums that we will be plotting in (we give a 1 or 10% margin on each side)
xmin = 1
xmax = 9
#Set the y of where our plot will be centered around, 5 is the middle
y = 5
#Set height for our ticks
height = 1
#Get the spacing between each tick
delta = (xmax-xmin)/periods
#Create the positions for each tick
positions = [xmin+delta*x for x in list(range(periods+1))]
#Plot the horizontal line
plt.hlines(y, xmin, xmax, color='grey')
for t in range(periods+1):
#Plot the tick
plt.vlines(positions[t], y - .5, y + .5, color='grey')
#Plot the time period below
plt.text(positions[t], y-1.2, t, horizontalalignment='center',fontsize=14)
#Get rid of axes
plt.axis('off')
for value in values:
#Plot a red dot on the year that our value is at
plt.plot(positions[value[1]],y, 'ro', ms = 15, mfc = 'r')
#Plot the values above, use rounding to keep it clean
plt.text(positions[value[1]], y+1.2, "$"+str(round(value[0],1)), horizontalalignment='center',fontsize=18)
plt.show()
#Plot the data
data = [(-PV,0)]
for x,t in zip(payments,time):
data.append((x,t))
timelinePlot(5,data)
Prev
Introduction
Next
Discount Bond