Present Value Part 2
Judging Investment Opportunities¶
Using present value, if we assume that we can invest/borrow money in the same rate as the discount rate, we are able to see what is a good or bad investment. For example, what if a bank offeres to either lend or hold your money with a 5% return? What do the cash flows look like? We are going to use negative cash flows to represent money we give the bank to hold, and positive to denote money we get. So in this case we get a loan for \$100 then we give back \\$105 at the end of the year. The first is positive, the second is negative.
#With the bank, we get 100 at period 0 and must pay back 105 at period 1
timelinePlot(1,(100,0))
timelinePlot(1,(-105,1))
What if we are offered a bond which costs \$100 right now, but will give you back \\$110? Is this priced correctly? We can answer that by saying what the present value should be.
print(110/1.05)
The bond is actually underpriced, it should really be \$104.76. In this case we have a great deal! To emphasize how this might be underpriced, let's sketch the cashflows from the bond first.
#With the bond we pay $100 in period 0, and get back $110 in period 1
timelinePlot(1,(-100,0))
timelinePlot(1,(110,1))
If we combine taking the bank loan and buying the loan, we see that we actually have a net cashflow of \$0 at period 0 but end up making \\$5 net profit in period 1!
cf0 = 100 - 100
cf1 = 110 - 105
timelinePlot(1,(cf0,0))
timelinePlot(1,(cf1,1))
I am making a modification of the function so that multiple values can be plotted on the same timeline.
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()
#So the bond decision now looks like this
timelinePlot(1,[(-100,0),(110,1)])
#Or, if we had 5 periods of compounding at 5%
#Notice there are no points in between because we do not take our money out until the 5th year
timelinePlot(5,[(-100,0),(100*(1.05)**5,5)])