Professional Documents
Culture Documents
IEOR E4007 G. Iyengar November 16, 2021
IEOR E4007 G. Iyengar November 16, 2021
IEOR E4007 G. Iyengar November 16, 2021
Homework #6
max x1 + 2x2 ,
s.t. x1 + x2 ≤ 8,
2x1 + x2 ≥ 2,
x1 x2 ≤ 24,
x2 ≥ 0 and integer,
x1 = 0, 1, 4, or 6.
(a) Formulate this optimization as an integer linear program and solve it. Solve this
integer linear program using EXCEL and python.
To transform variable x1 into a standard binary integer variable, we can use the
following formulation:
Since objective function and the first two constraints are all linear, we just sub-
stitute x1 with y1 + 4y2 + 6y3 , but the constraint x1 x2 ≤ 4 requires more effort.
Let wi = yi x2 , i = 1, 2, 3, then we have x1 x2 = w1 + 4w2 + 6w3 . Now we need to
find a set of linear constraints that ensure that, for i = 1, 2, 3, we have
(
x2 , if yi = 1,
wi =
0, if yi = 0.
1
y1 + 4y2 + 6y3 + x2 ≤ 8,
2y1 + 8y2 + 12y3 + x2 ≥ 2,
w1 + 4w2 + 6w3 ≤ 4,
wi ≤ 8yi , i = 1, 2, 3,
wi ≤ x2 , i = 1, 2, 3,
wi ≥ 0, i = 1, 2, 3,
wi ≥ x2 − 8(1 − yi ), i = 1, 2, 3,
y1 + y2 + y3 ≤ 1,
yi ∈ {0, 1}, i = 1, 2, 3,
x2 ≥ 0 and integer.
(b) Suppose the objective function is changed to: max x21 + 2x2 . Formulate and solve
this as a linear integer program.
If the objective function changes to x21 + 2x2 , then the objective function of the
above integer program will change to:
where >
µ = −1.2075 0.7172 1.6302 0.4889 1.0347 ,
n = 5, W = 10, β = 1.5 is the margin parameter and the transaction cost function is
given by
0 0,
τ (u) = c + λu 0<u≤B
c + λB + γλ(u − B) u > B,
with c = 0.1, λ = 0.7, B = 5, and γ = 0.25. Note that you will have to create an
appropriate upper bound for the u in the third row.
setting x =Px+ − x− , x+ ≥ 0, x− ≥ 0. Then we
Pn |x| by P
The first step is to linearize
have |x| = x + x and i=1 |xi | = ni=1 x+ + ni=1 x− . Thus, we have linearized the
+ −
absolute value of x.
2
Not the margin requirement implies that |xi | ≤ βW for all i. Thus, the function we
need to model is given by
0 0,
τ (u) = c + λu 0<u≤B
c + λB + γλ(u − B) B < u ≤ βW.
2
(b) The investment xi in asset i should satisfy |xi | ≥ d
or zero.
(c) Risk constraint: VaR of the rate of the loss of the portfolio x at p = 95% must
be at most γ ∈ {0.01, . . . , 0.1}:
Varα (Lx) ≤ γ
3
(d) Objective: maximize expected rate of return on the portfolio.
Let x+ denote the long positions and x− denote the short positions. Then the portfolio
constraints in (a) can be written as:
d
X
−
(x+
i − xi ) ≤ 1 (2)
i=1
Xd
−
(x+
i + xi ) ≤ β (3)
i=1
Let yi ∈ {0, 1}, i = 1, . . . , d, denote whether or not we invest in asset i. Then (b) can
be formulated as follows: 2
−
y i ≤ x+
i + xi ≤ βyi . (4)
d
Let zk ∈ {0, 1} denote the binary variables that control the loss in scenario k, i.e.
we want that L> + −
k (x − x ) ≤ γ if zk = 0. We can impose this requirement by the
constraint
L> + −
k (x − x ) ≤ γ + (Mk − γ)zk (5)
where