Skip to content
All library documents

Adding Factor and Position Limits to Markowitz Optimization

Article Quant Q&A · Author: Michael Clinton

Summary

The document asks how to extend mean-variance portfolio optimization with limits on factor exposures and individual positions. The objective is the familiar trade-off between expected return and variance, whose unconstrained solution depends on the inverse covariance matrix and expected returns. The proposed factor rules cap the absolute portfolio exposure to each factor; position bounds can be expressed in the same general constraint framework.

The answer recommends formulating the problem as a quadratic program with linear equality and inequality constraints. An absolute exposure cap becomes two inequalities: one bounding exposure from above and another bounding its negative. This keeps the constrained problem within standard quadratic optimization, which is commonly used for portfolios with such rules. The response gives the mathematical setup and transformation, but does not identify a solver, discuss runtime, or derive a closed-form solution. Practical speed and feasibility still depend on the problem size, constraint structure, and implementation.

Key ideas

  • Markowitz mean-variance optimization can be written as a quadratic program.
  • Linear equality and inequality constraints can encode portfolio rules.
  • An absolute factor exposure cap becomes a pair of opposite-sided linear inequalities.
  • Position limits can be represented as additional linear constraints.
  • The formulation does not itself guarantee a closed-form solution or a particular runtime.

Tags

Full text
# Markowitz portfolio with factor/position constraints


# Markowitz portfolio with factor/position constraints












General Markowitz-style optimization (problem objective of $w^T \mu - \lambda w^T \Sigma w$) yields simple optimal weights policy $w \propto \Sigma^{-1} \mu$.

However, I would like to add a series of factor exposure constraints (i.e. $| w^T \beta_i | < k_i$ for factors indexed by $i$, instrument exposure vector to $i^{th}$ factor by $\beta_i$). I may wish to extend to maximum position values as well, which is basically just another constraint with a different beta vector.

Is there a standard way do this quickly, closed form or similar, with the addition of these types of constraints? Or some common, clever transformations/relaxations that would help facilitate practical solutions under time constraints?

I've got to imagine this is a pretty solved problem, since many portfolios have these types of constraints. I'm just not sure if folks throw into an optimizer and don't care about very fast solutions/closed form solution explicitly. Or do something altogether different. Is there some industry standard or set of resources available to follow? Thanks!

## Answer by Kermittfrog (score 4, accepted)

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

Generally speaking, as long as we can accommodate the optimization using quadratic programming, we are still within the realm of Markowitz optimization:

$$ \begin{align} \min&\quad w^Tq+\frac{1}{2}w^TQw\\ \mathrm{s.t.}&\quad Aw=a\\ \mathrm{s.t.}&\quad Bw\leq b\\ \end{align} $$

In your case, $|w^T\beta_i|\leq k_i$ translates to two additional entries in $B$, i.e. $w^T\beta_i\leq k_i$ and $-w^T\beta_i\leq k_i$:

$$ \begin{pmatrix} \ldots & \ldots & \ldots & \ldots \\ \beta_{1i}&\beta_{2i}&\ldots&\beta_{ni}\\ -\beta_{1i}&-\beta_{2i}&\ldots&-\beta_{ni}\\ \ldots & \ldots & \ldots & \ldots \end{pmatrix}w \leq \begin{pmatrix}\ldots\\k_i\\k_i\\\ldots \end{pmatrix} $$

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.