2  Miracle of Diversification

Porfolios are combinations of underlying assets. In this chapter, we will focus primarily on portfolio risk when multiple assets are combined in a portfolio. Diversification is a foundational, and somewhat miraculous, concept in forming portfolios. By combining assets together, we may be able to build a portfolio that has less risk than even the least risky asset we use as a building block! We will discuss the benefits of diversification repeatedly throughout this and future chapters.

In the sections below, we first discuss diversification in the context of portfolios of two, three, or many risky assets. Then we consider a set of portfolios of risky assets that provide the maximum level of diversification for a given expected return.

2.1 Portfolios of Two Risky Assets

Consider forming a portfolio of two risky assets. To fix ideas, let’s consider these to be a US stock market fund and an international stock market fund. Unless otherwise stated, we will assume that portfolios are fully invested; that is, that the sum of the weights equal 1. If we invest all of our capital in some combination of these two assets, what are the expected returns and standard deviations of all the potential portfolios? Assume for now that we cannot short sell either asset; that is, the fraction invested in each must be non-negative.

The return of a two-asset portfolio is the weighted sum of the returns of the underlying assets: $r_p = w r_{\text{US}} + (1-w) r_{\text{intl}} \,, \tag{2.1}$ where $$w$$ is the portfolio weight in the US stock fund. The expected return of the portfolio is: $E[r_p] = w \cdot E[r_{\text{US}}] + (1-w) E[r_{\text{intl}}]\,. \tag{2.2}$

We will characterize the riskiness of portfolios using either variance or standard deviation. The portfolio return variance is a measure of dispersion or riskiness in the return distribution for the portfolio. It is defined as the expected (squared) magnitude of deviations in the portfolio return from its expected value: $\text{var}[r_p] = E\big[(r_p-E[r_p])^2\big]. \tag{2.3}$ As shown in the callout box, we can write the portfolio variance in terms of the individual asset variances and their covariance: $w^2 \text{var}[r_{\text{US}}] + (1-w)^2 \text{var}[r_{\text{intl}}] + 2 w (1-w) \text{cov}[r_{\text{US}},r_{\text{intl}}]. \tag{2.4}$

To derive Equation 2.4, first rewrite the portfolio return and expected return on the right-hand side of Equation 2.3 using Equation 2.1 and Equation 2.2 and group terms. Portfolio variance thus equals $E\big[\left( w (r_{\text{US}} - E[r_{\text{US}}])+ (1-w) (r_{\text{intl}}-E[r_{\text{intl}}])\right)^2\big].$ Expanding the squared sum, we see that portfolio variance equals: \begin{align*} &w^2 E\big[(r_{\text{US}}- E[r_{\text{US}}])^2\big] \\ &+ (1-w)^2 E\big[(r_{\text{intl}}-E[r_{\text{intl}}])^2\big] \\ &+ 2 w (1-w) E\big[(r_{\text{US}} - E[r_{\text{US}}])(r_{\text{intl}}-E[r_{\text{intl}}])\big]. \end{align*} We arrive at Equation 2.4 by substituting in the definitions of variances of each asset and their covariance.

Alternatively, we can express portfolio variance in terms of the individual asset risks and their correlation $$\rho$$: $w^2 \text{var}[r_{\text{US}}] + (1-w)^2 \text{var}[r_{\text{intl}]} + 2 w (1-w) \rho \cdot \text{sd}[r_{\text{US}}]\text{sd}[r_{\text{intl}}] , \tag{2.5}$ where we used the fact that the covariance of two assets equals their correlation multiplied by the product of their standard deviations. The correlation between US stocks and stocks from developed international economies was about 75% over the last thirty years. Figure 2.1 plots the possible portfolios of the US and international stock funds. Investing in the US stock market fund alone is dominated by a combination of the two funds. It is possible to form a portfolio with less risk than investing 100% in the US fund. This is diversification in action. Moreover, these portfolios all have higher expected returns than does investing in the US fund alone.

Diversification benefits are greater when the assets are less correlated. This can be seen from visual inspection of Equation 2.5. The portfolio variance is lower for lower levels of the correlation between two assets. If two assets were perfectly negatively correlated, it would be possible to create a risk-free security; that is, we could diversify all risk from the portfolio. An interactive page with user inputs showing these effects is at the BBCX Investments Library.

