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!


1 Answer 1


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} $$

  • 1
    $\begingroup$ Adding to @Kermittfrog answer: a problem formulated in this way can be solve with standard optimization techniques. In particular, the presence of inqueality constraints call for the Karush-Kuhn-Tucker conditions $\endgroup$ Mar 17, 2022 at 18:43
  • $\begingroup$ Thanks @Matteo. I've also added a link to the wiki page. $\endgroup$ Mar 18, 2022 at 7:25
  • $\begingroup$ Thanks Kermittfrog & @Matteo! Seems inequality prevents any closed-form solutions & more performant methods; can't bypass QP solver and ~O(n^3) (?) time. Suspected so, but wanted to ensure nothing clever about how the problem might reduce or properties that might enable performant or more transparent solutions, especially for repeated computation (as all vectors, matrices are constant except mu). I intend to compute many times with these same inputs, so using a solver doesn't seem to leverage well, except initial guess perhaps. FWIW I intend to accept this answer shortly! $\endgroup$ Mar 21, 2022 at 21:06
  • 2
    $\begingroup$ To be honest: QP is insanely fast, I never had to worry about the performance so far $\endgroup$ Mar 21, 2022 at 22:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.