chance constraints and distributionally robust …...chance constraints and distributionally robust...

22
Chance constraints and distributionally robust optimization chance constraints approximations to chance constraints distributional robustness EE364b, Stanford University

Upload: others

Post on 28-Jun-2020

30 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Chance constraints and distributionally robust …...Chance constraints and distributionally robust optimization • chance constraints • approximations to chance constraints •

Chance constraints and

distributionally robust optimization

• chance constraints

• approximations to chance constraints

• distributional robustness

EE364b, Stanford University

Page 2: Chance constraints and distributionally robust …...Chance constraints and distributionally robust optimization • chance constraints • approximations to chance constraints •

Chance constraints

non-convex problem

minimize f0(x)

subject to Prob(fi(x, U) > 0) ≤ ǫ, i = 1, . . . ,m

safe approximation: find convex gi : Rn → R such that

gi(x) ≤ 0 implies Prob(fi(x, U) > 0) ≤ ǫ

• sufficient condition: find set U such that

Prob(U ∈ U) ≥ 1− ǫ set gi(x) = supu∈U

fi(x, u)

EE364b, Stanford University 1

Page 3: Chance constraints and distributionally robust …...Chance constraints and distributionally robust optimization • chance constraints • approximations to chance constraints •

Bounds on probability of error

• sometimes useful to directly bound Prob(fi(x, U) > 0) instead ofProb(U ∈ U)

• Value at risk of random Z is

VaR(Z; ǫ) = inf {γ | Prob(Z ≤ γ) ≥ 1− ǫ} = inf {γ | Prob(Z > γ) ≤ ǫ}

• equivalence of VaR and deviation:

VaR(Z; ǫ) ≤ 0 if and only if Prob(Z > 0) ≤ ǫ

EE364b, Stanford University 2

Page 4: Chance constraints and distributionally robust …...Chance constraints and distributionally robust optimization • chance constraints • approximations to chance constraints •

• Gaussians: if U ∼ N (µ,Σ) then xTU − γ ∼ N (µTx− γ, xTΣx) and

Prob(xTU ≤ γ) = Φ

(

γ − xTU√xTΣx

)

so

VaR(UTx− γ; ǫ) ≤ 0 iff γ ≥ µTx+Φ−1(1− ǫ)∥

∥Σ1/2x

2

convex iff ǫ ≤ 1/2

EE364b, Stanford University 3

Page 5: Chance constraints and distributionally robust …...Chance constraints and distributionally robust optimization • chance constraints • approximations to chance constraints •

Convex bounds on probability of error

• sometimes more usable idea: convex upper bounds on probability oferror

• simple observation: if φ : R → R is non-negative, non-decreasing

1 (z ≥ 0) ≤ φ(z)

• consequence: for all α > 0,

Prob(Z ≥ 0) ≤ Eφ(α−1Z),

• so ifEφ(α−1Z) ≤ ǫ, then Prob(Z ≥ 0) ≤ ǫ

EE364b, Stanford University 4

Page 6: Chance constraints and distributionally robust …...Chance constraints and distributionally robust optimization • chance constraints • approximations to chance constraints •

Perspective transforms and convex bounds

• perspective transform of function f : Rn → R is

fper(x, λ) = λf(x

λ

)

• jointly convex in (x, λ) ∈ Rn × R+ when f convex

• so for φ(·) ≥ 1 (·), better convex constraint (valid for all α > 0)

αEφ

(

f(x, U)

α

)

≤ αǫ

is convex in x, α if f is

EE364b, Stanford University 5

Page 7: Chance constraints and distributionally robust …...Chance constraints and distributionally robust optimization • chance constraints • approximations to chance constraints •

• optimize this bound,

infα≥0

{

αEφ

(

f(x, U)

α

)

− αǫ

}

≤ 0

• convex constraint satisfied implies that

Prob(f(x, U) > 0) ≤ ǫ

EE364b, Stanford University 6

Page 8: Chance constraints and distributionally robust …...Chance constraints and distributionally robust optimization • chance constraints • approximations to chance constraints •

Tightest convex relaxation

• set φ(z) = [1 + z]+, where [x]+ = max{x, 0}

infα≥0

{

αE

[

f(x, U)

α+ 1

]

+

− αǫ

}

= infα≥0

{

E [f(x, U) + α]+ − αǫ}

• conditional value at risk is

CVaR(Z; ǫ) = infα

{

1

ǫE [Z − α]+ + α

}

,

• key inequalities:

Prob(Z ≥ 0)− ǫ ≤ ǫCVaR(Z; ǫ)

