In (1) and (2) a portfolio optimization model was used as an example to illustrate a linear reformulation of a QP problem. The problem was stated as:
| \[ \bbox[lightcyan,10px,border:3px solid darkblue]{\begin{align} \min \>& \sum_t w_t^2\\ & w_t = \sum_i r’_{i,t} x_i\\ & \sum_i \mu_i x_i \ge R\\ & \sum_i x_i = 1\\ &x_i\ge 0\end{align}} \] |
Here we denote:
- \(x_i\) are the optimal (no short) positions (these are the decision variables),
- \(R\) is the minimum required portfolio return,
- \(r’_{i,t}=r’_{i,t}-\mu_i\) are the mean-adjusted (historic) returns
- \(w_t\) are intermediate variables
I received some questions about this model (how does it compare to a standard portfolio model? etc.). Hence this note.
The more familiar mean-variance model is:
| \[\bbox[lightcyan,10px,border:3px solid darkblue]{\begin{align} \min&\>x^TQx = \sum_{i,j} q_{i,j} x_i x_j \\ & \sum_i \mu_i x_i \ge R\\ & \sum_i x_i = 1\\ &x_i\ge 0\end{align}} \] |
Here \(Q\) is the variance-covariance matrix.
These models are essentially the same. Using the fact how \(Q\) could have been calculated:
| \[ q_{i,j} = \frac{1}{T} \sum_t (r_{i,t}-\mu_i)(r_{j,t}-\mu_j) \] |
we can write:
| \[\begin{align} \sum_{i,j} q_{i,j} x_i x_j &= \frac{1}{T}\sum_{i,j}\sum_t \left(r_{i,t}-\mu_i\right)\left(r_{j,t}-\mu_j\right) \\ &= \frac{1}{T} \sum_t \left(\sum_i r’_{i,t} x_i\right)\left(\sum_j r’_{j,t} x_j\right)\\ &=\frac{1}{T} \sum_t w_t^2 \end{align}\] |
I dropped the factor \(\frac{1}{T}\) from the model.
This means:
- These models are indeed identical
- We have implicitly proven that the covariance matrix is positive semi-definite as \(w_t^2\ge 0\)
- This formulation can be use to derive a linear alternative by replacing the objective \(\min \sum_t w_t^2\) by \(\min \sum_t |w_t|\) (just a different norm).
- The simpler quadratic form \(\sum_t w_t^2\) is often easier to solve
- When \(N>T\) (number of instruments is larger than the number of time periods – not so unusual as older returns are less interesting), we have less data in the model: \(Q\) is \(N \times N\) while \(r’_{i,t}\) is \(N \times T\). In this case we “invent” data when forming the covariance matrix.
Note that nowadays it is popular to solve these type of portfolio models as a conic problem (see (3)). Some solvers convert QP problems (and quadratically constrained problems) automatically in an equivalent conic form.
References
- QP as LP: piecewise linear functions, http://yetanothermathprogrammingconsultant.blogspot.com/2017/04/qp-as-lp-piecewise-linear-functions.html
- QP as LP: cutting planes, http://yetanothermathprogrammingconsultant.blogspot.com/2017/04/qp-as-lp-cutting-planes.html
- Erling D. Andersen, Joachim Dahl and Henrik A. Friberg, Markowitz portfolio optimization using MOSEK. MOSEK Technical report: TR-2009-2, http://docs.mosek.com/whitepapers/portfolio.pdf