Correlation and Hedging

A mean–variance optimizer will hedge correlated assets. I explain why and then work through a simple example.

A mean–variance optimizer will hedge correlated assets. To see this, recall that the objective function of a mean–variance optimizer is

w=arg ⁣maxw{rwwTΣw},(1) \mathbf{w}^{\star} = \arg\!\max_{\mathbf{w}} \left\{ \mathbf{r}^{\top} \mathbf{w} - \mathbf{w}^T \boldsymbol{\Sigma} \mathbf{w} \right\}, \tag{1}

where w\mathbf{w} is a vector of porfolio weights; r\mathbf{r} is a vector of expected returns; and Σ\boldsymbol{\Sigma} is a covariance matrix of returns. Often, we might place additional constraints on w\mathbf{w}, such as position limits, but that is not particularly interesting here. So in words, we want to find the optimal positions such that we maximize our portfolio’s return while minimize its variance. See my post on mean–variance analysis for a deeper discussion of this framing.

Now consider the two-asset case. The covariance matrix is

Σ=[σ12ρσ1,2ρσ2,1σ22],(2) \boldsymbol{\Sigma} = \begin{bmatrix} \sigma_1^2 & \rho \sigma_{1,2} \\ \rho \sigma_{2,1} & \sigma_2^2 \end{bmatrix}, \tag{2}

where ρ\rho is the correlation between the assets; σi2\sigma_i^2 is the variance of asset ii; and σi,j\sigma_{i,j} is the covariance between assets ii and jj. The portfolio variance σp2\sigma_p^2 is

σp2=wΣw=w12σ12+w22σ22+2w1w2ρσ1,2.(3) \begin{aligned} \sigma_p^2= \mathbf{w}^{\top} \boldsymbol{\Sigma} \mathbf{w}= w_1^2 \sigma_1^2 + w_2^2 \sigma_2^2 + 2 w_1 w_2 \rho \sigma_{1,2}. \tag{3} \end{aligned}

Now imagine that these two assets are perfectly correlated. Then ρ=1\rho = 1, and the portfolio variance is

σp2=w12σ12+w22σ22+2w1w2σ1,2.(4) \sigma_p^2 = w_1^2 \sigma_1^2 + w_2^2 \sigma_2^2 + 2 w_1 w_2 \sigma_{1,2}. \tag{4}

If we choose w1=w2w_1 = -w_2, then we have

σp2=w12σ12+w12σ222w12σ1,2=w12(σ12+σ222σ1,2).(5) \begin{aligned} \sigma_p^2 &= w_1^2 \sigma_1^2 + w_1^2 \sigma_2^2 - 2 w_1^2 \sigma_{1,2} \\ &= w_1^2 \left(\sigma_1^2 + \sigma_2^2 - 2 \sigma_{1,2} \right). \end{aligned} \tag{5}

And our expected return is

w1(r1r2),(6) w_1 (r_1 - r_2), \tag{6}

Clearly, this position may reduce our portfolio variance dramatically, and this works because we took an opposite position in the two positively correlated assets. This makes intuitive sense. If two assets are perfectly correlated, then they are the same asset in some sense, just scaled by their respective idiosyncratic variances. So we can hedge them against each other, with a net long positions in the asset with higher expected return.

And what if the two assets are perfectly anti-correlated? Then ρ=1\rho = -1, and we just pick w1=w2w_1 = w_2. Then our portfolio variance is again Equation 66, while our expected return is

w1(r1+r2).(7) w_1 (r_1 + r_2). \tag{7}

Notice that negatively correlated assets are even better than correlated assets! With correlated assets, we can hedge out our risk, but we drive down our expected return (Equation 66). With negatively correlated assets, we can capture all the expected return while hedging out our risk.

Generalizing this to nn assets is easy. Simply observe that the portfolio variance can be written as a sum:

σp2=wΣw=i=1nj=1nwiwjρi,jσi,j.(8) \sigma_p^2 = \mathbf{w}^{\top} \boldsymbol{\Sigma} \mathbf{w}= \sum_{i=1}^n \sum_{j=1}^n w_i w_j \rho_{i,j}\sigma_{i,j}. \tag{8}

When i=ji=j, the term is simply wi2σi2w_i^2 \sigma_i^2. These idiosyncratic variances cannot be eliminated here. But when iji \neq j, then the term is wiwjρi,jσi,jw_i w_j \rho_{i,j} \sigma_{i,j}, and our reasoning from the two-asset case applies. In other words, with nn assets, the portfolio’s variance dceomposes into a sum of idiosyncratic and cross terms, and we can simply apply our reasoning from the two-asset case to each term.

Finally, we can demonstrate these ideas with a simple example. Consider the function below, which computes the optimal portfolio weights for two assets and a given correlation using a toy mean–variance optimizer.

import numpy as np
from scipy.optimize import minimize

def optimize(corr):
    """Return optimal two-asset portfolio weights for a given correlation.
    """
    cov = np.array([[1, corr], [corr, 1]])
    mean = np.array([1, 0.1])
    resp = minimize(
        fun=lambda x: -(x.T @ mean) + (x.T @ cov @ x),
        x0=[0.5, 0.5]
    )
    return resp.x

To make things simple, I assume that σ1=σ2=1\sigma_1 = \sigma_2 = 1 and that the expected returns are 11 and 0.10.1 for the two assets. Using this function, I have plotted the optimizer’s proposed positions (weights) across a range of correlations (Figure 11, left).

Figure 1. Left subplot. A mean–variance optimizer's proposed portfolio weights w1w_1 and w2w_2 as a function of the correlation ρ\rho between two assets. The first asset has an expected return of 11, while the second asset has an expected return of 0.10.1. Both assets of have a volatility of one. Right subplot. The optimizer's utility (Equation 11) given the optimal portfolio weights in the left subplot.

We can see that when correlation ρ\rho is negative, we go long both assets. And when correlation ρ\rho is positive, we take a long position in the asset with the higher expected return, and we then hedge via a short position in the other asset.

I have also plotted the optimizer’s utility (Equation 11) at each optimal portfolio (Figure 11, right). From the optimizer’s perspective, two positively correlated assets have less utility than two negatively correlated assets, assuming each asset has a positive expected return (Equations 66 and 77). This picture would be complicated by negative expected returns, but the main ideas would not change.