Could we do better? Let’s consider adding another risky asset into the mix. In addition to US and developed international stocks, assume we also have access to an emerging market equity fund. The emerging market fund has higher expected return, but also higher risk than the other two funds. It also has a correlation of about 75% with each of the other two funds.

The return of a portfolio combining $$N$$ assets is simply the weighted average of the underlying asset returns: $r_p = \sum_{i=1}^{N} w_i r_i\,, \tag{2.6}$ where the weights $$\{w_i\}_{i=1}^N$$ are the fractions of capital invested in each asset. The expected return of the portfolio is the weighted sum of the expected returns of each asset: $E[r_p] = \sum_{i=1}^{N} w_i E[r_i]\,. \tag{2.7}$ Given an array of returns (either expected or realized returns) and an array of weights, the portfolio return can be calculated using matrix multiplication in numpy. Note the inputs below are decimal notation. Multiply by 100 to get percents.

import numpy as np

# Expected returns
mns = np.array([0.10, 0.05, 0.07])

# Portfolio weights
wgts = np.array([0.25, 0.5, 0.25])

#Portfolio expected return
port_expret = wgts @ mns

Following the same steps to derive Equation 2.4, the portfolio variance of a three asset portfolio is: \begin{align*} &w_1^2 \text{var}[r_1] + w_2^2 \text{var}[r_2] + w_3^2 \text{var}[r_3] \\ &+ 2 w_1 w_2 \text{cov}[r_1, r_2] \\ &+ 2 w_1 w_3 \text{cov}[r_1, r_3] \\ &+ 2 w_2 w_3 \text{cov}[r_2, r_3], \\ \end{align*} where $$w_i$$ is the portfolio weight in asset $$i$$.

Figure 2.2 shows the investment opportunity set of investing in portfolios of these three funds. Each of the blue dots represent a different possible combination of the three portfolios. The lines connecting pairs of the assets show all possible portfolios of investing just in those two assets. The diversification benefits of adding a third asset to any of the pairs of assets can be seen by the fact that many of the blue three-asset portfolios lie to the left of the two-asset frontiers. That is, adding a third asset can produce a portfolio with the same expected return but lower portfolio risk than can be achieved with just two assets.

For example, consider an investor targeting a 6.5% return, the assumed expected return of the domestic international portfolio. If the investor is restricted to hold only a single asset, they must hold the domestic international fund with risk of over 16% per year. If an investor can hold two assets, they could lower the amount of risk by holding a portfolio of the US stock fund and the emerging market fund and reduce the portfolio risk to below 16% per year. An additional diversification benefit is possible if the investor holds all three assets; an even lower standard deviation can be achieved for the same expected return.

2.3 Portfolios with Many Assets

Adding more securities to a portfolio results in additional diversification benefits, but the marginal benefit of an additional security decreases with the total number of securities in the portfolio. We discussed above that the diversification benefit in a two-asset case depends on the correlation between the two security returns. For portfolios of many assets, the portfolio variance depends more on the average correlation across securities than it does on the riskiness of the securities themselves.

The riskiness of an $$N$$-asset portfolio, as measured by the portfolio variance, is: $\text{var}[r_p] = \sum_{i=1}^{N} w_i^2 \text{var}[r_i] + 2 \sum_{i=1}^{N} \sum_{j>i} w_i w_j \text{cov}[r_i,r_j]\,, \tag{2.8}$ which can be derived in the same way as the two-asset variance in Equation 2.4, albeit with more algebra. Calculating each term in the last line of Equation 2.8 and adding them up can quickly become tedious. Given a covariance matrix $$V$$: $\begin{equation*} V = \begin{bmatrix} \text{var}[r_1] & \text{cov}[r_1,r_2] & \dots & \text{cov}[r_1,r_N] \\ \text{cov}[r_2,r_1] & \text{var}[r_2] & \dots & \text{cov}[r_2,r_N] \\ \vdots & \vdots & \ddots & \vdots \\ \text{cov}[r_N,r_1] & \text{cov}[r_N,r_2] & \dots & \text{var}[r_N] \\ \end{bmatrix} \end{equation*}$ and a vector of portfolio weights $w'=[w_1\, w_2\,...\,w_N]\,,$ we can calculate the portfolio variance as the matrix product $\text{var}[r_p] = w'Vw \,. \tag{2.9}$

