-
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
-
Covariance
Covariance¶
In financial markets, we can expect that to some extent assets are going to move together. Below, we have a simulated stock price. We will begin seeing what its relationship to the broader market is.
In [20]:
plt.plot(range(len(ts_stock)),ts_stock)
plt.xlabel("t")
plt.ylabel("Stock Price")
plt.title("Stock 1 Price")
plt.show()
How does it look compared to the overall market returns?
In [21]:
#Compare to the market returns
plt.plot(range(len(ts)), ts, label="Market")
plt.plot(range(len(ts_stock)), ts_stock, label="Stock 1")
plt.xlabel("t")
plt.ylabel("Stock Price")
plt.title("Stock Price vs. Market Price")
plt.legend()
plt.show()
The first thing we might ask when comparing these two is what is the difference between their HPR? We can easily find it below.
In [22]:
#Compute HPR
HPR_market = ts[-1] / ts[0] - 1
HPR_stock = ts_stock[-1] / ts_stock[0] - 1
print("Market HPR: {}".format(HPR_market))
print("Stock HPR: {}".format(HPR_stock))
Market HPR: 0.819970400153097
Stock HPR: 0.5537312068060418
What about standard deviations?
In [23]:
#Compute standard deviation
sd_market = np.std(market_returns)
sd_stock = np.std(stock_returns)
print("Market Standard Dev: {}".format(sd_market))
print("Stock Standard Dev: {}".format(sd_stock))
Market Standard Dev: 0.019768165185653
Stock Standard Dev: 0.018626116756718335
And daily return.
In [24]:
#Compute mean daily return
mu_market = np.mean(market_returns)
print(mu_market)
mu_stock = np.mean(stock_returns)
print(mu_stock)
0.0013937378851261314
0.0010548547453429593
Prev
Market Risk