luk a s adam - univerzita karlovamsekce.karlin.mff.cuni.cz/~vorisek/seminar/1314z/1314z_adam.pdf ·...

21
Introduction Basic algorithm Modified algorithm Results A heuristic for moment-matching scenario generation Luk´ s Adam 4. 11. 2013 1 / 21 A heuristic for moment-matching scenario generation

Upload: others

Post on 23-May-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Luk a s Adam - Univerzita Karlovamsekce.karlin.mff.cuni.cz/~vorisek/Seminar/1314z/1314z_Adam.pdf · Consider a symmetric real matrix R. Then R is positive de nite if and only if there

Introduction Basic algorithm Modified algorithm Results

A heuristic for moment-matching scenario generation

Lukas Adam

4. 11. 2013

1 / 21

A heuristic for moment-matching scenario generation

Page 2: Luk a s Adam - Univerzita Karlovamsekce.karlin.mff.cuni.cz/~vorisek/Seminar/1314z/1314z_Adam.pdf · Consider a symmetric real matrix R. Then R is positive de nite if and only if there

Introduction Basic algorithm Modified algorithm Results

Table of contents

1 Introduction

2 Basic algorithm

3 Modified algorithm

4 Results

2 / 21

A heuristic for moment-matching scenario generation

Page 3: Luk a s Adam - Univerzita Karlovamsekce.karlin.mff.cuni.cz/~vorisek/Seminar/1314z/1314z_Adam.pdf · Consider a symmetric real matrix R. Then R is positive de nite if and only if there

Introduction Basic algorithm Modified algorithm Results

Introduction

Consider an optimization stochastic problem. To solve the problemone must

1 Convert the continuous normal distribution into a discrete one2 Solve the resulting problem

With increasing number of random variables the importance of thefirst part increases.

We will be interested purely in the first part.

3 / 21

A heuristic for moment-matching scenario generation

Page 4: Luk a s Adam - Univerzita Karlovamsekce.karlin.mff.cuni.cz/~vorisek/Seminar/1314z/1314z_Adam.pdf · Consider a symmetric real matrix R. Then R is positive de nite if and only if there

Introduction Basic algorithm Modified algorithm Results

Goal

Problem how to represent the random variable

Especially with multidimensional distributions

Goal: to generate from a joint distribution with specified values ofthe first four marginal moments and correlations

Intention: to generate from one–dimensional standard normaldistribution and using an iterative procedure to achieve the goal

This iterative procedure combines simulation, Choleskydecomposition and various transformations

4 / 21

A heuristic for moment-matching scenario generation

Page 5: Luk a s Adam - Univerzita Karlovamsekce.karlin.mff.cuni.cz/~vorisek/Seminar/1314z/1314z_Adam.pdf · Consider a symmetric real matrix R. Then R is positive de nite if and only if there

Introduction Basic algorithm Modified algorithm Results

General idea

Generate n discrete univariate random variables from N(0, 1).

Perform the cubic transformation to reach the prescribed moments.

Transform them so that the correlation is satisfied.

This transformation will distort the marginal moments of higherthan second order.

Start with different higher moments and repeat.

Produces exact results only if random variables are independent.Instead of it, a possible outcome error is allowed.

5 / 21

A heuristic for moment-matching scenario generation

Page 6: Luk a s Adam - Univerzita Karlovamsekce.karlin.mff.cuni.cz/~vorisek/Seminar/1314z/1314z_Adam.pdf · Consider a symmetric real matrix R. Then R is positive de nite if and only if there

Introduction Basic algorithm Modified algorithm Results

Cholesky decomposition

Theorem

Consider a symmetric real matrix R. Then R is positive definite ifand only if there is a regular lower triangular matrix L such thatR = LLT .Similarly, R is positive semidefinite if and only if the decompositionstill holds true but L may have zeros on its main diagonal.

6 / 21

A heuristic for moment-matching scenario generation

Page 7: Luk a s Adam - Univerzita Karlovamsekce.karlin.mff.cuni.cz/~vorisek/Seminar/1314z/1314z_Adam.pdf · Consider a symmetric real matrix R. Then R is positive de nite if and only if there

Introduction Basic algorithm Modified algorithm Results

Correlation matrix assumptions

1 Correlation matrix R is possible, hence it is symmetric, positivesemidefinite with ones on the main diagonal.

Otherwise the Cholesky decomposition fails.If it is not satisfied, either check the input data or find a closestcorrelation matrix.

2 R is positive definite.

It is again checked by the Cholesky decomposition.If this is not the case, some variables can be computed from othersand hence, the dimension of the problem may be reduced.

7 / 21

A heuristic for moment-matching scenario generation

