Scenario Generation for the Asset Allocation Problem

31
Scenario Generation for the Asset Allocation Problem Diana Roman Gautam Mitra SP XI Vienna August 28, 2007

description

SP XI Vienna August 28 , 2007. Scenario Generation for the Asset Allocation Problem. Diana Roman Gautam Mitra. The asset allocation problem. An amount of money to invest N stocks with known current prices S 1 0 ,…,S N 0 Decision to take: how much to invest in each asset - PowerPoint PPT Presentation

Transcript of Scenario Generation for the Asset Allocation Problem

Page 1: Scenario Generation for the Asset  Allocation Problem

Scenario Generation for the Asset Allocation Problem

Diana RomanGautam Mitra

SP XIVienna

August 28, 2007

Page 2: Scenario Generation for the Asset  Allocation Problem

Asset Allocation Problem

Mean-CVaR Model

Hidden Markov Models

Computational results

Financial SG

The asset allocation problem

•xi=fraction of wealth invested in asset i portfolio (x1,…,xn)

•Ri=the return of asset i at time T•The portfolio return at time T: Rx=x1R1+…+xNRN

(also r.v.!) How to choose between portfolios? A modelling issue!

•An amount of money to invest•N stocks with known current prices S1

0,…,SN0

•Decision to take: how much to invest in each asset•Goal: to get a profit as high as possible after a

certain time T•The stock prices (returns) at time T are not known:

random variables (stochastic processes)

Page 3: Scenario Generation for the Asset  Allocation Problem

Asset Allocation Problem

Mean-CVaR Model

Hidden Markov Models

Computational results

Financial SG

Mean-risk models for portfolio selection

• Mean – risk models: maximize expected value, minimise risk

• Risk: Conditional Value-at-Risk (CVaR) = the expected value of losses in a prespecified number of worst cases.

The optimisation problem:

Min CVaR(Rx) over x1,…,xn

S.t.: E(Rx)d …………

Max (E(Rx) ,- CVaR(Rx)) over x1,…,xn

(1)

Confidence level =0.01 consider the worst 1% of cases

Page 4: Scenario Generation for the Asset  Allocation Problem

Asset Allocation Problem

Mean-CVaR Model

Hidden Markov Models

Computational results

Financial SG

Scenario Generation

• The (continuous) distribution of stock returns: approximated by a discrete multivariate distribution with a limited number of outcomes, so that (1) can be solved numerically: scenario generation. scenario set (single-period case) or a scenario tree (multi-period case).

Page 5: Scenario Generation for the Asset  Allocation Problem

Asset Allocation Problem

Mean-CVaR Model

Hidden Markov Models

Computational results

Financial SG

Scenario Generation

asset1 asset2 … asset n probabilityscenario 1 r11 r12 … r1N p 1scenario 2 r21 r22 … r2N …… … … … … …scenario S rS1 rS2 … rSN pS

• S Scenarios: • pi=probability of scenario i occurring;

• rij=the return of asset j under scenario i;

• The (continuous) distribution of (R1,…,RN) is replaced with a discrete one

Page 6: Scenario Generation for the Asset  Allocation Problem

Asset Allocation Problem

Mean-CVaR Model

Hidden Markov Models

Computational results

Financial SG

The mean-CVaR model

dx j

N

jj

1

vrxvp ij

S

i

N

