Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

84
Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications

Transcript of Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Page 1: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Stochastic OptimizationESI 6912

Instructor: Prof. S. Uryasev

NOTES 7:

Algorithms and Applications

Page 2: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Content

1. Value-at-Risk (VaR) a. Definition

b. Features

c. Examples

2. Conditional Value-at-Risk (CVaR)

a. Definition: Continuous and Discrete distribution

b. Features

c. Examples

3. Formulation of optimization problem

a. Definition of a loss function

b. Examples: CVaR in performance function and CVaR in constraints

4. Optimization techniques a. CVaR as an optimization problem: Theorem 1 and Theorem 2

b. Reduction to LP

5. Case Studies

Page 3: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Value-at-Risk Definition

Value-at-Risk (VaR) = - percentile of distribution of random variable (a smallest value such that probability that random variable

is smaller or equals to this value is greater than or equal to )

Definition:

Random variable,

Fre

qu

en

cy

VaR

Probability

Maximal value

Page 4: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Value-at-Risk Definition (cont’d)

Mathematical Definition:

- random variable

VaR ( ) inf ( )P

Value-at-Risk (VaR) is a popular measure of risk:current standard in finance industry

various resources can be found at http://www.gloriamundi.org

Informally VaR can be defined as a maximum value in a specified period with some confidence level (e.g., confidence level = 95%, period = 1 week)

Remarks:

Page 5: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Value-at-Risk Features

• simple convenient representation of risks (one number)

• measures downside risk (compared to variance which is impacted by high returns)

• applicable to nonlinear instruments, such as options, with non- symmetric (non-normal) loss distributions

• may provide inadequate picture of risks: does not measure losses exceeding VaR (e.g., excluding or doubling of big losses in November 1987 may not impact VaR historical estimates)

• reduction of VaR may lead to stretch of tail exceeding VaR: risk control with VaR may lead to increase of losses exceeding VaR. E.g, numerical experiments1 show that for a credit risk portfolio, optimization of VaR leads to 16% increase of average losses exceeding VaR. Similar numerical experiments conducted at IMES2 .

1 Larsen, N., Mausser, H. and S. Uryasev. Algorithms for Optimization of Value-At-Risk. Research Report, ISE Dept., University of Florida, forthcoming.

2 Yamai, Y. and T. Yoshiba. On the Validity of Value-at-Risk: Comparative Analyses with Expected Shortfall. Institute for Monetary and Economic Studies. Bank of Japan. IMES Discussion Paper 2001-E-4, 2001.

(Can be downloaded: www.imes.boj.or.jp/english/publication/edps/fedps_2001index.html)

Page 6: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Value-at-Risk Features (cont’d)

• since VaR does not take into account risks exceeding VaR, it may provide conflicting results at different confidence levels:

e.g., at 95% confidence level, foreign stocks may be dominant risk contributors, and at 99% confidence level, domestic stocks may be dominant risk contributors to the portfolio risk

• non-sub-additive and non-convex: non-sub-additivity implies that portfolio diversification may increase the risk

• incoherent in the sense of Artzner, Delbaen, Eber, and Heath1

• difficult to control/optimize for non-normal distributions: VaR has many extremums

1Artzner, P., Delbaen, F., Eber, J.-M. Heath D. Coherent Measures of Risk,

Mathematical Finance, 9 (1999), 203--228.

Page 7: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Value-at-Risk Example

- normally distributed random variable with mean and standard deviation

-2 2 4 6 8

0.05

0.1

0.15

0.2

2

p( )

VaR

