Skip to content
All library documents

Closed-Form Minimum-Variance Portfolio with a Beta Constraint

Article Quant Q&A · Author: user25064

Summary

The document formulates portfolio construction as minimizing variance, measured by the quadratic form of portfolio weights and the asset covariance matrix, subject to a fully invested constraint and a target portfolio beta. Using Lagrange multipliers, the first-order conditions reduce the problem to a two-equation linear system for the multipliers. If the covariance matrix is invertible, its inverse gives the weights in terms of those multipliers; the budget and beta constraints determine their values. This provides a closed-form route under the stated assumptions, rather than requiring a general numerical optimizer.

A second answer proposes a different objective: minimize variance while penalizing exposure to absolute asset betas, with long-only weights. It suggests solving that modified quadratic program numerically, but supplies no usable code or comparative results. That alternative does not enforce a specified portfolio beta and should not be confused with the original constrained problem. The discussion gives no numerical example, and the closed-form derivation relies on covariance invertibility; practical implementations also depend on estimated inputs and any additional portfolio constraints.

Key ideas

  • The original problem minimizes portfolio variance while fixing total weight and portfolio beta.
  • With an invertible covariance matrix, the first-order conditions express weights through two Lagrange multipliers.
  • The investment and beta constraints yield a two-by-two linear system that determines the multipliers.
  • A separate proposal penalizes absolute asset betas in a long-only quadratic program, changing the original objective.

Tags

Full text
# Beta Constrained Markowitz Minimum Variance Portfolio - Closed Form Solution


# Beta Constrained Markowitz Minimum Variance Portfolio - Closed Form Solution












This question is related to recent rule changes in the Quantopian Open.

I am trying to figure out a closed form solution to a beta constrained minimum variance portfolio problem but it doesn't seem particularly tractable. Has anyone else tried this? So far, I have set up the problem

$$\begin{align} \min_w \quad& w^\prime \Sigma w \\ s.t. \quad& w^\prime\vec 1 = 1 \\ \text{and} \quad & w^\prime \beta = c \end{align}$$

where

- $w$ is the vector of portfolio weights, our control

- $\Sigma$ is the total covariance matrix

- $\beta$ is the vector of CAPM-type market betas

- $c$ a constant that the portfolio beta should be equal to

Changing constraints to Lagrange multipliers the objective becomes

$$\min_w \quad w^\prime\Sigma w - \lambda_1(w^\prime\vec 1 - 1) - \lambda_2(w^\prime\beta - c)$$

the first order conditions are

$$\begin{align} 0 &= 2w^\prime\Sigma - \lambda_1\vec 1 - \lambda_2 \beta\\ 1 &= w^\prime\vec 1\\ c &= w^\prime\beta \end{align}$$

I cannot seem to get the equations to work out nicely, perhaps no closed form solution exists but I wanted to check here and see if anyone could get something reasonable before I go to numerical optimization.

## Answer by Gordon (score 3, accepted)

https://quant.stackexchange.com/a/18162

Assuming that $\Sigma$ is invertible, then \begin{align} 2\omega' = \lambda_1\overrightarrow{1}'\Sigma^{-1}+\lambda_2\beta'\Sigma^{-1}. \end{align} We can then solve $\lambda_1$ and $\lambda_2$ from the system of equations \begin{align*} 2 &= \lambda_1\overrightarrow{1}'\Sigma^{-1}\overrightarrow{1}+\lambda_2\beta'\Sigma^{-1}\overrightarrow{1}\\ 2c &= \lambda_1\overrightarrow{1}'\Sigma^{-1}\beta+\lambda_2\beta'\Sigma^{-1}\beta. \end{align*} Consequently, $\omega$ can be obtained from the above equation.

## Answer by twiecki (score 1)

https://quant.stackexchange.com/a/19186

This is an interesting problem. I don't think the problem is set up correctly quite yet. I rewrote it slightly to correspond to how it's generally written as a quadratic program.

The optimization problem you write down fixes betas to be a certain value. That could make sense but instead I wondered if we could simply minimize beta across the portfolio while minimizing correlations. In that case, the optimization problem becomes:

\begin{align} \min_w \quad& w^\prime \Sigma w + w^\prime\lvert\beta\rvert\\ s.t. \quad& w^\prime\vec 1 = 1 \\ \text{and} \quad & w > 0 \end{align}

I don't think a closed-form solution exists to this problem. But it's quite easy (and fast) to solve this with a quadratic optimizer such as provided by `cvxopt`. Here is some example code:

``

```

```

As you can see, the highest betas receive very low weights.

We also wrote a blog post on this (and the code is a version from there) which you can find here: https://www.quantopian.com/posts/the-efficient-frontier-markowitz-portfolio-optimization-using-cvxopt-repost-cloning-of-nb-now-enabled

Disclaimer: I work at Quantopian.

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.