jji

][1

1 1

jx j ,0

11

N

jjx

• Scenarios a LP (Rockafellar and Uryasev 2000)

Min

Subject to: rij= the scenarios

for assets’s returns

We only solve an approximation of the original problem;The quality of the solution obtained is directly linked to the quality of the scenario generator (“garbage in, garbage out”).

Page 7: Scenario Generation for the Asset  Allocation Problem

Asset Allocation Problem

Mean-CVaR Model

Hidden Markov Models

Computational results

Financial SG

The quality of scenario generators

• The goal of scenario models is to get a good approximation of the “true” optimal value and of the “true” optimal solutions of the original problem (NOT necessarily a good approximation of the distributions involved, NOT good point predictions).

• Difficult to test

• There are several conditions required for a SG

Page 8: Scenario Generation for the Asset  Allocation Problem

Asset Allocation Problem

Mean-CVaR Model

Hidden Markov Models

Computational results

Financial SG

In-sample stability: different runs of a scenario generator should give about the same results.

If we generate several scenario sets (or scenario trees) with the same number of scenarios and solve the approximation LP with these discretisations, we should get about the same optimal value.(not necessarily the same optimal solutions: the objective function in a SP can be “flat”, i.e. different solutions giving similar objective values)

The quality of scenario generators

Page 9: Scenario Generation for the Asset  Allocation Problem

Asset Allocation Problem

Mean-CVaR Model

Hidden Markov Models

Computational results

Financial SG

Out-of-sample stability: -Generate scenario sets of the same size-Solve the optimisation problem on each different optimal solutions-These solutions are evaluated on the “true” distributions “true” objective values-The true objective values should be similar

The quality of scenario generators

• In practice: use a very large scenario set generated with an exogenuous SG method as the “true” distribution

Page 10: Scenario Generation for the Asset  Allocation Problem

Asset Allocation Problem

Mean-CVaR Model

Hidden Markov Models

Computational results

Financial SG

-Out-of-sample stability: the important one-No (simple) relation between in-sample and out-of-sample stability

The quality of scenario generators

Page 11: Scenario Generation for the Asset  Allocation Problem

Asset Allocation Problem

Mean-CVaR Model

Hidden Markov Models

Computational results

Financial SG

Hidden Markov Models

• applied in various fields, e.g. speech recognition

• still experimental for financial scenario generation

• Motivation: financial time series are not stationary; unexpected jumps, changing behaviour

Page 12: Scenario Generation for the Asset  Allocation Problem

Asset Allocation Problem

Mean-CVaR Model

Hidden Markov Models

Computational results

Financial SG

Hidden Markov Models

Real world processes produce observable outputs – a sequence of historical prices, returns…

• A set of N distinct states: S1,…,SN

• System changes state at equally spaced discrete times: t=1,2,…

• Each state produces outputs according to its “output distribution” (different states ->different parameters)

• The “true” state of the system at a certain time point is “hidden”: only observe the output.

Page 13: Scenario Generation for the Asset  Allocation Problem

Asset Allocation Problem

Mean-CVaR Model

Hidden Markov Models

Computational results

Financial SG

Assumptions:• First order Markov chain:

at any time point, system’s state depends only on the previous state and not the whole history: P(qt=Si | qt-1=Sj, qt-2=Sk,….)= P(qt=Si | qt-

1=Sj) with qt=system’s state at time t• Time independence:

aij=probability of changing from state i to state j: the same at any time t.

• Output-independence assumption: the output generated at a time t depends solely on the system’s state at time t (not on the previous outputs)

Hidden Markov Models

Page 14: Scenario Generation for the Asset  Allocation Problem

Asset Allocation Problem

Mean-CVaR Model

Hidden Markov Models

Computational results

Financial SG

The output distributions: mixtures of normal distributions

Mixtures of normal density functions can approximate any finite continuous density function.

),;()(1

jjj

M

jj xfcxf

11

M

jjc

Hidden Markov Models

),;( jjj xf

M mixtures:

=the normal density function with mean vector j and covariance matrix j

Page 15: Scenario Generation for the Asset  Allocation Problem

Asset Allocation Problem

Mean-CVaR Model

Hidden Markov Models

Computational results

Financial SG

Hidden Markov Models

1

2

3

c11,…,c1M11 ,…,1M 11,…,1M

1

2 3

a11

a12 a21

a13a31

N=3M mixtures

a32a23

),;( 111

1 jj

M

jj xNc

c31,…,c3M31 ,…,3M 31,…,3M

c21,…,c2M21 ,…,2M 21,…,2M

Page 16: Scenario Generation for the Asset  Allocation Problem

Asset Allocation Problem

Mean-CVaR Model

Hidden Markov Models

Computational results

Financial SG

The parameters of a HMM:• Number of states N• Number of mixtures M• Initial probabilities of states: 1,…, N

• Transition probabilities: A=(aij), i,j=1…N• For each state i, parameters of the output

distributions:

Hidden Markov Models

Mixture coefficients ci1,…,ciMMean vectors i1,..., iMCovariance matrices i1,…, i1.

Page 17: Scenario Generation for the Asset  Allocation Problem

Asset Allocation Problem

Mean-CVaR Model

Hidden Markov Models

Computational results

Financial SG

Historical data: O=(O1,…,OT)=(rtj, t=1…T,j=1…N) is used to “train” the HMM.

Meaning: Find the parameters

=(, A, C, , ) s.t. P(O| ) maximised

•Cannot be solved analytically and no best way to find •Iterative procedures (e.g. EM, Baum-Welch) can be used to find a local maximum.•Parameters N and M are supposed to be known!

Training Hidden Markov Models

Page 18: Scenario Generation for the Asset  Allocation Problem

Asset Allocation Problem

Mean-CVaR Model

Hidden Markov Models

Computational results

Financial SG

Training HMM’s

• Start with some initial parameters 0 ; compute P(O| 0)

• Re-estimate parameters 1 ; compute P(O| 1) P(O| 0)

• Obtain sequence 0, 1, 2… with P(O| i) P(O| i-1)

• (P(O| i))i converges towards a local maximum• Limited knowledge about the convergence

speed• Observed sharp increase in the first few

iterations, then relatively little improvement• Practically: stop when P(O| i)- P(O| i-1) is

small enough• Use final i for generation of scenarios

Page 19: Scenario Generation for the Asset  Allocation Problem

Asset Allocation Problem

Mean-CVaR Model

Hidden Markov Models

Computational results

Financial SG

Training HMMs: initial parameters

• How choose 0?

• Not important for i and aij (could be 1/N or random)

• Very important for C, and – but no”best” way to estimate them

• k-means clustering algorithm: separate historical data into M clusters

• starting parameters: Based on the mean vectors and covariance matrices of the clusters

Page 20: Scenario Generation for the Asset  Allocation Problem

Asset Allocation Problem

Mean-CVaR Model

Hidden Markov Models

Computational results

Financial SG

Training HMM: parameters re-estimation

Forward probabilities: time t, state i

Need to calculate additional quantities:

)|,...()( 1 ittt SqOOPi

Backward probabilities: time t, state i),|...()( 1 itTtt SqOOPi

In calculus: the multi-variate normal density:

)()(

21exp

|det|)2(1)( 1

2/12/ ijijT

ijij

Nij xxxf

Calculated recursively after time

Use Baum-Welch algorithm (EM):

Page 21: Scenario Generation for the Asset  Allocation Problem

Asset Allocation Problem

Mean-CVaR Model

Hidden Markov Models

Computational results

Financial SG

Additional quantities:

)|()()(),|()(

OP

iiOSqPi ttitt

),|,(),( 1 OSqSqPji jtitt

Probability of the historical observation to be generated by the current model:

)()()()|(11

iiiOPM

itt

M

iT

Training HMM: parameters re-estimation

Page 22: Scenario Generation for the Asset  Allocation Problem

Asset Allocation Problem

Mean-CVaR Model

Hidden Markov Models

Computational results

Financial SG

)(1* ii

1

1

1

1*

)(

),(

T

tt

T

tt

ij

i

jia

T

tt

T

ttt

i

i

Oi

1

1*

)(

)(

T

tt

T

t

Tititt

i

i

OOi

1

1*

)(

))()((

Training HMM: parameters re-estimation

Page 23: Scenario Generation for the Asset  Allocation Problem

Asset Allocation Problem

Mean-CVaR Model

Hidden Markov Models

Computational results

Financial SG

HMM: estimation of the current state

•The state of the system at the current time?•Via Viterbi algorithm

•Given an observation sequence O=(O1,…,OT) and a model , find an “optimal” state sequence Q=(q1,…,qT)

•i.e., that best “explains” the observations: maximises P(Q|O, )

Page 24: Scenario Generation for the Asset  Allocation Problem

Asset Allocation Problem

Mean-CVaR Model

Hidden Markov Models

Computational results

Financial SG

HMM for scenario generation

A scenario: a path of returns for times T+1,…,T+TP Estimate the current state (time T); say, qt=Si

{• Transit to a next state Sj according to

transition probabilities aij• Generate a return conform to the distribution of

state j}

…. ….t=1 t=2 t=3 t=T t=T+1 t=T+2 t=T+TP

Historical data: estimation of

Estimation of the system’s state at time T

Generation of scenarios

Page 25: Scenario Generation for the Asset  Allocation Problem

Asset Allocation Problem

Mean-CVaR Model

Hidden Markov Models

Computational results

Financial SG

HMM – implementation issues

• Number of states? Still a very much unsolved problem.• The observation distributions for each state?• The initial estimates of the model’s parameters• Computational issues: lots!!

• For large number of assets, large covariance matrices (at every step of re-estimation: determinants, inverses);

• The quantities calculated recursively get smaller and smaller

• Or the opposite: get larger and larger

Page 26: Scenario Generation for the Asset  Allocation Problem

Asset Allocation Problem

Mean-CVaR Model

Hidden Markov Models

Computational results

Financial SG

Computational results

Historical Dataset: • 5 stocks from FTSE 100• 132 monthly returns: Jan 1993-Dec 2003

Generate scenario returns for 1 month ahead 500, 700, 1000, 2000, 3000 scenarios

Page 27: Scenario Generation for the Asset  Allocation Problem

Asset Allocation Problem

Mean-CVaR Model

Hidden Markov Models

Computational results

Financial SG

Computational results

For each scenario size: - Run 30 times generate 30 different

discretisations for the assets’ returns (R1,…,RN)

- Solve mean-CVaR model with these discretisations get 30 solutions x1,…,x30

- Similar solutions as scenario size increases: (x2=x3=0, x5>=50%)

- Evaluate these solutions on the “true” distribution?

Page 28: Scenario Generation for the Asset  Allocation Problem

Asset Allocation Problem

Mean-CVaR Model

Hidden Markov Models

Computational results

Financial SG

Computational results

Out-of-sample stability:

- The “true” distribution: generated with Geometric Brownian motion, 30.000 scenarios

- Each of the 30 solutions was evaluated on this distribution 30 “true” objective values (=portfolio CVaRs)

Page 29: Scenario Generation for the Asset  Allocation Problem

Asset Allocation Problem

Mean-CVaR Model

Hidden Markov Models

Computational results

Financial SG

Computational results

Geometric Brownian motion (GBM)- The standard in finance for modelling stock

prices- Stock prices are approximated by

continuous time stochastic processes (accepted by practitioners…)

• S0: the current price : the expected rate of return : the standard deviation of rate of return• {Wt}: Wiener process - the “noise” in the asset’s price.

})2

