The Conic Optimization Solver
Example 11.1 Portfolio Optimization
This example is shown as a quadratic programming problem in Example 18.2: Portfolio Optimization in Chapter 18, The Quadratic Programming Solver. It is included here to show how to transform a QP problem into an SOCP problem.
Consider a portfolio optimization example. The two competing goals of investment are (1) long-term growth of capital and (2) low risk. A good portfolio grows steadily without wild fluctuations in value. The Markowitz model is an optimization model for balancing the return and risk of a portfolio. The decision variables are the amounts that are invested in each asset. The objective is to minimize the variance of the portfolio’s total return, subject to the constraints that (1) the expected growth of the portfolio reaches at least some target level and (2) you do not invest more capital than you have.
Let be the amount that is invested in each asset,
be the amount of capital that you have,
be the random vector of asset returns over some period, and
be the expected value of
. Let G be the minimum growth that you hope to obtain and
be the covariance matrix of
. The objective function is
, which can be equivalently denoted as
.
Assume, for example, n = 4. Let = 10,000, G = 1,000,
, and
The QP formulation can be written as
Because the covariance matrix is positive semidefinite, there exists a matrix
such that
There are some practical ways to decompose a positive semidefinite matrix. For example, if you apply Cholesky decomposition, then
Then the objective becomes to minimize
By introducing one auxiliary variable, you can write the portfolio optimization problem in the following SOCP formulation:
Use the following SAS statements to solve the problem:
/* example 1: portfolio optimization */
proc optmodel;
/* let x1, x2, x3, x4 be the amount invested in each asset */
/* x5 is the auxiliary variable introduced for SOCP formulation */
var x{1..5} >= 0;
num r{1..4}=[0.05 -.20 0.15 0.30];
/* objective function is the auxiliary variable */
minimize f = x[5];
/* subject to the following constraints */
con BUDGET: sum{i in 1..4}x[i] <= 10000;
con GROWTH: sum{i in 1..4}r[i]*x[i] >= 1000;
/* second-order cone constraint to
minimize the variance of the portfolio's total return */
con cone: soc(x[5],
(0.2828427*x[1] - 0.1767767*x[2] - 0.1767767*x[3] - 0.17677670*x[4])
(0.3588175*x[2] - 0.1428303*x[3] - 0.14283027*x[4])
(0.5462138*x[3] + 0.01528617*x[4])
(0.54599986*x[4])
);
solve with conic;
/* print the optimal solution */
print x;
quit;
The output and optimal solution are displayed in Output 11.1.1.
Output 11.1.1: Portfolio Optimization
| Problem Summary | |
|---|---|
| Objective Sense | Minimization |
| Objective Function | f |
| Objective Type | Linear |
| Number of Variables | 5 |
| Bounded Above | 0 |
| Bounded Below | 5 |
| Bounded Below and Above | 0 |
| Free | 0 |
| Fixed | 0 |
| Number of Constraints | 3 |
| Linear LE (<=) | 1 |
| Linear EQ (=) | 0 |
| Linear GE (>=) | 1 |
| Linear Range | 0 |
| Second-Order Cone | 1 |
| Solution Summary | |
|---|---|
| Solver | Conic |
| Algorithm | Interior Point |
| Objective Function | f |
| Solution Status | Optimal |
| Objective Value | 1494.0927851 |
| Primal Infeasibility | 6.2712091E-9 |
| Dual Infeasibility | 2.923827E-9 |
| Bound Infeasibility | 0 |
| Duality Gap | 3.5817563E-7 |
| Complementarity | 2.7568982E-7 |
| Iterations | 9 |
| Presolve Time | 0.00 |
| Solution Time | 0.00 |
| [1] | x |
|---|---|
| 1 | 3452.6 |
| 2 | 0.0 |
| 3 | 1068.8 |
| 4 | 2223.5 |
| 5 | 1494.1 |
Compared with the QP formulation, the optimal solution that you obtain from solving the SOCP formulation is exactly the same, whereas the optimal objective function value is the square root.