Minimizing quadratic function subject to norm inequality constraint

前端 未结 2 1085
孤街浪徒
孤街浪徒 2021-01-07 07:31

I am trying to solve the following inequality constraint:

Given time-series data for N stocks, I am trying to construct a portfolio weight vector to minimize the var

2条回答
  •  爱一瞬间的悲伤
    2021-01-07 08:06

    This looks like a simple QP (Quadratic Programming) problem. It may be easier to use a QP solver instead of a general purpose NLP (NonLinear Programming) solver (no need for derivatives, functions etc.). R has a QP solver called quadprog. It is not totally trivial to setup a problem for quadprog, but here is a very similar portfolio example with complete R code to show how to solve this. It has the same objective (minimize risk), the same budget constraint and the lower and upper-bounds. The example just has an extra constraint that specifies a minimum required portfolio return.

    Actually I misread the question: the second constraint is ||x|| <= C. I think we can express the whole model as:

    This actually looks like a convex model. I could solve it with "big" solvers like Cplex,Gurobi and Mosek. These solvers support convex Quadratically Constrained problems. I also believe this can be formulated as a cone programming problem, opening up more possibilities.

    Here is an example where I use package cccp in R. cccp stands for Cone Constrained Convex Problems and is a port of CVXOPT.

提交回复
热议问题