IntroRobustOptim_Python
IntroRobustOptim_Python
robust optimization
Erick Delage
Dept. of decision sciences, HEC Montréal
CRC in decision making under uncertainty
A production problem
• A company produces two kinds of drugs, DrugI and DrugII,
containing a speci c agent A, which is extracted from raw
materials purchased on the market. Its goal is to nd the
production plan that maximizes the pro t of the company.
2 /27
fi
fi
fi
Linear programming
formulation
maximize 6200DI + 6900DII (100RI + 199.90RII + 700DI + 800DII)
RI,RII,DI,DII
subject to RI + RII 1000 (Storage)
90DI + 100DII 2000 (Manpower)
40DI + 50DII 800 (Equipment)
100RI + 199.9RII + 700DI + 800DII 100000 (Budget)
0.01RI + 0.02RII 0.5DI 0.6DII 0 (Agent A)
RI 0, RII 0, DI 0, DII 0,
• Optimal solution :
RI* = 0, RII* = 438 kg, DI* = 17 552 packs, DII* = 0 pack, optimal pro t = 8820$
• Optimal solution relies heavily on extracting 8,78 g of agent A and using all of it
in the production of Drug I (no left-over).
• If there is a 2% estimation error in conversion rate for this raw material, then we
are missing 0,18g of agent A and can only produce 17201 packs of Drug I.
Pro t drops to 6889$ (i.e. -22%)
3 /27
fi
fi
Robust formulation
• If there is a 2% estimation error in conversion rate
for Raw II and 0.5% for Raw I, then it would be more
robust to replace the (Agent A) constraint with:
(0.995 · 0.01)RI + (0.98 · 0.02)RII 0.5DI 0.6DII 0
Problem a)
SizeProblem Sizea)
! = 0.01% ! !==0.01%
0.1% !=
!=0.1%
1% !
« small perturbations of Nbadb) Indexc) Nbadb)
Nbad Indexc)
Index Nbad
Nbad Index
Index Nbad
6 /27
History of robust optimization
• « maximin » introduced by Abraham Wald in 1945 to
manage risk and is in uenced by zero-sum games
(von Neumann & Morgenstern, 1944)
• Allen Soyster (1973) proposed robustifying
constraints of a linear program by considering
interval uncertainty.
• Idea was considered too conservative for a long time
• In 1998, Ben-Tal & Nemirovski gave a second life to
the framework in context of convex optimization by
exploiting ellipsoidal uncertainty
7 /27
fl
Rebirth of robust optimization
8 /31
Why ellipsoidal sets are less
conservative than boxes?
• In high dimension, appoint in the • In high dimension, vectors
box can be up to n times composed of i.i.d. components
further from zero than any point lie with high probability in the
in the ellipsoid that covers each following hyper-orbit
[-B, B] interval
(B, ..., B)
B
✓ ◆ ( ,... )
B B
p , ..., p
n n
-B B
B p
B n
-B p p p p
n o( n) n + o( n)
9 /27
Possible reasons for rebirth
of robust optimization
• Characterizing uncertainty with a set of possible
realization can be easier than with a multivariate
distribution
• Some uncertainty sets have the following
properties:
• they reduce conservativeness
• they lead to reformulations that are easier to solve than SP
• they provide statistical guarantees.
• The development of more powerful computers and
in particular of fast interior point methods.
10 /27
De ning robust optimization
11 /27
fi
Reformulating a robust optimization
problem using duality theory
• ⇢
Consider the robust LP
>
RLP := maximize min c(x) z + d(x) ,
x2X z:P zq
• Reformulating inner problem
⇢ using Lagrangian
RLP ⌘ maximize min max c(x)> z + d(x) >
(q P z)
x2X z 0
• LP strong duality ⇢
> >
RLP ⌘ maximize max min c(x) z + d(x) (q P z)
x2X 0 z
• Proper book-keeping leads to compact reformulation
RLP ⌘ maximize d(x) q> ,
x2X , 0
>
subject to P + c(x) = 0
12 /27
Robust production problem
maximize 6200DI + 6900DII (100RI + 199.90RII + 700DI + 800DII)
RI,RII,DI,DII
subject to RI + RII 1000
90DI + 100DII 2000
40DI + 50DII 800
100RI + 199.9RII + 700DI + 800DII 100000
0.01(1 + 0.005z1 )RI + 0.02(1 + 0.02z2 )RII 0.5DI 0.6DII 0 , 8z 2 Z
RI 0, RII 0, DI 0, DII 0,
• Box uncertainty would assume:
2
Z := {z 2 R | max |zi | 1}
i
• Ellipsoidal uncertainty would assume: X
Z := {z 2 R2 | zi2 1}
i
• Budgeted uncertainty would assume:
X
Z( ) := {z 2 R2 | max |zi | 1 , |zi | }13 /27
i
Robust production problem
maximize 6200DI + 6900DII (100RI + 199.90RII + 700DI + 800DII)
RI,RII,DI,DII
subject to RI + RII 1000
90DI + 100DII 2000
40DI + 50DII 800
100RI + 199.9RII + 700DI + 800DII 100000
0.01(1 + 0.005z1 )RI + 0.02(1 + 0.02z2 )RII 0.5DI 0.6DII 0 , 8z 2 Z
RI 0, RII 0, DI 0, DII 0,
• Box uncertainty leads to :
0.01RI + 0.02RII 0.5DI 0.6DII 0.00005|RI| + 0.0004|RII|
Ellipsoidal uncertainty leads to :p
•
2 2 2 2
0.01RI + 0.02RII 0.5DI 0.6DII 0.00005 RI + 0.0004 RII
• Budgeted uncertainty leads to (with new « t » variable):
0.01RI + . . . 0.6DII t + max(0; |0.00005RI| t) + max(0; |0.0004RII| t)
14 /27
RSOME implementation (see Google Colab)
Chen et al. Robust Stochastic Optimization Made Easy with RSOME. MS, 2020.
15 /31
RSOME implementation (see Google Colab)
Chen et al. Robust Stochastic Optimization Made Easy with RSOME. MS, 2020.
16 /31
RSOME implementation (see Google Colab)
Chen et al. Robust Stochastic Optimization Made Easy with RSOME. MS, 2020.
Ellipsoidal
uncertainty set
17 /31
RSOME implementation (see Google Colab)
Chen et al. Robust Stochastic Optimization Made Easy with RSOME. MS, 2020.
Budgeted
uncertainty set
18 /31
Distributionally robust
optimization
• Robust optimization can also be applied on top of a
stochastic program when one is not comfortable about
making a distribution assumption:
maximize min EF [h(x, z)]
min
x2X 2D
FF2D
20
• We use both methods to select portfolios of four
0
stocks
1992 to be traded
1994 1996 daily
1998 between
2000 2001 2004
2002 and 20082006 2008 2
year
• Both methods maximize expected daily returns and
use the last 30 days returns to build an uncertainty
model for next daily return (distribution vs. distribution
set based on moments)
• 300 experiments are performed
20 /27
SP vs. DRO : a portfolio
selection case study
• Below we present statistics of cumulated returns obtained
using both methods
• Curves are the average cumulated wealth while bars
indicate 5th and 95th percentiles
1.4
Distributionally robust optimization
1.2 Stochastic programming
1.5
1
1.25
Wealth
0.8
Wealth
1
0.6
0.75
0.4
0.5
0.2
2001 2002 2003 2004 2004 2005 2006 2007
Year Year
22 /27
Can we use risk assessment surveys?
Grable & Lytton, Financial Services Review (1999)
26 /27
MATH80624A : Quantitative risk
management using robust optimization
• Coming in Winter 2023
• Applications:
• Logistics • Electrical engineering
• Finance • Aerospace
• Marketing • Data mining
• etc.
• Topics:
• Robust counterpart of Linear Programs
• Data driven uncertainty set design
• Robust nonlinear programming
• Adjustable robust linear programming
• Distributionally robust optimization
• Globalized robust counterparts
• Pareto ef ciency in robust optimization
28 /27