Page 8: Luk a s Adam - Univerzita Karlovamsekce.karlin.mff.cuni.cz/~vorisek/Seminar/1314z/1314z_Adam.pdf · Consider a symmetric real matrix R. Then R is positive de nite if and only if there

Introduction Basic algorithm Modified algorithm Results

Transformations

1 Cubic transformation

To generate univariate distributions with specific moments.

2 Matrix transformation

To transform a multivariate distribution to obtain a givencorrelation matrix.Destroys higher order moments.

8 / 21

A heuristic for moment-matching scenario generation

Page 9: Luk a s Adam - Univerzita Karlovamsekce.karlin.mff.cuni.cz/~vorisek/Seminar/1314z/1314z_Adam.pdf · Consider a symmetric real matrix R. Then R is positive de nite if and only if there

Introduction Basic algorithm Modified algorithm Results

Cubic transformation

Yi = a + bXi + cX 2i + dX 3

i

EYi = a + bEXi + cEX 2i + dEX 3

i

EY 2i = a2 + · · · + d2EX 6

i

. . .

EY 4i = a4 + · · · + d4EX 12

i

If all the moments of X and Y are known, the system may besolved for (a, b, c , d).

It may happen that the system has no solution, in such a caseminimize the distance of the discrepancies.

9 / 21

A heuristic for moment-matching scenario generation

Page 10: Luk a s Adam - Univerzita Karlovamsekce.karlin.mff.cuni.cz/~vorisek/Seminar/1314z/1314z_Adam.pdf · Consider a symmetric real matrix R. Then R is positive de nite if and only if there

Introduction Basic algorithm Modified algorithm Results

Summary

1 Take some random variable Xi with the same number of outcomesas Yi

2 Calculate the first 12 moments of Xi

3 Compute the parameters a, b, c, d4 Compute the outcomes as Yi = a + bXi + cX 2

i + dX 3i

10 / 21

A heuristic for moment-matching scenario generation

Page 11: Luk a s Adam - Univerzita Karlovamsekce.karlin.mff.cuni.cz/~vorisek/Seminar/1314z/1314z_Adam.pdf · Consider a symmetric real matrix R. Then R is positive de nite if and only if there

Introduction Basic algorithm Modified algorithm Results

Matrix transformation

Y = LX with L being a lower triangular matrix.

For Xi assume zero means and variances equal to one. This impliesthat Yi has zero means, variances equal to one and Y hascorrelation matrix R.

Higher order moments

EY 3i =

i∑j=1

L3ijEX 3

j

EY 4i − 3 =

i∑j=1

L4ij(EX 4

j − 3)

11 / 21

A heuristic for moment-matching scenario generation

Page 12: Luk a s Adam - Univerzita Karlovamsekce.karlin.mff.cuni.cz/~vorisek/Seminar/1314z/1314z_Adam.pdf · Consider a symmetric real matrix R. Then R is positive de nite if and only if there

Introduction Basic algorithm Modified algorithm Results

Inverse transformation

EX 3i =

1

L3ii

(EY 3i −

i−1∑j=1

L3ijEX 3

j )

EX 4i − 3 =

1

L4ii

(EY 4i − 3 −

i−1∑j=1

L4ij(EX 4

j − 3))

As Lii > 0, the inverse transformation is correctly defined.

12 / 21

A heuristic for moment-matching scenario generation

Page 13: Luk a s Adam - Univerzita Karlovamsekce.karlin.mff.cuni.cz/~vorisek/Seminar/1314z/1314z_Adam.pdf · Consider a symmetric real matrix R. Then R is positive de nite if and only if there

Introduction Basic algorithm Modified algorithm Results

Input phase

Goal: generate a dicrete approximation of Z with momentsTARMOM and correlation matrix R.

Matrix transformation needs zero means and variances equal to 1.

Instead of Z generate Y with moments

α = TARMOM122

β = TARMOM1

MOM3 =TARMOM3

α3

MOM4 =TARMOM4

α4

and set Z = αY + β.

13 / 21

A heuristic for moment-matching scenario generation

Page 14: Luk a s Adam - Univerzita Karlovamsekce.karlin.mff.cuni.cz/~vorisek/Seminar/1314z/1314z_Adam.pdf · Consider a symmetric real matrix R. Then R is positive de nite if and only if there

Introduction Basic algorithm Modified algorithm Results

Derive moments of independent univariate random variables Xi suchthat Y = LX will have the target moments and correlations.

Summary

1 Specify TARMOM and R for Z .2 Find the normalized moments MOM for Y .3 Find the transformed moments TRSFMOM for X .

Fast phase: does not depend on number of scenarios s.

14 / 21

A heuristic for moment-matching scenario generation

Page 15: Luk a s Adam - Univerzita Karlovamsekce.karlin.mff.cuni.cz/~vorisek/Seminar/1314z/1314z_Adam.pdf · Consider a symmetric real matrix R. Then R is positive de nite if and only if there

