Skip to content
All library documents

Rewriting a Portfolio Risk Constraint as a Quadratic Inequality

Article Quant Q&A · Author: user19265

Summary

The document considers a portfolio optimization problem with a fully invested constraint and a risk-adjusted return constraint involving the square root of portfolio variance. It describes converting that square-root expression into a quadratic form, which can fit the constraint format accepted by a quadratic optimization solver.

The proposed algebra first isolates the square-root term and then squares both sides, producing a quadratic inequality involving expected returns, the covariance matrix, and the threshold. This can make the formulation easier to enter in a solver such as Gurobi. However, squaring an inequality is only equivalent when the signs of both sides are appropriately constrained; the exchange does not discuss conditions such as a nonnegative right-hand side. The resulting formulation should therefore be checked for equivalence before use.

Key ideas

  • The risk-adjusted return constraint contains the square root of portfolio variance.
  • Algebraic rearrangement and squaring can express the constraint as a quadratic inequality.
  • The covariance matrix represents portfolio variance in the original constraint.
  • Squaring requires sign conditions to preserve equivalence, which the exchange does not address.

Tags

Full text
# Dealing with a constraint which is the square root of a quadratic form


# Dealing with a constraint which is the square root of a quadratic form












I'm trying to maximize my portfolio, but don't know how to deal with the constraint which is on the form

max $2u^Tx-x^T \Sigma x$

Subject to

$e^Tx = 1$

$u^Tx - m (x^T \Sigma x)^{1/2} >= c $

Where $\Sigma$ is the covariance and psd matrix and $u$ is the expected return. $e^T$ is a vector consisting of ones (1,...,1). $m$ and $c$ are constants

I don't know how to deal with the square root. (I'm using R)

Cheers

## Answer by Mark Joshi (score 1, accepted)

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

$$u^Tx - m (x^T \Sigma x)^{1/2} \geq c$$ is the same as $$u^Tx-c \geq m (x^T \Sigma x)^{1/2} $$

which is the same as $$(u^Tx-c)^2 \geq m (x^T \Sigma x)$$

This has no square roots.

## Answer by user19265 (score 0)

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

I thought of that at first but I was confused how to reformulate.

$(u^T x)^2 + 2 c u^Tx - c^2$

but it's the same as

$x^T (u \times u^T) x + 2 c u^Tx - c^2$

and now it's solvable. I'm using gurobi and so it needs the constraints on the form

$x^T Q x + u^Tx >= c$

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.