Skip to content
All library documents

Minimum-Variance Portfolio Optimization with a Return Target

Article Quant Q&A · Author: s5s

Summary

The document sets up a portfolio problem that minimizes variance while constraining weights to sum to one and expected return to equal a chosen target. It describes applying Lagrange multipliers to express the portfolio weights using the expected-return vector, covariance matrix, and target return. The author applies the formulation to S&P 500 stocks and reports an unexpectedly high daily volatility for a portfolio targeting a 10% annualized return.

The calculation shown is not enough to validate that result. It estimates expected returns from sample means and uses a correlation matrix in place of a covariance matrix, which affects the scale and meaning of the variance unless returns have been appropriately standardized. The final volatility line also appears to take the square root of a variable different from the variance just calculated. No data period, return assumptions, weight constraints beyond full investment, or corrected result is supplied, so the reported figure should be treated as an unresolved implementation question rather than evidence about the true risk of such a portfolio.

Key ideas

  • The stated objective minimizes portfolio variance subject to a target expected return and fully invested weights.
  • Lagrange multipliers provide a closed-form route to the weights when the required matrix inputs are valid.
  • The example estimates expected returns from sample means for S&P 500 stocks.
  • Using a correlation matrix instead of a covariance matrix can distort variance calculations.
  • The displayed volatility calculation appears inconsistent with the variable holding the computed variance.

Tags

Full text
# Calculating the minimum variance portfolio given a desired expected return as a constraint


# Calculating the minimum variance portfolio given a desired expected return as a constraint












I'm replicating the equations in Cochrane 2005 using all the stocks in the S&P 500. I am questioning my results - I get that the daily volatility of a portfolio with a return of 10% (annualised) would have a daily vol of 21.5%. That looks very high to me.

My work is as follows. The book on page 82 and 83 describes building a minimum variance portfolio given a desired expected return $\mu$. So the problem can be formulated like this.

\begin{equation} \min_{\vec{w}} \vec{w}'\vec{\Sigma} \vec{w} \end{equation}

subject to

\begin{align} \vec{w}' \vec{E} &= \mu \\ \vec{w}' \vec{1} &= 1 \end{align}

where $\Sigma$ is the S&P 500 stocks correlation matrix, $E$ is their expected returns vecor. Using Lagrange multipliers, this can be written as below.

Now $\lambda$ and $\delta$ can be plugged into $w$ to get the weights.

I implemented the above like this:

```
E = spx_ret.mean()
S = (spx_ret-E).corr()
Si = inv(S)

mu = 0.1/252

ones = np.ones(Si.shape[0])

A = t(E) @ Si @ E 
B = t(E) @ Si @ ones
C = t(ones) @ Si @ ones

denom = (A*C-B**2)
L = (C*mu - B)/denom
d = (A-B*mu)/denom

w = Si @ (L * E + d * ones)
var = t(w) @ S @ w
vol = np.sqrt(vol)
vol
```

Now vol is ~ 0.215.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.