1. Mixed Integer Conditional Value-at-Risk Portfolio
Optimization
Multi Disciplinary Approaches
M.Sc Defense
Ahmed Ashmawy
German University in Cairo
September 2011
3. Introduction
I Stocks
I Financial security (instrument)
I Raise Capital to Corporations
I Investment for traders
I Liquidity
I Pro
4. t = Sell price - Buy price
An investor wants to invest $X in the stock market such that
s1; s2; s3; s4 are the stocks available to choose from and their
corresponding current prices are c1; c2; c3; c4 respectively.
Question:
How many shares should the investor buy per stock ?
5. Introduction
I Decision criteria ?
I Account for uncertainties (e.g: news, mergers, weather, prices,
. . . etc)
I Risk Measures: SDEV, MAD, VaR, CVaR, . . . etc
I Stock performance measure ?
I Monte-carlo
I Historical simulation
I . . . etc
I Single investment vs. Multiple investments ?
I Diversifying risk across a portfolio of stock investments (i.e:
c1w1 + c2w2 + c3w3)
I Number of solutions ?
I Searching for the optimal combination of weights with respect
to reward and/or risk
6. Introduction
I Problems
- Modeling weight variables as real variables
- Hardness of solving mixed integer optimization problems
- Gap between Linear & Integer optimization
- Mislead investor by inaccurate solutions
I Focus
+ Model weight variables as integer variables
+ Improving the time performance of the mixed integer
optimization problem
7. Outline
Introduction
Background
Integer Programming
Value-at-Risk
Conditional Value-at-Risk
Portfolio Optimization
Problem Description
System
Hybrid CP/LP Approaches
Greedy Approach
9. nition (IP): An integer programming problem is an LP problem
with integrality constraint on all variables
De
10. nition (MIP): A mixed integer programming problem is an LP
problem with integrality constraints on some variables
Example
v1 0
v2 0
v1 + v2 2
v2 v1 1
integers(v1; v2)
11. Value-at-Risk
What is the amount of loss such that the maximum loss of an
investment is less than or equal to with probability ?
Loss Frequency
1% 16
2% 18
3% 20
4% 22
5% 17
. . . . . .
32% 7
33% 6
. . . . . .
43% 2
44% 1
45% 1
12. Value-at-Risk
What is the amount of loss such that the maximum loss of an
investment is less than or equal to with probability = 0.95 ?
Loss Frequency
1% 16
2% 18
3% 20
4% 22
5% 17
. . . . . .
32% 7
33% 6
. . . . . .
43% 2
44% 1
45% 1
13. Value-at-Risk
Let f (x, y) be the loss associated with the decision vector x and
the vector y.
The vector x 2 Rn can be interpreted as the investment portfolio
and the vector y 2 Rm as the uncertainties involved in the
portfolio (e.g: prices, weather, . . . etc).
(x; ) =
Z
f (x,y)
p(y)d(y) (2.1)
17. Conditional Value-at-Risk
An alternative coherent risk measure that address the question:
What is the expected loss incase the worst case
with probability 1 - occurred ?
! Mean of the -tail distribution of loss
20. ned Conditional
Value-at-Risk as the conditional expectation of the
loss associated with x relative to that loss being
greater than or equal to (x)
(x) = E[f (x; y)jf (x; y) (x)] (2.3)
= + (1 + )1
XJ
j=1
j [f (x; yj ) ]+ (2.4)
J and [t]+ = maxft,0g
where j = 1
21. Conditional Value-at-Risk
I Features
I Accounts for risk beyond VaR
I Convex function
I Easy to optimize numerically
I Coherent risk measure
23. Problem Description
I Let x0 = (x0
1 ; x0
2 ; :::; x0
n )T be the number of shares of each
stock in the initial portfolio, and let x = (x1; x2; :::; xn)T be
the number of shares in the optimal portfolio
I The current prices for the stocks are given by
q = (q1; q2; :::; qn)T . The product qT x0 is thus the investor's
capital (the initial portfolio value)
I We follow a historical simulation scheme by using historical
returns over a certain period of time such that yij = qi
pi ;tj+t
pi ;tj
24. Problem Description
f (x; y) = yT x + qT x0
(x) = + (1 + )1
XJ
j=1
j [f (x; yj ) ]+
J and [t]+ = maxft,0g
where j = 1
I Risk tolerance percentage (!) is a percentage of the initial
portfolio value qT x0 allowed for risk exposure
+ (1 + )1
XJ
j=1
jzj !
Xn
k=1
qkx0
k (3.1)
zj
Xn
i=1
(yijxi + qi x0
i ) ; zj 0; j = 1; :::; J (3.2)
25. Problem Description
I Max value allowed per stock
qixi vi
Xn
k=1
qkxk; i = 1; :::; n (3.3)
I Reward
R(x) = E[yT x] =
Xn
i=1
E[yi ]xi where E[yi ] =
1
J
XJ
j=1
yij (3.4)
I Minimum reward rate
Xn
i=1
E[yi ]xi
Xn
k=1
qkx0
k ; i = 1; :::; n (3.5)
26. Problem Description
minfR(x); (x); (x) R(x)g
+ (1 + )1
XJ
j=1
jzj !
Xn
k=1
qkx0
k
zj
Xn
i=1
(yijxi+qi x0
i ) ; zj 0
qixi vi
Xn
k=1
qkxk
Xn
i=1
E[yi ]xi
Xn
k=1
qkx0
k
xi 0; integer(xi)
29. Outline
Introduction
Background
Problem Description
System
Hybrid CP/LP Approaches
Hybrid Models
Proposed Constraints
Sequential Hybrid Model
Integrated Hybrid Model
Greedy Approach
30. Hybrid Models
I Hybridization is the process of solving problems using multiple
solvers that co-operate together
I Why use multiple solvers ?
I Dierent solvers/algorithms suit dierent types of problems
I Solvers complement each other
31. Hybrid Models
CP
+ Rich set of constraints
+ Tackle highly combinatorial problems
+ Inference mechanism
- Optimization
- Large scale
LP
+ Large scale
+ Optimization
- Linear constraints only
- reals
32. Proposed Constraints
I Shares Constraint
Xn
i=1
qixi Capital (5.1)
I Max Value Constraint
qixi vi
Xn
k=1
qkxk (5.2)
I Min Reward Rate Constraint
Xn
i=1
E[yi ]xi
Xn
k=1
qkx0
k (5.3)
33. Sequential Hybrid Model
I Prune the variable domains using constraint reasoning and
then invoke the external branch cut solver using the synced
bounds.
39. Greedy Approach: Overview
I Motivation
I Complex mixed integer optimization problem
I Abandon proof of optimality
I Seek near optimum
I Idea
I Utilize the sparse nature that portfolio optimization problems
exhibit to improve the time performance.
41. Greedy Approach: Notations
Stock sets I Relaxed stock set: The stock set considered in
the relaxed problem
I Proposed stock set: The stock set extracted
from the relaxed solution having relaxed weight
values greater than zero
I Integer stock set: The stock set considered in
the mixed integer problem
Termination Condition is reached if the LP solver fail to contribute
to the mixed integer objective function cost (i.e: 2
equal subsequent iterations)
42. Greedy Approach: Algorithm
Algorithm 1
1: L U
2: Iy, Wy, R, V
3: Cy
int , C
lin
4: repeat
5: tmp Cy
int
6: L, C
lin solveLP(Q; Y, OCj;;!;;, L)
7: L L n L
8: Iy Iy [ L
9: Cy
int , Wy, R, V solveMIP(Q; Y, OCj;;!;;, Iy)
10: until Cy
int = tmp or C
lin =
51. Greedy Approach: Ecient Frontier
Figure: IPbc and IPg Ecient frontiers, time performance, 9000 Stocks,
30 Scenarios
52. Conclusion
I Hybrid CP/LP Approach
I Proposing constraints that successfully pruned the search
space of the portfolio optimization problem
I Researching the use of hybrid CP/LP models in improving the
time performance of the problem
I Greedy Approach
I Designing a greedy algorithm which exploit the sparse nature
of portfolio optimization problems with focus on improving the
time performance
I Saving 9.86 hours using our proposed greedy algorithm over 15
problem instances with respect to solution quality
I Experimental Studies
I Performing experimental studies on real data sets
54. Constraint Programming
I Model the problem as a constraint satisfaction problem
including variables, their domains and constraints
I Solve using constraint solvers
I Features
I Generally known as an ecient inference mechanism
I Adequate for solving a wide range of hard combinatorial
problems
I Elegant design framework for developers by separating problem
modeling and solving
55. Linear Programming
min/max cT x s.t. Ax b
A =
0
B@
a1;1 a1;n
.... . .
...
an;1 an;n
1
CA
Example
max 4x1 + 7x2 + 2x3
12x1 3x2 + 5x3 24
6x1 + 8x2 + 11x3 7
58. nition (IP): An integer programming problem is an LP problem
with integrality constraint on all variables
De
59. nition (MIP): A mixed integer programming problem is an LP
problem with integrality constraints on some variables
Example
v1 0
v2 0
v1 + v2 2
v2 v1 1
integers(v1; v2)
61. Branch and Cut (BC)
I BC ! BB + Cutting plane algorithm
I Cutting Planes are linear inequalities derived from the
constraint set to remove infeasible linear regions
Example
v1 0
v2 0
v1 + v2 2
v2 v1 1
! v1 1