Skip to content
All library documents

Nonlinear Market Impact Costs in Mean-Variance Optimization

Article Quant Q&A · Author: silencer

Summary

The document considers a mean-variance portfolio objective that subtracts a square-root trading cost based on the change from current holdings. It asks how to handle that term with a quadratic programming solver. The answer explains that a quadratic solver cannot represent the square-root cost as a quadratic objective, and that the resulting maximization is nonconvex.

The discussion distinguishes this problem from standard mean-variance optimization, which is convex under the usual assumptions and can be solved efficiently. A general nonlinear optimizer may find a local solution, but that does not guarantee a global optimum. The document offers no numerical example or solver procedure; its main lesson is to check the cost function’s curvature before choosing an optimization method. Its warning applies to the stated square-root cost and does not establish that every nonlinear impact model is nonconvex.

Key ideas

  • A square-root cost on changes in holdings cannot be represented directly in a quadratic programming objective.
  • The stated objective is nonconvex, so standard convex optimization guarantees do not apply.
  • A general nonlinear solver may return a local optimum rather than a global one.
  • The curvature of the trading cost affects both problem difficulty and solver choice.

Tags

Full text
# Portfolio optimization with non-linear cost


# Portfolio optimization with non-linear cost












I am trying to solve a mean-variance problem with a non-linear market impact cost term in there. This is the problem I am trying to solve

$$ \max_x \left ( \alpha x - \gamma x' \Sigma x - a\sqrt{|x-x_0|} \right ) \quad s.t. \quad \text{unconstrained}.$$

where, $x_0$ is the current portfolio holding.

I am using MATLAB's quadprog program to solve this problem. How can I setup my optimization problem correctly to incorporate the sqrt term in the objective ? I am sure there is a way to do this, but I am not aware of it.

## Answer by Matthew Gunn (score 2)

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

You're not going to be able to solve it with quadprog because $-x^2 - \sqrt{|x|}$ can't be represented as a quadratic function.

If your trading cost were convex, it would still be a trivial problem, but your trading cost isn't convex!

While the original problem, $\max_\mathbf{x} \mathbf{a} \cdot \mathbf{x} - \gamma \mathbf{x}'\Sigma \mathbf{x}$ is a convex optimization problem (and convex problems can, in general, be efficiently solved), your problem isn't convex. Your objective for maximization is a sum of a concave and a quasi-convex. You can try using fmincon, but be aware it may give you local rather than global optima. There's reasonable stuff you can do, but it's not a trivial problem to find a global solution.

Side note: why are convex problems easier? For a convex function, a sub-gradient evaluated locally has global implications: you get a global lower bound.

#### Example:

Notice the local optima.

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.