Portfolios and linear programming 3

From UBC Wiki

Toy Model

For the toy model we will use the portfolio example from Chapter 5: Modelling with linear programming.

Stocks Return(%) Risk
MARCH Holdings 8 0
MAY Resources 10 6
June Automotive 14 10

The portfolio has a total of $250,000. The goal is to allocate the money in the above categories so as to:

  1. The average risk factor should be no greater than 5.
  2. At least one fourth of the total portfolio is allocated to March Holdings.
  3. At least one fourth of the total portfolio is allocated to May Resources.
  4. Maximize returns based on above constraints

Writing the Toy Model as a linear programming problem

Optimization equation:

Constraints:

First Dictionary:

Last Dictionary:

   LINDO OUTPUT:
   OBJ COEFFICIENT RANGES
 VARIABLE         CURRENT        ALLOWABLE        ALLOWABLE
                  COEF          INCREASE         DECREASE
      X1        8.000000         6.000000         4.000000
      X2       10.000000         1.600000         INFINITY
      X3       14.000000         INFINITY         2.666667
                          RIGHTHAND SIDE RANGES
     ROW         CURRENT        ALLOWABLE        ALLOWABLE
                   RHS          INCREASE         DECREASE
       2   250000.000000         INFINITY     75000.000000
       3        0.000000    375000.000000    875000.000000
       4   -62500.000000         INFINITY     37500.000000
       5   -62500.000000     62500.000000     93750.000000


The Dual Problem

Dual Problem:

Minimize

s.t.


last dictionary:


Then the optimal value is 2650000, and And the dual solution matches the primal solution


   LINDO OUTPUT:
   RANGES IN WHICH THE BASIS IS UNCHANGED:
                          OBJ COEFFICIENT RANGES
VARIABLE         CURRENT        ALLOWABLE        ALLOWABLE
                  COEF          INCREASE         DECREASE
      X1  -250000.000000     75000.000000         INFINITY
      X3    62500.000000     37500.000000         INFINITY
      X4    62500.000000     93750.000000     62500.000000
      X2        0.000000    875000.000000    375000.000000
                          RIGHTHAND SIDE RANGES
     ROW         CURRENT        ALLOWABLE        ALLOWABLE
                   RHS          INCREASE         DECREASE
       2       -8.000000         4.000000         6.000000
       3      -10.000000         INFINITY         1.600000
       4      -14.000000         2.666667         INFINITY

Interpretation of the solution

From the last dictionary we conclude that the optimal portfolio should consist of $100,000 in March Holdings, $62,500 in May Resources, and $87,500 in June Automotive. The optimal return is 2,650,000/250,000 which is 10.6%, at the maximum risk level of 5. From the sensitivity analysis, we can see that X1 and X2 are allowed to be increased by 6 and 1.6 respectively without changing the composition of our portfolio. For the RHS range, X5 and X7 are allowed to be increased by 375000 and 62500 respectively without changing the optimal solution for the dual problem.

The Dual's objective function is the From the LINDO output we can see that the sensitivity analysis for the decision variables in the primal matches the allowable range for the RHS of the constraints in the dual, and the converse is also true.

The constraint output information includes dual prices. For example, the dual price for the first constraint is 11. This means that if $250,000 could be raised to $250,001, the objective function would increase by 11. Also, note the third constraint shows no reduced cost - that is because there is slack of $62,500 in this constraint so we would not want to raise the upper bound from $62,500 to $62,501 since we aren't investing in this optimal solution.

The objective function ranges give us the sensitivity analysis for the objective function coefficients. For example, the current solution of X1=$100,000, X2=$62,500 and X3=$87,500 remains the optimal solution as long as X1's return remains between 4 and 14, X2's return remains below 11.6 and X3 remains above 11.3.

The right hand side ranges give us the sensitivity analysis for the constraint equations. Essentially, as long as the right hand side values remain within the lower and upper limits shown, the dual prices are constant and may be interpreted.

Compute the actual solution

Selection of Stocks

Variable Stock Name Yield Risk Volatility
ABF Hong Kong Bond ETF 6.93% 3 9.77
ABF Pan Asia Bond Index 7.45% 1 8.90
ABF Singapore Bond Index 5.89% 5 10.21
AdvisorShares Global Echo ETF 7.27% 3 7.79
AdvisorShares Madrona Domestic ETF 10.88% 5 9.30
AdvisorShares Peritus High Yield ETF 11.06% 5 8.98
AlphaClone Alternative Alpha ETF 15.81% 5 11.95
ALPS Equal Sector Weight ETF 9.08% 2 8.13
Amundi ETF CAC 40 C 16.51% 3 11.65
Arrow Dow Jones Global Yield ETF 8.78% 5 10.41
Barclays ETF S&P VEQTOR 2.60% 3 8.29
BLDRS Asia 50 ADR ETF 16.90% 4 9.87
BMO Canadian Divident ETF -1.66% 3 9.46
BMO China Equity ETF 24.82% 3 13.60
BMO equal weight REITs ETF 2.66% 2 12.10

Objective Function:

   

Constraints:

   1.    
          We set the the average risk level to be no greater than 3.
   
   2.    
          To diversify risks, we set the the maximum percentage of the portfolio invested in a single fund to 20%.
   
   3.    
          The total investment adds up to 100%.
   4.    
          We set the average volatility of the portfolio to be no greater than 10.

Solutions

 Global optimal solution found.
 Objective value:                              14.35916
 Infeasibilities:                              0.000000
 Total solver iterations:                             5
 Elapsed runtime seconds:                          0.11
 Model Class:                                        LP
 Total variables:                     15
 Nonlinear variables:                  0
 Integer variables:                    0
 Total constraints:                   19
 Nonlinear constraints:                0
 Total nonzeros:                      69
 Nonlinear nonzeros:                   0


                               Variable           Value        Reduced Cost
                                     X1        0.000000            4.547011
                                     X2       0.3837638E-01        0.000000
                                     X3        0.000000            8.462860
                                     X4       0.2000000            0.000000
                                     X5        0.000000           0.1877214
                                     X6       0.3837638E-01        0.000000
                                     X7        0.000000            3.201052
                                     X8       0.2000000            0.000000
                                     X9       0.1232472            0.000000
                                    X10        0.000000            6.108284
                                    X11        0.000000            4.914871
                                    X12       0.2000000            0.000000
                                    X13        0.000000            12.30710
                                    X14       0.2000000            0.000000
                                    X15        0.000000            14.20575
                                    Row    Slack or Surplus      Dual Price
                                      1        14.35916            1.000000
                                      2        0.000000           0.8489576
                                      3       0.2000000            0.000000
                                      4       0.1616236            0.000000
                                      5       0.2000000            0.000000
                                      6        0.000000            1.093690
                                      7       0.2000000            0.000000
                                      8       0.1616236            0.000000
                                      9       0.2000000            0.000000
                                     10        0.000000            2.842426
                                     11       0.7675277E-01        0.000000
                                     12       0.2000000            0.000000
                                     13       0.2000000            0.000000
                                     14        0.000000            4.306319
                                     15       0.2000000            0.000000
                                     16        0.000000            3.089613
                                     17       0.2000000            0.000000
                                     18        0.000000            12.09275
                                     19        0.000000            2.677122