Given an array of weights, calculating the portfolio variance in python is easy using matrix multiplication in numpy. Note the inputs below are decimal notation. Multiply the standard deviations and correlations by 100 to get percents. Two methods for creating a covariance matrix are demonstrated. The first demonstrates entry element-by-element, and the second more elegantly (and concisely) uses matrix multiplication using the array of standard deviations and the correlation matrix.

import numpy as np

##### Inputs
# Standard deviations
sds = np.array([0.20, 0.12, 0.15])

# Correlations
corr12 = 0.3
corr13 = 0.3
corr23 = 0.3

# Portfolio weights
wgts = np.array([0.25, 0.5, 0.25])

##### Method 1 to calculate covariance matrix
# Covariances
cov12 = corr12 * sds[0] * sds[1]
cov13 = corr13 * sds[0] * sds[2]
cov23 = corr23 * sds[1] * sds[2]
# Covariance matrix
cov = np.array([[sds[0]**2,  cov12,     cov13], \
[cov12,      sds[1]**2, cov23], \
[cov13,      cov23,     sds[2]**2]])

##### Method 2 to calculate covariance matrix
# Correlation matrix
C  = np.identity(3)
C[0, 1] = C[1, 0] = corr12
C[0, 2] = C[2, 0] = corr13
C[1, 2] = C[2, 1] = corr23
# Covariance matrix
cov = np.diag(sds) @ C @ np.diag(sds)

##### Portfolio risk measures
#Portfolio variance
port_var = wgts @ cov @ wgts

#Portfolio standard deviation
port_sd  = np.sqrt(port_var)

Average correlation across assets is important for the possible diversification benefits in large portfolios. This is due to the sheer number of terms in the portfolio variance calculation Equation 2.8 involving correlations (through the covariance terms). We can visualize each term of the portfolio variance in matrix form. For instance, the three-asset version of Equation 2.8 in matrix form is:

 $$w_1^2 \text{var}[r_1]$$ $$w_1 w_2 \text{cov}[r_1,r_2]$$ $$w_1 w_3 \text{cov}[r_1,r_3]$$ $$w_2 w_1 \text{cov}[r_2,r_1]$$ $$w_2^2 \text{var}[r_2]$$ $$w_2 w_3 \text{cov}[r_2,r_3]$$ $$w_3 w_1 \text{cov}[r_3,r_1]$$ $$w_3 w_2 \text{cov}[r_3,r_2]$$ $$w_3^2 \text{var}[r_3]$$
For the three-asset portfolio, there are 3 variance terms and 3 distinct covariance terms. For a five-asset portfolio, the tabular representation of Equation 2.8 is:
 $$w_1^2 \text{var}[r_1]$$ $$w_1 w_2 \text{cov}[r_1,r_2]$$ $$w_1 w_3 \text{cov}[r_1,r_3]$$ $$w_1 w_4 \text{cov}[r_1,r_4]$$ $$w_1 w_5 \text{cov}[r_1,r_5]$$ $$w_2 w_1 \text{cov}[r_2,r_1]$$ $$w_2^2 \text{var}[r_2]$$ $$w_2 w_3 \text{cov}[r_2,r_3]$$ $$w_2 w_4 \text{cov}[r_2,r_4]$$ $$w_2 w_5 \text{cov}[r_2,r_5]$$ $$w_3 w_1 \text{cov}[r_3,r_1]$$ $$w_3 w_2 \text{cov}[r_3,r_2]$$ $$w_3^2 \text{var}[r_3]$$ $$w_3 w_4 \text{cov}[r_3,r_4]$$ $$w_3 w_5 \text{cov}[r_3,r_5]$$ $$w_4 w_1 \text{cov}[r_4,r_1]$$ $$w_4 w_2 \text{cov}[r_4,r_2]$$ $$w_4 w_3 \text{cov}[r_4,r_3]$$ $$w_4^2 \text{var}[r_4]$$ $$w_4 w_5 \text{cov}[r_4,r_5]$$ $$w_5 w_1 \text{cov}[r_5,r_1]$$ $$w_5 w_2 \text{cov}[r_5,r_2]$$ $$w_5 w_3 \text{cov}[r_5,r_3]$$ $$w_5 w_4 \text{cov}[r_5,r_4]$$ $$w_5^2 \text{var}[r_5]$$