Introduction Basic algorithm Modified algorithm Results

Output phase

Repeat the procedure from input phase to generate s scenarios.

Summary

1 Generate n times from N(0, 1) and use the cubic transformation toobtain the transformed moments for Xi .

2 Transform Y = LX to obtain moments MOM and correlations R.3 Transform Z = αY + β to obtain target moments TARMOM.

15 / 21

A heuristic for moment-matching scenario generation

Page 16: Luk a s Adam - Univerzita Karlovamsekce.karlin.mff.cuni.cz/~vorisek/Seminar/1314z/1314z_Adam.pdf · Consider a symmetric real matrix R. Then R is positive de nite if and only if there

Introduction Basic algorithm Modified algorithm Results

Problems

Sample correlation of X is not equal precisely to I (the scenarionumber s would have to be high enough).

Matrix transformation Y = LX destroys third and fourth moments.

16 / 21

A heuristic for moment-matching scenario generation

Page 17: Luk a s Adam - Univerzita Karlovamsekce.karlin.mff.cuni.cz/~vorisek/Seminar/1314z/1314z_Adam.pdf · Consider a symmetric real matrix R. Then R is positive de nite if and only if there

Introduction Basic algorithm Modified algorithm Results

Modification 1

1 Generate n univariate random variables with moments TRSFMOMand correlation R1 close to I . Set p = 1

2 If d(Rp, I ) ≤ εx , stop with Xp and X ∗p−1. Otherwise continue to the

next step.

3 Do Cholesky decomposition Rp = LpLTp and backward

transformation X ∗p = L−1

p Xp, which has zero correlations but wrongmoments.

4 Do cubic transformation with TRSFMOM to obtain Xp+1 with rightmoments and wrong correlations.

5 Increase p, compute Rp and return to step 2.

17 / 21

A heuristic for moment-matching scenario generation

Page 18: Luk a s Adam - Univerzita Karlovamsekce.karlin.mff.cuni.cz/~vorisek/Seminar/1314z/1314z_Adam.pdf · Consider a symmetric real matrix R. Then R is positive de nite if and only if there

Introduction Basic algorithm Modified algorithm Results

Modification 2

1 Set Y1 = LX ∗ with both moments and correlations incorrect (dueto moments different from zero). Set p = 1 and compute R1 thecorrelation matrix of Y1.

2 If d(Rp,R) ≤ εy , stop with Yp. Otherwise continue to the next step.

3 Do Cholesky decomposition Rp = LpLTp and backward

transformation Y ∗p = L−1

p Yp, which has zero correlations but wrongmoments.

4 Do forward transform Y ∗∗p = LY ∗

p to obtain Y ∗∗p with correct

correlation but incorrect moments.

5 Do cubic transformation with MOM to obtain Yp+1 with rightmoments and wrong correlations.

6 Increase p, compute Rp and return to step 2.

18 / 21

A heuristic for moment-matching scenario generation

Page 19: Luk a s Adam - Univerzita Karlovamsekce.karlin.mff.cuni.cz/~vorisek/Seminar/1314z/1314z_Adam.pdf · Consider a symmetric real matrix R. Then R is positive de nite if and only if there

Introduction Basic algorithm Modified algorithm Results

Outputs

Two possible outputs Y

Yp with correct moments but incorrect correlation withd(Rp,R) ≤ εy .

Y ∗∗p with incorrect moments but correct correlation.

Perform linear transformation Z = αY + β to reflect the originaldata.

19 / 21

A heuristic for moment-matching scenario generation

Page 20: Luk a s Adam - Univerzita Karlovamsekce.karlin.mff.cuni.cz/~vorisek/Seminar/1314z/1314z_Adam.pdf · Consider a symmetric real matrix R. Then R is positive de nite if and only if there

Introduction Basic algorithm Modified algorithm Results

Convergence

No convergence proof provided.

On the other hand used for more than two years in Gjensidige NorAsset Management.

The results may not exist but they cannot be bad.

Fix to this

Rerun the algorithm.Check data consistency (zero variance, positive skewness).Increase the number of scenarios (improves the quality of the firstmodification).

20 / 21

A heuristic for moment-matching scenario generation

Page 21: Luk a s Adam - Univerzita Karlovamsekce.karlin.mff.cuni.cz/~vorisek/Seminar/1314z/1314z_Adam.pdf · Consider a symmetric real matrix R. Then R is positive de nite if and only if there

Introduction Basic algorithm Modified algorithm Results

Numerical results

Very good.

The generation of 1000 scenarios with 20 random variables took lessthan one minute (Pentium III).

The running time may decrease with increased number of scenarios(better convergence for more scenarios).

21 / 21

A heuristic for moment-matching scenario generation