Professional Documents
Culture Documents
Risk-Return Tradeo
Risk and Return tradeo is well known in capitalism. You may have
heard that, f you want higher return, you need take higher risk. That
seems a golden rule. But there is a possibility to combine two or more
risky stocks to build a portfolio that leads to lower risk but not
signi cantly reduce the return.
For demo purpose, I am coding up two set of arti cial stock prices. The
prices have the same trend regarding overall moving. As well, a
portfolio is built with 50% of stock 1 and 50% of stock 2 (If you haven’t
had an environment setup, check step 1 in this post).
https://towardsdatascience.com/reducing-risk-by-building-portfolio-8772d1ce0f21 1/6
3/4/2019 Risk management explained - Reduce Risk by Combining Risky Stocks into a Portfolio
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
periods = 252
noise = np.random.rand(252)
rng = pd.date_range('1/1/2011', periods=periods, freq='D')
# Artificially build two stock stock 1 and stock 2
stk1 = (np.arange(1, 1+(.001)*(periods), .001)) * 30 + noise
stk2 = (np.arange(1, 1+(.001)*(periods), .001)) * 30 - noise
ax = df.plot(title='Stock Price')
ax.set_xlabel('date')
ax.set_ylabel('close price')
ax.grid()
plt.show()
As we see in the below graph, both individual stock 1 and stock 2 go up,
from ~30 to ~37, through the year. Price deviates from the expected
value in a similar range (because of added noise). But the overall trend
is up. It also indicates that stock 1 and stock 2 have similar level of risk.
However, the portfolio value constantly goes up without volatility.
From return perspective, the portfolio yields similar return by giving
nal value ~37. That means combining two risky stock could get us a
less risky portfolio which provide the same level of return.
https://towardsdatascience.com/reducing-risk-by-building-portfolio-8772d1ce0f21 2/6
3/4/2019 Risk management explained - Reduce Risk by Combining Risky Stocks into a Portfolio
Why?
If we take a closer look at volatility movement of the two stocks, from
code or graph. When stock 1 deviates upward, the stock 2 deviates
downward by the same amount of value. The makes the risk of two
stocks cancel each other. Hence, it yields a smooth (less risky) line.
From Investopedia,
https://towardsdatascience.com/reducing-risk-by-building-portfolio-8772d1ce0f21 3/6
3/4/2019 Risk management explained - Reduce Risk by Combining Risky Stocks into a Portfolio
To verify, we print the correlation coe cient. The output prove that,
the stock 1 and stock 2 have -0.999787 which indicates the daily return
move inversely.
daily_return
PORTFOLIO STK1 STK2
2011-01-02 0.001000 -0.009390 0.011869
2011-01-03 0.000999 -0.008664 0.010894
2011-01-04 0.000998 0.019264 -0.017346
2011-01-05 0.000997 0.011912 -0.010373
2011-01-06 0.000996 -0.025108 0.028800
. . .
Recommended reading:
https://towardsdatascience.com/reducing-risk-by-building-portfolio-8772d1ce0f21 4/6