For the five-asset portfolio, there are 5 variance terms (along the diagonal) and 10 =((25-5)/2) distinct covariance terms. For an $$N$$ asset portfolio, there will be $$N$$ variance terms and $$\frac{N^2-N}{2}$$ distinct covariance terms. For portfolios with many assets, the number of covariance terms will quickly dwarf the number of variance terms.

To see how correlation across assets can dominate the riskiness of individual securities in portfolios with many assets, consider an equally-weighted ($$w_i=1/N$$ for all assets) portfolio where all assets have the same variance $$(\sigma^2_{\text{all}})$$ and all pairs of assets have the same covariance $$(\overline{\text{cov}})$$. The variance of this equal-weighted portfolio is the sum of the $$N$$ variance terms and $$N^2-N$$ covariance terms: $N\cdot \left(\frac{1}{N}\right)^2 \sigma^2_{\text{all}} + (N^2-N)\cdot \left(\frac{1}{N}\right)^2 \overline{\text{cov}}\,.$ Simplifying, the portfolio variance is: $\left(\frac{1}{N}\right) \sigma^2_{\text{all}} + \left(1-\frac{1}{N}\right) \overline{\text{cov}}\,.$ As the number of assets $$N$$ gets very large, the portfolio variance approaches the common covariance across assets: $\text{var}(r_p) \underset{N\rightarrow \infty}{\longrightarrow} 0\cdot\sigma^2_{\text{all}}+(1-0)\overline{\text{cov}}=\overline{\text{cov}}\,. \tag{2.10}$

Figure 2.3 plots the portfolio variance for this equally-weighted portfolio as a function of the number of assets for three correlation values. The figure demonstrates three insights. First, as discussed previously, the diversification benefit is greater for lower levels of correlation across assets (that is, lower $$\overline{\text{cov}}$$ here). Second, the marginal benefit of adding additional securities to a portfolio decreases with the number of securities. A large fraction of the overall risk reduction is due to the first 10 to 20 securities added to the portfolio. Third, there is a limit to risk reduction, and this limit is governed by the amount of common comovement across assets in the portfolio. $$\sigma_{\text{all}}$$ is assumed to be 40%, so Equation 2.10 tells us that the portfolio standard deviation approaches values of 12.6%, 20%, and 28.3%, respectively, for correlations of 10%, 25%, and 50% as the number of portfolio assets gets large.1 Figure 2.3 shows that for portfolios of 200 assets, the portfolio standard deviation is already quite close to these limiting standard deviations.

2.4 Short-Sales

So far, we have considered portfolios with nonnegative weights in each of the assets. Negative portfolio weights correspond to short positions in a portfolio. Short-selling involves borrowing a security from another owner and selling it. The short-seller then has a liability to return the security to the security lender; this liability is equal to the security’s market value. Short-sellers hope to purchase the security later for a lower price. Thus, they reverse the order of the investing maxim: buy low-sell high. Short-sellers hope to sell high-buy low. In practice, there are limitations on short selling: it may not be possible to use the proceeds from a short sale to buy other risky assets, less than full interest may be earned on the proceeds, and a fee must be paid to borrow the asset being shorted. In this section, we ignore those issues. We assume that proceeds from short sales are invested in the other risky assets.

Figure 2.4 shows the expected returns and risks of portfolios of the US stock fund and the developed international fund when shorting is allowed. Comparing to Figure 2.1 above, allowing shorting expands the investment opportunity set to include expected return values below the US equity expected return and above the developed international fund expected return.

2.5 The Efficient Frontier