EE364b, Stanford University 7

Page 9: Chance constraints and distributionally robust …...Chance constraints and distributionally robust optimization • chance constraints • approximations to chance constraints •

Interpretation of conditional value at risk

• minimize out α and find

0 =∂

∂α

{

α+1

ǫE [Z − α]+

}

= 1−1

ǫE1 (Z ≥ α) = 1−1

ǫProb(Z ≥ α).

• value at risk plus upward deviations: set α⋆ s.t. ǫ = Prob(Z ≥ α⋆),

CVaR(Z; ǫ) =1

ǫE [Z − α⋆]+ + α⋆ =

1

ǫE [Z − α⋆]+ +VaR(Z; ǫ)

• conditional expectation version:

E[Z | Z ≥ α⋆] = E[α⋆ + (Z − α⋆) | Z ≥ α⋆]

= α⋆ +E [Z − α⋆]+

Prob(Z ≥ α⋆)= α⋆ +

E [Z − α⋆]+ǫ

= CVaR(Z; ǫ).

EE364b, Stanford University 8

Page 10: Chance constraints and distributionally robust …...Chance constraints and distributionally robust optimization • chance constraints • approximations to chance constraints •

Benefits and drawbacks of CVaR

• easy to simulate, approximate well

• typically hard to evaluate exactly; not very tractable bounds

• e.g. f(x, U) = UTx and U ∼ Uniform{−1, 1}n gives combinatorial sum

• if available, analytic approximations using moment generating function(MGF) can give better behavior (notes)

EE364b, Stanford University 9

Page 11: Chance constraints and distributionally robust …...Chance constraints and distributionally robust optimization • chance constraints • approximations to chance constraints •

Portfolio optimization example

• n assets i = 1, . . . , n, random multiplicative return Ri withE[Ri] = µi ≥ 1, µ1 ≥ µ2 ≥ · · · ≥ µn

• asset i return varies in range Ri ∈ [µi − ui, µi + ui]

• data µi = 1.05 + 3(n−i)10n , uncertainty |ui| ≤ ui = .05 + n−i

2n and un = 0

• moment generating function approximation to VaR(RTx− t; ǫ) ≤ 0 is

t− µTx+

1

2log

1

ǫ‖diag(u)x‖2 ≤ 0

EE364b, Stanford University 10

Page 12: Chance constraints and distributionally robust …...Chance constraints and distributionally robust optimization • chance constraints • approximations to chance constraints •

1.00 1.02 1.04 1.06 1.08 1.10 1.12 1.14 1.16 1.180.0

0.04

0.08

0.12

0.16

0.2

0.24

RTx⋆an

RTx⋆mc

t⋆an t⋆mc

Monte-Carlo CVaR solution x⋆mc vs. analytic (MGF) approximation x⋆

an

EE364b, Stanford University 11

Page 13: Chance constraints and distributionally robust …...Chance constraints and distributionally robust optimization • chance constraints • approximations to chance constraints •

Distributionally robust optimization

stochastic optimization problems:

minimizex

EPf(x, S) =

f(x, s)dP (s)

distributionally robust formulation:

minimizex

supP∈P

EPf(x, S) = supP∈P

f(x, s)dP (s)

new question: how should we choose P?

EE364b, Stanford University 12

Page 14: Chance constraints and distributionally robust …...Chance constraints and distributionally robust optimization • chance constraints • approximations to chance constraints •

Choices of uncertainty sets

• moment-based conditions, e.g.

P = {P | EP [hi(S)] � bi}

for function hi : S → Rni

• “nonparametric” sets, using divergence-like quantities, e.g.

P = {P | Dkl (P ||P0) ≤ ρ}

• often estimate these based on sample S1, . . . , Sm

EE364b, Stanford University 13

Page 15: Chance constraints and distributionally robust …...Chance constraints and distributionally robust optimization • chance constraints • approximations to chance constraints •

Moment-based uncertainty

• general moment constraints: let Ki ⊂ Rni be convex cones,i = 1, . . . ,m, hi : S → Rni, and

P =

{

P |∫

hi(s)dP (s) �Kibi

}

• under constraint qualification (Rockafellar 1970, Isii 1963, Shapiro2001, Delage & Ye 2010)

supP∈P

f(s)dP (s) = infr,t,z

{

r +∑

i ti s.t. r ≥ f(s), zi ∈ K∗i

ti ≥ zTi bi − zTi hi(s), all s ∈ S

}

EE364b, Stanford University 14

Page 16: Chance constraints and distributionally robust …...Chance constraints and distributionally robust optimization • chance constraints • approximations to chance constraints •