exp{()(2

0 tWtStS

Page 30: Scenario Generation for the Asset  Allocation Problem

Asset Allocation Problem

Mean-CVaR Model

Hidden Markov Models

Computational results

Financial SG

Computational results

Statistics for the series of “true” objective functions

  500 scen 700 scen 1000 scen 2000 scen 3000 scen

Mean 0.0035 0.0033 0.0031 0.0029 0.0026St Deviation 0.0012 0.0012 0.001 0.0006 0.0003

Range 0.0051 0.0042 0.0048 0.0022 0.0011

Minimum 0.0024 0.0023 0.0023 0.0023 0.0023

Maximum 0.0074 0.0065 0.0071 0.0045 0.0034

• Quality of solutions improve with larger scenario sets (as expected!)

• Reasonably small spread; pretty similar objective values

Page 31: Scenario Generation for the Asset  Allocation Problem

Asset Allocation Problem

Mean-CVaR Model

Hidden Markov Models

Computational results

Financial SG

Conclusions and final remarks• For the mean-CVaR model: SG that can capture

extreme price movements• Stability is a necessary condition for a “good” SG• HMM is a discrete-time model; experimental for

financial SG• Motivated by non-stationarity of financial time series• Two stochastic processes: one of them describes the

“state of the system”• Implementation problems, especially when the

number of assets is large• An initial “good” estimate for HMM parameters is

essential• The number of states: supposed to be known in

advance• Good results regarding out-of-sample stability• The “true” distribution when testing out-of-sample

stability: with GBM - standard in finance.