With more than two risky assets, multiple portfolios can achieve the same expected return, but with different amounts of portfolio risk. This was seen above in Figure 2.2. All else equal, typical investors like expected return and dislike risk, so for a given expected return level, lower levels of portfolio standard deviation are preferred. For each level of expected return, we can find the portfolio that provides the highest possible diversification, that is, the lowest standard deviation. The set of these minimum-variance portfolios is called the frontier. The portfolio with the lowest standard deviation across all feasible expected returns is called the global minimum variance (GMV) portfolio. Portfolios that lie on the frontier with expected returns above those of the GMV portfolio are said to be efficient, and this portion of the frontier is called the efficient frontier. For the discussion below, we assume that short-sales are allowed. We will relax this assumption in a later chapter.

Mathematically, the GMV portfolio is the set of portfolio weights that minimizes portfolio variance without conditioning on the portfolio expected return: $\underset{w_1,w_2,\dots,w_N}{\text{min}} \text{var}[r_p] \tag{2.11}$ subject to the constraints $$\sum_i w_i=1$$.

If short sales are allowed, the GMV portfolio weights satisfy a system of equations. The vector of GMV portfolio weights $$w$$ has the same inner product with each column of the covariance matrix $$\text{cov}_i$$ ($$n-1$$ equations): $\frac{w'\text{cov}_i}{w'\text{cov}_j} = 1\,,$ and the portfolio is fully invested: $\sum_i w_i = 1.$

import numpy as np

##### Inputs
# Standard deviations
sds = np.array([0.20, 0.12, 0.15])
# Correlations
corr12 = 0.3
corr13 = 0.3
corr23 = 0.3
# Covariance matrix
C  = np.identity(3)
C[0, 1] = C[1, 0] = corr12
C[0, 2] = C[2, 0] = corr13
C[1, 2] = C[2, 1] = corr23
cov = np.diag(sds) @ C @ np.diag(sds)

##### Global Minimum Variance Portfolio
n = len(sds)
w = np.linalg.solve(cov, np.ones(n))
wgts_gmv = w / np.sum(w)

A frontier portfolio with expected return $$\mu_{\text{target}}$$ is defined by the portfolio weights that solve the following constrained optimization problem: $\underset{w_1,w_2,\dots,w_N}{\text{min}} \text{var}[r_p] \tag{2.12}$ subject to constraints: $$E[r_p]=\mu_{\text{target}}$$ and $$\sum_i w_i=1$$. To trace out the frontier, we solve the problem for a range of target expected returns.

Any two frontier portfolios can be combined to produce the entire frontier. The code below uses this two-fund spanning with two frontier portfolios (one of which is the GMV portfolio) to calculate points along the frontier.

import numpy as np
<!-- from cvxopt import matrix -->
<!-- from cvxopt.solvers import qp as Solver, options as SolverOptions -->

##### Inputs
# Expected returns
mns = np.array([0.10, 0.05, 0.07])
# Standard deviations
sds = np.array([0.20, 0.12, 0.15])
# Correlations
corr12 = 0.3
corr13 = 0.3
corr23 = 0.3
# Covariance matrix
C  = np.identity(3)
C[0, 1] = C[1, 0] = corr12
C[0, 2] = C[2, 0] = corr13
C[1, 2] = C[2, 1] = corr23
cov = np.diag(sds) @ C @ np.diag(sds)

##### Frontier Portfolios
def frontier(means, cov, target):
n = len(means)
w = np.linalg.solve(cov, np.ones(n))
wgts_gmv = w / np.sum(w)
w = np.linalg.solve(cov, means)
piMu = w / np.sum(w)
m1 = wgts_gmv @ means
m2 = piMu @ means
a = (target - m2) / (m1 - m2)
wgts = a * wgts_gmv + (1 - a) * piMu
return wgts
wgts_frontier = [frontier(mns, cov, m) for m in np.linspace(mns.min(), mns.max(),5)]

Figure 2.5 shows the frontier (without short sales) formed using the three equity funds. The GMV portfolio is the portfolio with the lowest standard deviation on the left-hand side of the frontier.

1. These limits are calculated using $$\text{sd}[r_p]=\sqrt{\overline{\text{cov}}}=\sqrt{\overline{\text{corr}}\sigma^2_{\text{all}}}$$.↩︎