Convex Quadratic Portfolio Optimization with Absolute Trading Costs
Summary
The document formulates a portfolio rebalancing problem with quadratic risk, expected-return benefits, proportional transaction costs based on absolute weight changes, and constraints on weights, turnover, concentration, and beta. It asks how to express the problem as a convex quadratic program suitable for a standard optimizer. The proposed reformulation splits each weight change into nonnegative purchase and sale variables, whose difference gives the net rebalance and whose sum represents absolute trading volume.
With those variables, the quadratic risk term remains quadratic and the transaction costs become linear. The turnover and per-asset trading limits also become linear constraints, as does the beta condition. The variables can be stacked into a single optimization vector. Convexity requires the covariance matrix to be positive semidefinite and the remaining constraints to be affine. The document develops the setup but does not supply a complete solver-ready matrix formulation; the split variables can also be non-unique when both sides are positive unless positive trading costs make such overlap suboptimal.
Key ideas
- Represent each net weight change as the difference between nonnegative purchase and sale variables.
- The sum of purchase and sale variables models absolute trading volume and makes proportional costs linear.
- Quadratic portfolio risk remains quadratic after substituting the split-variable representation.
- Turnover, concentration, budget, and beta restrictions can be written as affine constraints.
- A convex quadratic program requires a positive semidefinite covariance matrix and compatible affine constraints.
Tags
Full text
# Transform this non-linear portfolio optimization problem into a quadratic optimization problem
# Transform this non-linear portfolio optimization problem into a quadratic optimization problem
I have a portfolio optimization problem similar to this question here, with a V-shape transaction costs such that we pay a fee proportionally to the sum of absolute rebalancing: $$TC(\omega) = \frac{1}{2} |\omega-\omega_\text{old}|' \cdot \gamma$$ where $$\omega : \text{target portfolio to optimize},$$ $$\omega_\text{old} : \text{initial portfolio},$$ $$\gamma : \text{vector of average bid-ask spread}.$$
Essentially, my problem can be written as
$$ \omega_{opt} = \arg\min {\lambda \omega'\Sigma\omega + TC(\omega) - \omega'\alpha } \\ \text{ s.t. }\omega_{i} \in [0,1], \forall i \text{ (no short-sell)}\\ \sum_{i=1}^n \omega_i = 1, \\ \sum_{i=1}^n |\omega_i - \omega_{\text{old,i}}| \leq 0.5 \text{ (turnover constraint)}, \\ |\omega_i - \omega_{\text{old,i}}| \leq 0.1, \forall i \text{ (concentration constraint)}, \\ \beta = \omega' \Sigma \omega_{old}/\sigma^2 = 1 \text{ (beta constraint)}$$
I managed to solve this using `scipy.minimize` in `python`, but it is not really "clean".
My question is: can I transform this into a quadratic / convex optimization problem such that I can then use `cvxopt` to implement the solution?
My guess was to introduce some new variables $p$ and $q$ such that the $TC$ part becomes equivalent to:
$$\frac{1}{2} (p+q)' \cdot \gamma$$
s.t.
$$ p_i, q_i \geq 0, \forall i \\ \omega - \omega_{old} = p - q$$
such that the absolute term disappears, but then I end up with 3 times more unknowns: $\omega, p$ and $q$. Then I don't know if this is possible to reformulate that problem into a convex quadratic program of the form:
$$ \text{minimize } \frac{1}{2} x'Px+ c'x \\ \text{ s.t. }G x \leq h\\ Ax = b \\$$ with $P$ positive semi-definite and feed it into the convex optimizer.
EDIT: I have reformulated the objective function with the change of variables using $p$ and $q$ to get:
$$\omega - \omega_{old} = p - q \rightarrow \omega = \omega_{old} + p - q \\ \Rightarrow \lambda \omega'\Sigma\omega + TC(\omega) - \omega'\alpha = \lambda (\omega_{old} + p - q)'\Sigma(\omega_{old} + p - q) + \frac{1}{2} (p+q)'\gamma - (\omega_{old} + p - q)'\alpha \\ = \lambda (\omega_{old} + p - q)'\Sigma(\omega_{old} + p - q) + \frac{1}{2} (p+q)'\gamma - (p - q)'\alpha$$
where in the last line I removed the constant term $-\omega_{old}'\alpha$,
s.t.
$$p_i, q_i \geq 0, \forall i \\ \omega - \omega_{old} = p - q \\ \omega_{old,i} + p_i - q_i \in [0,1], \forall i \text{ (no short-sell)}\\ \sum_{i=1}^n (\omega_{old,i} + p_i - q_i) = 1, \\ \sum_{i=1}^n (p_i+q_i) \leq 0.5 \text{ (turnover constraint)}, \\ (p_i+q_i) \leq 0.1, \forall i \text{ (concentration constraint)}, \\ \beta = (\omega_{old} + p - q)' \Sigma \omega_{old}/\sigma^2 = 1 \text{ (beta constraint)}$$
The latter expression is close to the expected canonical form $\frac{1}{2} x'Px+ c'x$.
It also turns out that $\omega_{old}' \Sigma \omega_{old}/\sigma^2 = 1$, so the latter constraint would translate into $(p - q)' \Sigma \omega_{old}/\sigma^2 = 0$.
But then what? Do I need to do another change of variable or do I need to solve for $p$ and $q$, and in this latter case how? Do I need to stack up $p$ and $q$ in a vector $x$ of size $2n$, with $n$ being the number of assets (and also the dimension of $\omega$)?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.