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
where is a vector of porfolio weights; is a vector of expected returns; and is a covariance matrix of returns. Often, we might place additional constraints on , 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
where is the correlation between the assets; is the variance of asset ; and is the covariance between assets and . The portfolio variance is
Now imagine that these two assets are perfectly correlated. Then , and the portfolio variance is
If we choose , then we have
And our expected return is
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 , and we just pick . Then our portfolio variance is again Equation , while our expected return is
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 ). With negatively correlated assets, we can capture all the expected return while hedging out our risk.
Generalizing this to assets is easy. Simply observe that the portfolio variance can be written as a sum:
When , the term is simply . These idiosyncratic variances cannot be eliminated here. But when , then the term is , and our reasoning from the two-asset case applies. In other words, with 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 and that the expected returns are and for the two assets. Using this function, I have plotted the optimizer’s proposed positions (weights) across a range of correlations (Figure , left).
We can see that when correlation is negative, we go long both assets. And when correlation 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 ) at each optimal portfolio (Figure , 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 and ). This picture would be complicated by negative expected returns, but the main ideas would not change.