area = 1-

)()()(VaR 1 k

Page 8: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Value-at-Risk Example (cont'd)

)()()(VaR 1 k

)12(erf2)( 1 k

tdtzz

0

2 )exp(2

)erf(

65.1)95.0( k

33.2)99.0( k

Page 9: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Conditional Value-at-Risk Definition

Notations:

Ψ = cumulative distribution of random variable ,

Ψ = -tail distribution, which equals to zero for below VaR, and equals to (Ψ- )/(1- ) for exceeding or equal to VaR

Definition: CVaR is mean of -tail distribution Ψ

Cumulative Distribution of , Ψ

0 VaR

1

Ψ()

1

0

1

VaR

-Tail Distribution, Ψ

Ψ()

Page 10: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Conditional Value-at-Risk Definition (cont’d)

Notations:

CVaR+ ( “upper CVaR” ) = expected value of strictly exceeding

VaR (also called Mean Excess Loss and Expected Shortfall)

CVaR- ( “lower CVaR” ) = expected value of weakly exceeding VaR, i.e., value of which is equal to or exceed VaR (also called Tail VaR)

Ψ (VaR) = probability that does not exceed VaR or equal to VaR

Property: CVaR is weighted average of VaR and CVaR+)(CVaR)1(VaR)(CVaR

10,)1()(

Page 11: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Conditional Value-at-Risk Definition (cont’d)

Random variable,

Fr

eq

ue

nc

y

VaR

CVaR

Probability

Maximal value

Page 12: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Conditional Value-at-Risk Features

simple convenient representation of risks (one number)

measures downside risk

applicable to non-symmetric loss distributions

CVaR accounts for risks beyond VaR (more conservative than VaR)

CVaR is convex with respect to control variables

VaR CVaR- CVaR CVaR+

coherent in the sense of Artzner, Delbaen, Eber and Heath3:

(translation invariant, sub-additive, positively homogeneous, monotonic w.r.t. Stochastic Dominance1)

1Rockafellar R.T. and S. Uryasev (2001): Conditional Value-at-Risk for General Loss Distributions. Research Report 2001-5. ISE Dept., University of Florida, April 2001. (Can be downloaded: www.ise.ufl.edu/uryasev/cvar2.pdf)

2 Pflug, G. Some Remarks on the Value-at-Risk and the Conditional Value-at-Risk, in ``Probabilistic Constrained Optimization: Methodology and Applications'' (S. Uryasev ed.), Kluwer Academic Publishers, 2001.

3Artzner, P., Delbaen, F., Eber, J.-M. Heath D. Coherent Measures of Risk, Mathematical Finance, 9 (1999), 203--228.

Page 13: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Conditional Value-at-Risk Features (cont'd)

x

Risk

VaR

CVaR

CVaR+

CVaR-

CVaR is convex, but VaR, CVaR- ,CVaR+ may be non-convex,

inequalities are valid: VaR CVaR- CVaR CVaR+

Page 14: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Conditional Value-at-Risk Features (cont'd)

stable statistical estimates (CVaR has integral characteristics compared to VaR which may be significantly impacted by one scenario)

CVaR is continuous with respect to confidence level , consistent at different confidence levels compared to VaR ( VaR, CVaR-, CVaR+ may be discontinuous in )

consistency with mean-variance approach: for normal loss distributions optimal variance and CVaR portfolios coincide

easy to control/optimize for non-normal distributions;

linear programming (LP): can be used for optimization of very large problems (over 1,000,000 instruments and scenarios); fast, stable algorithms

loss distribution can be shaped using CVaR constraints (many LP constraints with various confidence levels in different intervals)

can be used in fast online procedures

Page 15: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Conditional Value-at-Risk Features (cont'd)

qdq

1

)()(CVaR1

1

CVaR for continuous distributions usually coincides with conditional expected loss exceeding VaR (also called Mean Excess Loss or Expected Shortfall).

However, for non-continuous (as well as for continuous) distributions CVaR may differ from conditional expected loss exceeding VaR.

Acerbi et al.1,2 recently redefined Expected Shortfall to be consistent with CVaR definition:

Acerbi et al.2 proved several nice mathematical results on properties of CVaR, including asymptotic convergence of sample estimates to CVaR.

1Acerbi, C., Nordio, C., Sirtori, C. Expected Shortfall as a Tool for Financial Risk Management, Working Paper, can be downloaded: www.gloriamundi.org/var/wps.html

2Acerbi, C., and Tasche, D. On the Coherence of Expected Shortfall. Working Paper, can be downloaded: www.gloriamundi.org/var/wps.html

Page 16: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

CVaR: Continuous Distribution, Example 1

- normally distributed random variable with mean and standard deviation

2

)()](|[CVaR 1kE

-2 2 4 6 8

0.05

0.1

0.15

0.2

p( )

VaR

area = 1-

CVaR

Page 17: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

CVaR: Continuous Distribution, Example 1

- normally distributed random variable with mean and st. dev.

1211 )1()12(erfexp2)(

k

tdtzz

0

2 )exp(2

)erf(

67.2)99.0(1 k

)()](|[CVaR 1kE

06.2)95.0(1 k

Page 18: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

CVaR: Discrete Distribution, Example 2

does not “split” atoms: VaR < CVaR- < CVaR = CVaR+, = (Ψ- )/(1- ) = 0

1 2 41 2 6 6 3 6

1 15 62 2

Six scenarios, ,

CVaR CVaR =

p p p

f f

L+

Probability CVaR

16

16

16

16

16

16

1f 2f 3f 4f 5f 6f

VaR --CVaR

+CVaRLoss

Page 19: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

CVaR: Discrete Distribution, Example 3

“splits” the atom: VaR < CVaR- < CVaR < CVaR+, = (Ψ- )/(1- ) > 0

711 2 6 6 1 2

1 4 1 2 24 5 65 5 5 5 5

S i x s c e n a r i o s , ,

C V a R V a R C V a R =

Lp p p

f f f+

P r o b a b i l i t y C V a R

16

16

16

16

11 2

16

16

1f 2f 3f 4f 5f 6f

V a R - -C V a R

+1 15 62 2 C V a R f f

L o s s

Page 20: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

CVaR: Discrete Distribution, Example 4

“splits” the last atom: VaR = CVaR- = CVaR,

CVaR+ is not defined, = (Ψ - )/(1- ) > 0

711 2 3 4 4 8

4

Four scenarios, ,

CVaR VaR =

p p p p

f

Probability CVaR

14

14

14

14

18

1f 2f 3f 4f

VaRLoss

Page 21: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Formulation of Optimization Problem

- random variable, x - vector of control variables

),( xf = loss or reward

Stochastic functions:

Notations:

0min ( ( , ))

. .

( ( , )) 0, 1, ,

,

j

F f x

s t

F f x j n

x X

(.)CVaR(.)jαjF

Optimization problem:

where for some of j :

Page 22: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Examples

1. 2.

3.

.0

,),(

..

),(CVaRmin

x

xfE

ts

xfx

.0

,),(CVaR,),(CVaR

..

),(max

21 21

x

xfxf

ts

xfEx

),( xf = loss function),( xf = reward function,

.0

,),(CVaR

..

),(max

x

xf

ts

xfEx

Page 23: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Examples (cont'd)

4.

.0,),(

..

),(CVaR),(CVaRmin21 21

xxfE

ts

xfxfx

5.

.0,),(CVaR)(..

),(max

1

0

xdxfts

xfEx

6.

.0,),(..

),(CVaR)(min1

0

xxfEts

dxfx

Page 24: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Optimization Techniques

Notations:1( , ) (1 ) [ ( , ) ] ( ) ,

max { , 0}

F x f x p d

z z

Theorem 1

a) -VaR is a minimizer of F with respect to :

VaR ( , ) ( , ) arg min ( , )f x f x F x

b) - CVaR equals minimal value (w.r.t. ) of function F :

CVaR ( , ) min ( , )f x F x

Remark. This equality can be used as a definition of CVaR ( Pflug ).

Page 25: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Optimization Techniques (cont'd)Proof:

1

1

( , ) 1 (1 ) ( , ) ( )

1 (1 ) ( , ) 0,

F x I f x p d

P f x

where

),(,0

),(,1),(

xf

xfxfI

Consequently,

).(1),( * xfP

b) * * 1 *min ( , ) ( , ) (1 ) [ ( , ) ] ( ) .F x F x f x p d

a) (in the case of continuous distribution)

Integral of losses exceeding VaR

Page 26: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Optimization Techniques (cont'd)

Theorem 2

,min CVaR ( , ) min ( , )

x xf x F x

Proof:

,

min ( , ) min min ( , ) min CVaR ( , )x x x

F x F x f x

• Minimization of G (x, ) simultaneously calculates VaR = a(x), optimal decision x and optimal CVaR

• CVaR minimization can be reduced to LP using dummy variables

Page 27: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Reduction to LP

[ ( , ) ] ( , ) , 0, 1,k kk kf x z f x z k N

1

1

( , ) (1 ) [ ( , ) ]

max { , 0}

Nk

kk

F x p f x

z z

In the case of discrete distribution:

Discrete distribution (continuous distribution can be approximated using scenarios).

),(),(,1,)(,1

kN

kkk

k xfxfppp

Reduction to LP by expanding the problem dimension:

Page 28: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Reduction to LP (cont'd) CVaR minimization

min{ xX } CVaR

is reduced to the following linear programming (LP) problem

By solving LP we find an optimal x* , corresponding VaR, which equals to the lowest optimal *, and minimal CVaR, which equals to the optimal value of the linear performance function

Constraints, x X , may account for various constraints, including constraint on expected value

Similar to return - variance analysis, we can construct an efficient frontier and find a tangent portfolio

.,,1,0

,,1,),(..

)1(min1

1

,

XxNkz

Nkxfzts

zp

k

kk

N

kkk

x

Page 29: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Reduction to LP (cont'd)

CVaR constraints in optimization problems can be replaced by a set of linear constraints. E.g., the following CVaR constraint CVaR C

is replaced by linear constraints

Loss distribution can be shaped using multiple CVaR constraints at different confidence levels in different times

.,1,0,),(..

)1(1

1

Nkzxfzts

Czp

kk

k

N

kkk

Page 30: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Financial Engineering Applications

Notations:x = (x1,…,xn) = decision vector (e.g., portfolio weights)X = a convex set of feasible decisions = (1,…,n) = random vector j = scenario of random vector , ( j=1,...J )f(x,) = T x = reward function

- f(x,) = - T x = loss function

Example: Two Instrument Portfolio A portfolio consists of two instruments (e.g., options). Let x = (x1, x2) be a vector of

positions, m = (m1, m2) be a vector of initial prices, and y = (1, 2) be a vector of uncertain prices in the next day. The loss function equals the difference between the current value of the portfolio, (x1m1+x2m2), and an uncertain value of the portfolio at the next day (x11+x22), i.e.,

  - f(x,) = (x1m1+x2m2) – (x11+x22) = x1(m1–1) + x2(m2–2) .  

If we do not allow short positions, the feasible set of portfolios is a two-dimensional set of non-negative numbers  

X = {(x1,x2), x1 0, x2 0} .   Scenarios j = ( j

1,j2), j=1,...J , are sample daily prices (e.g., historical data for J

trading days).

Portfolio optimization

Page 31: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Financial Engineering Applications (cont'd)CVaR and Mean Variance: normal returns

If returns are normally distributed, and return constraint is active, the following portfolio optimization problems have the same solution:

1. Minimize CVaR subject to return and other constraints

2. Minimize VaR subject to return and other constraints

3. Minimize variance subject to return and other constraints

2( , ) , ( )T TE f x m x x x V x

RxmT

1,01

n

iii xxxX

Mean return and variance:

No-shorts and budget constraints:

Return constraint:

Page 32: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Financial Engineering Applications (cont'd)Optimization problem formulations

1min ( ) ( )min CVaR ( , )

. . ,. . , .xx

TT

k x Rf x

s t m x R x Xs t m x R x X

2min ( )

. . ,

x

T

x

s t m x R x X

CVaR minimization (assumption: risk constraint is active):

VaR minimization (assumption: risk constraint is active):

Variance minimization:

min ( ) ( )min VaR ( , )

. . ,. . , .xx

TT

k x Rf x

s t m x R x Xs t m x R x X

Page 33: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Financial Engineering Applications (cont'd)Optimization problem formulations (cont'd):

)12(erf2)( 1 k

1211 )1()12(erfexp2)(

k

tdtzz

0

2 )exp(2

)erf(

06.2)95.0(1 k

67.2)99.0(1 k

65.1)95.0( k

33.2)99.0( k

Page 34: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Example Data:

INSTRUMENT MEAN RETURNS&P 0.0101110

Gov Bond 0.0043532Small Cap 0.0137058

S&P GOV BOND SMALL CAPS&P 0.00324625 0.00022983 0.00420395

GOV BOND 0.00022983 0.00049937 0.00019247SMALL CAP 0.00420395 0.00019247 0.00764097

Portfolio Mean return

Portfolio Covariance Matrix

Page 35: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Example (cont'd)Results:

Optimal Portfolio with the Minimum Variance Approach

Optimal VaR and CVaR with the Minimum Variance Approach

S&P GOV BOND SMALL CAP0.452013 0.115573 0.432414

9.0 95.0 99.0VaR 0.067848 0.090200 0.132128

CVaR 0.096975 0.115908 0.152977

Page 36: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Example (cont'd)

The Portfolio, VaR and CVaR with the Minimum CVaR Approach

Page 37: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

STOCHASTIC WTA PROBLEM

Weapon-Target Assignment (WTA) problem: find an optimal assignment of I weapons to K targets

I weapons with different munitions capacities

K targets to be destroyed

Page 38: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

STOCHASTIC WTA PROBLEM

Define:

vik = 1, if weapon i fires at target k, vik = 0 otherwise

xik is a number of munitions to be fired by weapon i at target k

cik is the cost of firing 1 unit of munitions i at target k

mi is the munitions capacity of weapon i

ti is the maximum number of targets that weapon i can attack

pik is the probability of destroying target k by firing 1 unit of munitions by weapon i

dk is the minimum required probability of destroying target k

Minimize total cost of the mission subject to the destruction of all targets with prescribed probabilities and constraints on munitions

WTA problem is formulated as a Mixed Integer Linear Programming Problem (MILP)

Page 39: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

WTA WITH UNCERTAIN PROBABILITIES

WTA with known probabilities of destroying:

minimize the cost of the mission

constraint on the munitionscapacities of the weapons

constraint on how many targets a

weapon can attack

destroy all targets with prescribed probabilities

(can be linearized!)

1 1

1

1

1

min

s.t. , 1,..., ,

, 1,..., , 1,..., ,

, 1,..., ,

1 (1 ) , 1,..., ,ik

K I

ik ikk i

K

ik ik

ik i ik

K

ik ik

Ix

ik ki

c x

x m i I

x m v i I k K

v t i I

p d k K

Page 40: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

WTA WITH UNCERTAIN PROBABILITIES

Introduce uncertainty in the model by making probabilities pik dependent on the random parameter : pik = pik()

Assume a scenario model for stochastic parameters

WTA with uncertain probabilities:

CVaR constraint on risk of failure to destroy a target

1

( , ) ln(1 ( )) ln(1 )I

k ik ik ki

L x p x d

1 1

1

1

min

s.t. , 1,..., ,

, 1,..., , 1,..., ,

, 1,..., ,

CVaR[ ( , ] 1,..., ,

K I

ik ikx

k i

K

ik ik

ik i ik

K

ik ik

k k

c x

x m i I

x m v i I k K

v t i I

L x C k K

Loss function Lk(x,) quantifies the risk of not destroying target k

Page 41: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

EXAMPLE: STOCHASTIC WTA PROBLEM 5 targets (K = 5)

5 aircraft, each with 4 missiles (I = 5, mi = 4)

probabilities and costs do not depend on targets to be attacked

20 scenarios for pik() = pi(s)

any aircraft can attack any target (ti = 5)

destroy targets with 95% confidence (dk = 0.95)

90% confidence level in CVaR constraints ( = 0.90)

T 1 T 2 T 3 T 4 T 5

Weapon 1 0 2 1 0 0

Weapon 2 0 1 2 0 0

Weapon 3 1 0 0 1 1

Weapon 4 1 0 0 1 1

Weapon 5 0 0 0 0 0

T 1 T 2 T 3 T 4 T 5

Weapon 1 0 1 1 0 1

Weapon 2 0 0 1 1 1

Weapon 3 2 0 0 1 0

Weapon 4 0 1 1 0 1

Weapon 5 1 1 0 1 0

Optimal solution of WTA with uncertain probabilities:

Optimal solution of WTA with known probabilities:

0.4

0.5

0.6

0.7

0.8

0.9

1

0.5 0.6 0.7 0.8 0.9

Average probability of hitting a target

Co

st o

f fi

rin

g

Page 42: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Statistics Applications Regression

a

x

y

tanb

.

.

.

..

. .

.

jj

jjj yy ˆDiscrete case:

nP j 1)(

jj xbay ˆ

Linear estimation:

yy ˆDeviation is a random value with density

xbay ˆEstimationLinear

)(p

),,,(ˆEstimationNonlinear 1 maaxy

maa ,,1 are unknown parameters

Page 43: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Statistics Applications (cont'd)Distribution of random deviation

Deviation,

Fr

eq

ue

nc

y

Page 44: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Statistics Applications (cont'd)

Quadratic metrics:

N

jj

aa m 1

2

,,1

min

Discrete case:

Continuous case:

dpmaa

)(min 2

,,1

Regression in general case:

Parameters can be found using different metrics

)var(

),cov(],[

)var(

),cov(][

x

yxbxE

x

yxyEa

Solution in the case of linear estimation :

- metrics, which can be expressed as function of deviation, .

)(min)ˆ,(min,,,, 11

gEyyEmm aaaa

)ˆ,( yy

22ˆ)ˆ,( yyyy

xbay ˆ

maa ,,1

Page 45: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Statistics Applications (cont'd)Absolute deviation:

N

jj

aa m 1,,

||min1

Discrete case:

Continuous case:

dpmaa

)(||min,,1

||ˆ)ˆ,( yyyy

In the case of the discrete distribution and linear regression function the problemcan be reduced to LP

.

,..

min1

,,,, 1

jjj

jjj

N

jj

uuba

yxbau

xbayuts

uN

Page 46: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Statistics Applications (cont'd)

Probability 10% Probability 10%

Mean of the right tail Mean of the left tail

1 2min CVaR ( ) CVaR ( )

9.021

Page 47: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Statistics Applications (cont'd)Reduction to LP (discrete case):

1 1

2 2

1 11 1 1

1

1 12

1

(1 ) [ ]

(1 ) [ ]

N

jj

N

jj

N

N

.,1,0,0

,,

,0,..

)1()1(min

21

2211

1

12

121

11

112

,,,

,

21

21

Njzz

uzuz

xbayts

zzNuu

jj

jjjj

N

jjjjj

N

jjj

zzuu

ba

jj

Page 48: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

FACTOR MODELS:PERCENTILE and CVaR REGRESSION

1 , ..., qX X

Y factors from various sources of information

failure load

0 1 1 , ..., ,q qY c c X c X where is an error term

= direct estimator of percentile with confidence

0 1 1 , ..., q qc c X c X

10% points below line:

= 10%

X

Y

Percentile regression (Koenker and Basset (1978))

CVaR regression (Rockafellar, Uryasev, Zabarankin (2003))

Page 49: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

PERCENTILE ERROR FUNCTION and CVaR DEVIATION

Statistical methods based on asymmetric percentile error

functions: [(1 )( ) ]E

= positive part of error

= negative part of error

CVaRFailure

Success

Percentile

Mean

CVaR deviation

Page 50: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Accident lost

Payment

Accident lost

Payment

Premium

Deductible

Payment

PDF

Payment

PDF

Premium

Deductible

Page 51: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Payment

PDF

Payment

PDF

Premium

Deductible

Payment

CDF

1

Payment

CDF

Premium

Deductible

0p

1

0p- probability of driving without accident

Page 52: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Example 1: Nikkei Portfolio

Distribution of losses for the NIKKEI portfolio with best normal approximation(1,000 scenarios)

Page 53: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Ex. 1: Nikkei Portfolio (cont'd)

NIKKEI Portfolio

Page 54: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Ex. 1: Nikkei Portfolio (cont'd)

Page 55: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Ex. 1: Hedging – Minimal CVaR Approach

Page 56: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Ex. 1: One Instrument Hedging

Page 57: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Ex. 1: One Instrument Hedging (cont'd)

Page 58: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Ex. 1: Multiple Instrument Hedging CVaR approach

Page 59: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Ex. 1: Multiple-Instrument Hedging

Page 60: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Ex. 1: Multiple-Instrument Hedging: Model Description

Page 61: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Ex. 1: Multiple-Instrument Hedging: Optimization Problem

n

dpT

RyXx

yyxzym )(]),()[()1(min,

J

j

Tj

T Jdpn 1

1 ]),()[()(]),()[( xzymyyxzymRy

Formulation:

Approximation for discrete case:

J

j

TjJ

1

1

,]),()[()1(min

xzym

Xx

Optimization problem:

Page 62: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Example 2: Portfolio Replication Using CVaR

• Problem Statement: Replicate an index using instruments. Consider impact of CVaR constraints on characteristics of the replicating portfolio.

• Daily Data: SP100 index, 30 stocks (tickers: GD, UIS, NSM, ORCL, CSCO, HET, BS,TXN, HM, INTC, RAL, NT, MER, KM, BHI, CEN, HAL, DK, HWP, LTD, BAC, AVP, AXP, AA, BA, AGC, BAX,

AIG, AN, AEP)

• Notations = price of SP100 index at times = prices of stocks at times = amount of money to be on hand at the final time = = number of units of the index at the final time

= number of units of j-th stock in the replicating portfolio

• Definitions (similar to paper1 ) = value of the portfolio at time

= absolute relative deviation of the portfolio from the target

= relative portfolio underperformance compared to target at time

1Konno H. and A. Wijayanayake. Minimal Cost Index Tracking under Nonlinear Transaction Costs and Minimal Transaction Unit Constraints,Tokyo Institute of Technology, CRAFT Working paper 00-07,(2000).

1, ,t T tIj tp 1, ,j n 1, ,t T T

TIT

jx

t1

n

j t jj

p x

1

| ( ) /( ) |n

t j t j tj

I p x I

tI

1, ,j n

t1

( , ) ( ) /( )n

t t j t j tj

f x p I p x I

Page 63: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Ex. 2: Portfolio Replication Using CVaR (Cont’d)

Index and optimal portfolio values in in-sample region, CVaR constraint is inactive (w = 0.02)

0

2000

4000

6000

8000

10000

12000

1 51 101 151 201 251 301 351 401 451 501 551

Day number: in-sample region

Po

rtfo

lio

val

ue

(US

D)

portfolio

index

Page 64: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Index and optimal portfolio values in out-of-sample region, CVaR constraint is inactive (w = 0.02)

8500

9000

9500

10000

10500

11000

11500

12000

1 7 13

19

25

31

37

43

49

55

61

67

73

79

85

91

97

Day number in out-of-sample region

Po

rtfo

lio

val

ue

(US

D)

portfolio

index

Ex. 2: Portfolio Replication Using CVaR (Cont’d)

Page 65: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Index and optimal portfolio values in in-sample region, CVaR constraint is active (w = 0.005).

0

2000

4000

6000

8000

10000

12000

1 51 101

151

201

251

301

351

401

451

501

551

Day number: in-sample region

Po

rtfo

lio

val

ue

(US

D)

portfolioindex

Ex. 2: Portfolio Replication Using CVaR (Cont’d)

Page 66: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Index and optimal portfolio values in out-of-sample region, CVaR constraint is active (w = 0.005).

8500

9000

9500

10000

10500

11000

11500

12000

1 7 13 19 25 31 37 43 49 55 61 67 73 79 85 91 97

Day number in out-of-sample region

Po

rtfo

lio

va

lue

(U

SD

)

portfolioindex

Ex. 2: Portfolio Replication Using CVaR (Cont’d)

Page 67: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Relative underperformance in in-sample region, CVaR constraint is active (w = 0.005) and inactive (w = 0.02).

-6

-5

-4

-3

-2

-1

0

1

2

3

1 51 101 151 201 251 301 351 401 451 501 551

Day number: in-sample region

Dis

crep

ancy

(%

)

active

inactive

Ex. 2: Portfolio Replication Using CVaR (Cont’d)

Page 68: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Relative underperformance in out-of-sample region, CVaR constraint is active (w = 0.005) and inactive (w = 0.02)

-2

-1

0

1

2

3

4

5

6

1 6 11 16 21 26 31 36 41 46 51 56 61 66 71 76 81 86 91 96

Day number in out-of-sample region

Dis

cre

pa

nc

y (

%)

active

inactive

Ex. 2: Portfolio Replication Using CVaR (Cont’d)

Page 69: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

In-sample objective function (mean absolute relative deviation), out-of-sample objective function, out-of-sample CVaR for various risk levels w in CVaR constraint.

0

1

2

3

4

5

6

0.02 0.01 0.005 0.003 0.001

omega

Va

lue

(%

)

in-sample objectivefunction

out-of-sample objectivefunction

out-of-sample CVAR

Ex. 2: Portfolio Replication Using CVaR (Cont’d)

Page 70: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

• Calculation results

• CVaR constraint reduced underperformance of the portfolio versus the index both in the in-sample region (Column 1 of table) and in the out-of-sample region (Column 4) . For w =0.02, the CVaR constraint is inactive, for w 0.01, CVaR constraint is active. • Decreasing of CVaR causes an increase of objective function (mean absolute deviation) in the in-sample

region (Column 2). • Decreasing of CVaR causes a decrease of objective function in the out-of-sample region (Column 3).

However, this reduction is data specific, it was not observed for some other datasets.

CVaR in-sample (600 days) out-of-sample (100 days) out-of-sample CVaR

level w objective function, in % objective function, in % in %

0.02 0.71778 2.73131 4.88654

0.01 0.82502 1.64654 3.88691

0.005 1.11391 0.85858 2.62559

0.003 1.28004 0.78896 2.16996

0.001 1.48124 0.80078 1.88564

Ex. 2: Portfolio Replication Using CVaR (Cont’d)

Page 71: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

In-sample-calculations: w = 0.005

• Calculations were conducted using custom developed software (C++) in combination with CPLEX linear programming solver

• For optimal portfolio, CVaR= 0.005. Optimal *= 0.001538627671 gives VaR. Probability of the VaR point is 14/600 (i.e.14 days have the same deviation= 0.001538627671). The losses of 54 scenarios exceed VaR. The probability of exceeding VaR equals

54/600 < 1- , and

= (Ψ(VaR) -- [546/600 - 0.9]/[1 - 0.9] = 0.1

• Since “splits” VaR probability atom, i.e., Ψ(VaR) - >0, CVaR is bigger than CVaR- (“lower CVaR”) and smaller than CVaR+ ( “upper CVaR”, also called expected shortfall)

CVaR- = 0.004592779726 < CVaR = 0.005 < CVaR+=0.005384596925

• CVaR is the weighted average of VaR and CVaR+

CVaR = VaR + (1- ) CVaR+= 0.1 * 0.001538627671 + 0.9 * 0.005384596925= 0.005

• In several runs, * overestimated VaR because of the nonuniqueness of the optimal solution. VaR equals the smallest optimal *.

Ex. 2: Portfolio Replication Using CVaR (Cont’d)

Page 72: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Example 3: Asset Liability Management (ALM)

Active members

Non-Active Members

Risk Management

Pension Fund

Payments? Future liabilities?

Page 73: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Ex. 3: ALM – Data

• ORTEC Consultants BV in Holland provided a dataset for a pension fund

• 10000 scenarios: liabilities of a fund and returns for 13 assets (indices)

• To simplify interpretation of results, mostly, we considered only four assets:

1. cash, 2. Dutch bonds index, 3. European equity index, 4. Dutch real estate index.

• However, the approach can easily handle 100,000 assets.

Page 74: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Ex. 3: ALM – Data Statistics

Page 75: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Ex. 3: ALM – Notations • Parameters = total initial value of all assets

= total amount of wages

= total amount of liabilities due at the start of the planning period

= lower bound of funding ratio

• Random data = random rate of return in asset class i, ( i = 0,…,N )

= liability that needs to be met or exceeded

• Decision variables = contribution rate

= total invested amount in asset class i, ( i = 0,…,N )

0

0A

ir

y

0W

ix

L

Page 76: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Ex. 3: ALM – Minimization of Contributions

minimize

subject to

with high certainty

free

• constraint on funding ratio, can be defined using CVaR risk measure

• loss function:

• with high certainty => CVaR w

0

1N

ψ i if ( x ,r ,L ) L ( r )x ,

0

11

N

i i( r )x ,L

0 , 0,...,ix i N

,y

y

0

11

N

i i( r )x ,L

0 0 0

N

ix A W y

0

11

N

i i( r )x ,L

Page 77: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Ex. 3: ALM – Linear Programming Formulation

minimize (1)

subject to

free

0 , 0,...,ix i N

0 0 0

N

ix A W y

J

jj

z w

0

1 1N

j ij i ji

L ( r )x z , j ,...,J

0 , 1,...,jz j j

y ,

y

Page 78: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Ex. 3: ALM – Properties of Solutions • Let w = 0 and y *, x *, * is an optimal solution of problem (1). Consider a

new funding ratio coefficient ' = t . New solution vector equals

(t (y * + A0/W0) - A0/W0 ,t x *, t * * ) .

• Optimal relative portfolio allocations DO NOT DEPEND upon funding ratio coefficient (which is a risk parameter)!!!

• Linear efficient frontier: contribution rate linearly depends upon the funding ratio parameter !!!

• VaR linearly depends upon the funding ratio parameter !!!

• If L is deterministic, then optimal relative portfolio allocations DO NOT DEPEND upon CVaR risk parameter w !!! Also, VaR and contribution rate of optimal solution linearly depend upon w !!!

Page 79: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Ex. 3: ALM – Linear Dependence of Contribution on

E fficient frontier

-2

-1.5

-1

-0.5

0

0.5

0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4

Psi

Contribution rate

Page 80: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Ex. 3: ALM – Linear Dependence of Portfolio on

Optimal portfolio allocation

0.0000

0.2000

0.4000

0.6000

0.8000

1.0000

1.2000

1 2 3 4 5 6 7 8 9 10 11

Psi

re NL

eq EM

bond cp NL

Page 81: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Ex. 3: ALM – Return Maximization

maximize

subject to

free

• Contribution to the fund, , is fixed

0 , 0,...,ix i N

0 0 N

ix A B0

J

jj

z w

0

1 1N

j ij i ji

L ( r )x z , j ,...,J

0 , 1,...,jz j j

,

i

J

j

N

iji xr

J

1 0

)1(1

0B

Page 82: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Return maximization and Contribution minimization (random L)

0

0.02

0.04

0.06

0.08

0.1

0.12

0.14

0.16

-50.00% -30.00% -10.00% 10.00% 30.00% 50.00% 70.00% 90.00% 110.00%

CVaR constraint parameter w

Po

rtfo

lio r

etu

rn

Return max" Contrib min"

Ex. 3: ALM – Results

Page 83: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Optimal portfolio allocations (stochastic L)

0%10%

20%30%

40%50%60%

70%80%

90%100%

CVaR constraint parameter w

Po

rtfo

lio

allo

cati

on

s priv eq, m=11.5, std=30

eq UK, m=8.5, std=18

eq J P, m=10, std=28.6

eq US, m=10.5, std=15

bond UK, m=5, std=1.9

bond US, m=6.4, std=0.9

Ex. 3: ALM – Results (cont'd)

Page 84: Stochastic Optimization ESI 6912 Instructor: Prof. S. Uryasev NOTES 7: Algorithms and Applications.

Optimal portfolio allocations (deterministic L)

0%

10%

20%

30%

40%

50%

60%

70%

80%

90%

100%

CVaR constraint parameter w

Po

rtfo

lio

allo

cati

on

s

eq EM, m=16.Std=37.3

eq US, m=10.5,std=15

bond US, m=6.4,std=0.9

Ex. 3: ALM – Results (cont'd)