You are on page 1of 4

IEOR E4007 December 10, 2021

G. Iyengar

Homework # 8

1. Active set method for mean-variance portfolio Total points: 40


Consider the following three asset portfolio selection problem
 
3.0 0.5 0.5
max 2 2 −1 x − x> 0.5 3.0 0.5 x
 
| {z }
µ̂
0.5 0.5 3.0
| {z }
  Q
subject to 1 1 1 x = 1
x≥0

(a) What would be the sign of the dual variables corresponding to the inequality con- [5]
straints x ≥ 0? Note that this is a maximization problem.
Solution: ≥ is a bizarre constraint for a maximization problem; therefore, the
dual variable should ≤ 0.

(b) x(0) = 13 1 is a feasible point for this QP. Construct the equality constrained QP [10]
where you only keep the constraints tight at the point x(0) . Rewrite the QP in
terms of the deviation y = x − x(0) , and solve for the y ∗ and the dual variables
corresponding to the tight constraints at x(0) .
Solution: See the solutions code HW8sols.ipynb. From the code, we get:
y = [ 0.2 0.2 -0.4]
u = [-1.66666667]
(c) The y ∗ that you computed in (b) is not equal to zero, i.e. x(0) is not a critical point [10]
of its active set. Compute the step length λ and the new iterate x(1) .
Solution: From the solution code, we get:
 
0.5
λ = 0.8333333333333334, x(1) = 0.5

0

(d) Repeat (b) for x(1) . If your computations work out right, you will find that y ∗ = 0, [10]
i.e. x(1) is a critical point for its active set. Show that x(1) is a critical point for the
original QP. Is it optimal for the original QP?

1
Solution: The dual variable of the inequality constraint x3 ≥ 0 that is tight at
the current iterate is −0.5. Therefore, the current point is a KKT point for the
inequality constrained QP.
Since Q  0, the problem is convex, and has a finite optimal value. Furthermore,
x(0) is a strictly feasible point. Therefore, it follows that any KKT point is a global
optimal point; furthermore, all global optima are KKT points.

(e) Suppose we were to introduce a risk-free asset in the market and relax the portfolio [5]
constraint to 1> x ≤ 1. Would the point that you computed in part (d) still remain
optimal?
Solution: The dual variable for the constraint 1> x = 1 is u = −1.5. This does
not have the correct sign. Therefore, point x(1) will not be optimal if the constraint
is relaxed to 1> x ≤ 1.

2. Utility maximization with multiple scenario 10


Total points: [10]
The python notebook MultiScenario.ipynb computes the efficient frontier for the op-
timization problem
min max1≤k≤m kVk xk2 ,
s.t. min1≤k≤m µ>
k x ≥ r,
1> x = 1,
|x| ≤ B1.
where Vk = sqrtm(Qk ), Qk denotes the variance-covariance matrix for the k-th scenario,
and µk denotes the mean vector for the k-th scenario. The data for this code is in the
file multiscenario.mat. The notebook MultiScenario.ipynb reads in this file and
converts the data into numpy arrays.
Modify this code to solve the following utility maximization problem

max min1≤k≤m µ>



k x − λ kVk xk2 ,
1> x = 1,
s.t. P
n −
i=1 xi ≤ 4.

Solution: The optimization can be reformulated as

max β
s.t. µ>
k x − λ kVk xk2 ≥ β, k = 1, . . . , m,
>
1 x = 1,
P n −
i=1 xi ≤ 4.

See the code in the file HW8sols.ipynb.

2
3. Integer knapsack problem Total points: [15]
15
Consider the following integer knapsack problem
P5
max vi xi
Pi=1
5
subject to i=1 wi xi ≤ W
xi ∈ Z+

The data for the problem is as follows

n = 5;
v = [1,6,18,22,28]’;
w = [1,2,5,6,7]’;
W = 11;

We saw in class that the recursion for this problem is given by

Vi (w) = max{Vi−1 (w), vi + Vi (w − wi )}

where

Vi (w) = Maximum revenue from objects j ≤ i and weight budget w

In the recursion above, it is optimal to pick up one unit of object i only if vi +Vi (w−wi ) ≥
Vi−1 (w). We want compute V5 (11), and recover the optimal solution. Solve this recursion
using python.

1. You will start with V1 (w)and work your way up to V5 (11).


2. In another array Di (w), keep track of the optimal decision. It is optimal to pick up
one unit of object i only if vi + Vi (w − wi ) ≥ Vi−1 (w).
3. In order to compute the optimal decision, you will work backward from the V5 (11).
• If it is optimal to pick up object 5, you will put it in your bag, and consider
the optimal decision at V5 (11 − w5 ) = V5 (4).
• Otherwise you will move to V4 (11) and look into the optimal solution at that
stage.

Solution: See the code in the file HW8sols.ipynb.

4. Project management Total points: [20]


20
A construction company has four projects in progress. According to the current allo-
cation of manpower, equipment, and materials, the four projects can be completed in
15, 20, 18, and 25 weeks. Management wants to reduce the completion times and has
decided to allocate an additional $35,000 to all four projects. The new completion times

3
as functions of the additional funds allocated to each projects are given in the table
below.
Write a code to compute how $35,000 should be allocated among the projects to achieve
the largest total reduction in completion times? Assume that the additional funds can
be allocated only in blocks of $5000.
Additional funds
(×1000 dollars) Project 1 Project 2 Project 3 Project 4
0 15 20 18 25
5 12 16 15 21
10 9 13 12 18
15 8 11 10 16
20 7 9 9 14
25 6 8 8 12
30 5 7 7 11
35 4 7 6 10

Solution: Let M (x, j) for x ∈ {0, . . . , 7} denote the completion time when 5000x
dollars are invested in Project j. The goal here is to solve the following optimization
problem: P4
minx M (xj , j),
Pj=1
4
s.t. j=1 xj ≤ W (= 7).
Define the value function
Vi (s) = Minimum completion time of projects 1, . . . , i
when a total of 5000s dollars are invested on them.
Then the recursion of V (s, i) is given by

Vi (s) = min M (x, i) + Vi−1 (s − x) ,
0≤x≤s

and we need to keep track of



Di (s) = argmin M (x, i) + Vi−1 (s − x) ,
0≤x≤s

to reconstruct the solution.


The optimal solution can be computed as follows:

• Set s = W (= 7)
• For i = n, n − 1, . . . , 1
– x∗i = Di (s)
– s = s − x∗i

You might also like