Modern Portfolio Theory (MPT) is a framework for constructing an investment portfolio that maximizes returns for a given level of risk. Developed by Harry Markowitz in 1952, it emphasizes diversification to minimize idiosyncratic risk while optimizing expected returns.
MPT measures risk as the standard deviation of the portfolio’s returns. For a weighted portfolio with n assets, the portfolio’s volatility is then given by σp=∑i=1n∑j=1nwiσiwjσjρi,j,
where ρi,j is the correlation between the i-th and the j-th asset.
When assets are not perfectly correlated, the overall portfolio volatility decreases, allowing investors to construct an efficiently weighted portfolio that offers the best possible return for a given level of risk. The set of optimal portfolios forms the efficient frontier, a curve that represents the highest expected return achievable at each level of risk:
When a risk-free asset is introduced, the efficient frontier transforms into a straight line, known as the capital market line, given by the equation E(Rp)=Rf+σME(RM)−Rfσp,
where E(RM)−Rf is the market risk premium (expected market return minus the risk-free rate), and σM is the overall market volatility. The slope of the capital market line is called the Sharpe ratio, Sa=σME(RM)−Rf, and is a measure of the increase in expected return per 1% increase in volatility.
The tangency portfolio (T) is the point where the efficient frontier meets the capital market line (CML), representing the optimal mix of risky assets. Maximizing the Sharpe ratio, it allows investors to tailor their risk exposure by combining it with risk-free lending or borrowing.
Usage of the Sharpe Ratio
The Sharpe ratio can be used to determine the risk-reward of any asset (or combination of assets). However, in terms of the capital market line, the Sharpe ratio is used exclusively in combination with market returns and volatility.
Examples
Two-Stock Portfolio
Suppose you want to pick the optimal portfolio of two stocks, ABC and XYZ:
Stock ABC has a return of 9%, and volatility of 27%.
Stock XYZ has a return of 15%, and volatility of 33%.
The correlation between ABC and XYZ is around 0.2.
The risk-free rate is 4.5%, and the risk premium is 5%. The market volatility is 12.5%.
We proceed with the following code:
import matplotlib.pyplot as pltimport seaborn as snsimport numpy as npimport statsmodelssigma_abc = 0.27sigma_xyz = 0.33corr = 0.2er_abc = 0.09er_xyz = 0.15w = 1i = 0.05r = {}while w >= 0: er = w * er_abc + (1 - w) * er_xyz risk = np.sqrt((w * sigma_abc) ** 2 + ((1 - w) * sigma_xyz) ** 2 + 2 * w * (1 - w) * corr * sigma_abc * sigma_xyz, ) r[w] = (risk, er) w -= i w = round(w, 2)sharpe = [(pf[1] - 0.045) / pf[0] for w, pf in r.items()]opt_idx = sharpe.index(max(sharpe))risk = [pf[0] for pf in r.values()]ret = [pf[1] for pf in r.values()]opt = (risk[opt_idx], ret[opt_idx])opt_w = [k for k, v in r.items() if v == opt][0]print(r)sns.scatterplot(x = risk, y = ret, hue=r.keys())plt.scatter(x = risk[opt_idx], y = ret[opt_idx], color = 'green', )plt.annotate(text=f"{opt_w}:{1-opt_w}, Sharpe = {round(max(sharpe), 3)}", xy = opt)plt.xlabel("Porfolio Risk")plt.ylabel("Porfolio Return")plt.legend(title="Weight on ABC")plt.title("ABC:XYZ Portfolio Weights Return vs. Risk")