Connecting Mean-Variance Portfolio Forms to Quadratic Programs
Summary
The document compares two common mean-variance formulations: minimizing variance for a target return and minimizing variance minus a weighted expected return. With an equality constraint on target return, Lagrange multipliers show how the return constraint’s multiplier can act as the return weight in the second formulation, up to sign. The response notes that straightforward formulations can trace equivalent efficient-frontier choices, while transaction costs, robust optimization, or other added features may change the relationship.
It also explains how to adapt a quadratic optimization problem to a solver’s conventions. The example solver uses a negative linear term and inequality constraints in the opposite direction from another standard form; sign changes convert the linear and inequality terms, while an equality can be represented as two inequalities. The discussion is conceptual and does not provide implementation code or cover solver-specific numerical limitations.
Key ideas
- A target-return constraint can be incorporated into a Lagrangian, with its multiplier corresponding to a return weight.
- The variance-minimization and risk-return formulations can represent the same choices under suitable constraints.
- Added features such as transaction costs or robust optimization can alter efficient-frontier equivalence.
- Quadratic-program solvers differ in sign and constraint conventions, so inputs must be transformed to match them.
- An equality constraint can be represented by a pair of opposite inequality constraints.
Tags
Full text
# Mean-variance portfolio & quadratic programming
# Mean-variance portfolio & quadratic programming
I am somewhat confused when it comes to modern portfolio theory, mean-variance portfolio optimization and its quadratic programming formulation.
### Issue 1: Formulation of mean-variance portfolio optimization
I learned that the mean-variance portfolio is given by the problem:
Minimize with respect to $\mathbf{x}$: $\mathbf{x}^T \mathbf{\Sigma}\mathbf{x}$
Subject to the constraints: $\mathbf{\mu}^T\mathbf{x} \geq r, \mathbf{1}^T\mathbf{x}=1 $
where $\mathbf{x}$ is the portfolio and $r$ is the target return
However, on Wikipedia I find that modern portfolio theory involves the following optimization problem:
Minimize with respect to $\mathbf{x}$: $\mathbf{x}^T \mathbf{\Sigma}\mathbf{x} - q\times\mathbf{\mu}^T\mathbf{x}$
Subject to the constraint: $\mathbf{1}^T\mathbf{x}=1 $
How are these two formulations identical?
### Issue 2: Form of quadratic programming problem
In most references (among other on Wikipedia) the quadratic programming problem is given by:
Minimize with respect to $\mathbf{x}$: $\frac{1}{2} \mathbf{x}^T Q\mathbf{x} + \mathbf{c}^T \mathbf{x}$
Subject to the constraints: $ A\mathbf{x} \leq \mathbf b, $ $ E\mathbf{x} = \mathbf d $
However, the R function quadprog::solve.QP solves the following problem:
Minimize with respect to $\mathbf{x}$: $\frac{1}{2} \mathbf{x}^T Q\mathbf{x} - \mathbf{g}^T \mathbf{x}$
Subject to the constraints: $ K\mathbf{x} \geq \mathbf m $
Note:
- the sign of c is opposite
- the inequality constraint is opposite
- the equality constraint is missing
How are these two identical? I can accept the sign change for $\mathbf c$ as cosmetic but the rest...
## Answer by John (score 6, accepted)
https://quant.stackexchange.com/a/10772
With respect to issue one, it can be simpler to consider the case where the constraint on the expected return is an equality. In that case, the first problem can be transformed to
Minimize with respect to $\left\{ x,\lambda_{1},\lambda_{2}\right\} $: $x'\Sigma x + \lambda_{1} (\mu'x - r) + \lambda_{2} (1'x - 1)$
by the technique of Lagrangian multipliers, while the second can be transformed to
Minimize with respect to $\left\{ x,\lambda_{2}\right\} $: $x'\Sigma x - q \mu'x + \lambda_{2} (1'x - 1)$
Thus, you could solve the first one and set $q \equiv -\lambda_{1}$ to effectively get the equivalent problem in the second. Since the $r$ is a constant, you can add it's term back in and it wouldn't have any impact on the final optimization (in the second, that is).
In my experience, one can easily switch between a maximize return, minimize risk, or maximize utility framework for simple portfolio optimization problems. However, if you incorporate transaction costs or perform robust optimization or some other sophisticated approach, the efficient frontiers might exhibit some differences. Ultimately, you have to make a decision about which to use (it is probably more common to minimize risk subject to constraints) and just do that consistently when constructing efficient frontiers or portfolio.
With respect to issue two, optimizers are often different in their specifications. You typically will have to adjust your problem to be in the form of whatever the optimizer is. For instance, multiplying your $c$ by $-1$, multiply $A$ and $b$ by -1 each, and adding additional inequality constraints to create equality constraints (because you can express one equality as two inequalities).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.