-
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
-
Creating Portfolios
Building Portfolios¶
Let’s imagine for a second that we can build portfolios that automatically rebalance each day to a set allocation. I am making this assumption to avoid issues with stocks getting much bigger or smaller than their original allocation. What might a portfolio look like in comparison to the other two stocks on their own? Let’s take a look at our first two stocks and get some statistics on them.
In [36]:
#Get the first two sets of stock returns
r1 = stock_returns[0]
r2 = stock_returns[1]
#Print out statistics on them
print("Mean Daily Return:")
print("Stock 1: {}".format(np.mean(r1)))
print("Stock 2: {}".format(np.mean(r2)))
print()
print("Standard Deviation:")
print("Stock 1: {}".format(np.std(r1)))
print("Stock 2: {}".format(np.std(r2)))
print()
print("Correlation:")
print(np.corrcoef(r1, r2)[0,1])
Mean Daily Return:
Stock 1: 0.0037979364715901988
Stock 2: 0.00042731018644079973
Standard Deviation:
Stock 1: 0.042180184985796475
Stock 2: 0.032071094066450916
Correlation:
0.3468854183341703
What about a portfolio of 50%/50% these two, what is the return and standard deviation then?
In [37]:
portfolio_returns = r1 * .5 + r2 * .5
print("Mean Daily Return:")
print("Stock 1: {}".format(np.mean(r1)))
print("Stock 2: {}".format(np.mean(r2)))
print("Portfolio: {}".format(np.mean(portfolio_returns)))
print()
print("Standard Deviation:")
print("Stock 1: {}".format(np.std(r1)))
print("Stock 2: {}".format(np.std(r2)))
print("Portfolio: {}".format(np.std(portfolio_returns)))
print()
Mean Daily Return:
Stock 1: 0.0037979364715901988
Stock 2: 0.00042731018644079973
Portfolio: 0.0021126233290154985
Standard Deviation:
Stock 1: 0.042180184985796475
Stock 2: 0.032071094066450916
Portfolio: 0.03060323415999265
Prev
Correlation and Beta
Next
Diversification