Uncertainty from central limit theorems

• typical idea: start with some probabilistic understanding, work to getuncertainty set

• central limit theorem: for Si ∈ R, drawn i.i.d., Φ Gaussian CDF

Prob

(

1

m

m∑

i=1

Si ≥ ES +1√m

Var(S)t

)

→ Φ(−t)

• empirical confidence set: let Uρ = {u ∈ Rm | 1Tu = 0, ‖u‖2 ≤ ρ}

{

1

m

m∑

i=1

Si +1

m

m∑

i=1

uiSi | u ∈ Uρ

}

=

Sm ± ρ√m

1

m

m∑

i=1

(Si − Sm)2

EE364b, Stanford University 15

Page 17: Chance constraints and distributionally robust …...Chance constraints and distributionally robust optimization • chance constraints • approximations to chance constraints •

• slight extension of CLT implies

Prob

(

Sm − ρ√m

Varm(S) ≤ ES ≤ Sm +ρ√m

Varm(S)

)

= Prob(

ES ∈{

Sm + uTS/m | u ∈ Uρ

})

→ Prob(−ρ ≤ N (0, 1) ≤ ρ) = Φ(ρ)− Φ(−ρ)

• natural confidence set for distributionally robust optimization:

Pm,ρ ={

p ∈ Rn | 1Tp = 1, ‖p− 1/m‖2 ≤ ρ/m}

and

supp∈Pm,ρ

m∑

i=1

pif(x, Si)

EE364b, Stanford University 16

Page 18: Chance constraints and distributionally robust …...Chance constraints and distributionally robust optimization • chance constraints • approximations to chance constraints •

Divergence-based confidence sets

• general form of robustness set: φ-divergences

Dφ (P ||Q) =

φ

(

p(s)

q(s)

)

q(s)

where φ : R+ → R is convex, φ(1) = 0

• uncertainty set for Pm = 1m

∑mi=1 δSi

(empirical distribution)

Pm = {P : Dφ (P ||Pm) ≤ ρ/m}

• examples: φ(t) = (t− 1)2, φ(t) = t log t, φ(t) = − log t

EE364b, Stanford University 17

Page 19: Chance constraints and distributionally robust …...Chance constraints and distributionally robust optimization • chance constraints • approximations to chance constraints •

• can show (Duchi, Glynn, Namkoong) that for φ with φ′′(0) = 2 that forS1, . . . , Sm ∼ P0,

Prob

(

supP∈Pm

EPf(x, S) ≤ EP0f(x, S)

)

→ Φ(−ρ)

(and versions uniform in x too)

EE364b, Stanford University 18

Page 20: Chance constraints and distributionally robust …...Chance constraints and distributionally robust optimization • chance constraints • approximations to chance constraints •

Dual representation of divergence-based confidence sets

ifP = {P | Dφ (P ||P0) ≤ ρ}

then

supP∈P

EPZ = infα≥0,η

{

αEφ∗

(

Z − η

α

)

+ ρα+ η

}

• example: φ(t) = 12t

2 − 1 has

φ∗(u) =1

2(u)2+ + 1

so

supP∈P

EPf(x, S) = infη

{

1 + ρ(EP0(f(x, S)− η)2+)1/2 + η

}

EE364b, Stanford University 19

Page 21: Chance constraints and distributionally robust …...Chance constraints and distributionally robust optimization • chance constraints • approximations to chance constraints •

Portfolio optimization revisited

• returns R ∈ Rn, n = 20, domainX = {x ∈ Rn | 1Tx = 1, x ∈ [−10, 10]} (leveraging allowed)

• returns R ∼ N (µ,Σ)

• within simulation, µ, Σ chosen randomly

• recall Markowitz portfolio problem to

maximize1

m

m∑

i=1

RTi x−

ρ/m√

xTΣmx

where Σm = 1m

i(Ri −Rm)(Ri −Rm)T is empirical covariance

EE364b, Stanford University 20

Page 22: Chance constraints and distributionally robust …...Chance constraints and distributionally robust optimization • chance constraints • approximations to chance constraints •

20 40 60 80 1e2 2e2 4e2 6e2 8e2 1e3 2e3 3e3 4e3 5e3 6e3 7e3 8e3 9e3 1e4Number of Sample

−200

−150

−100

−50

0

50Portfolio: Coverage

SAAMarkowitzELNormal

compare returns of robust/empirical likelihood method, Markowitzportfolio, true gaussian results, sample average, 95% confidence

EE364b, Stanford University 21