cf-4 bank hapoalim jun-2001 zvi wiener 02-588-3049 mswiener/zvi.html computational finance

58
CF-4 Bank Hapoalim Jun-2001 Zvi Wiener 02-588-3049 http://pluto.mscc.huji.ac.il/ ~mswiener/zvi.html Computational Finance

Post on 19-Dec-2015

218 views

Category:

Documents


0 download

TRANSCRIPT

CF-4 Bank Hapoalim Jun-2001

Zvi Wiener

02-588-3049http://pluto.mscc.huji.ac.il/~mswiener/zvi.html

Computational Finance

CF4 slide 2Zvi Wiener

Plan1. Monte Carlo Method

2. Variance Reduction Methods

3. Quasi Monte Carlo

4. Permuting QMC sequences

5. Dimension reduction

6. Financial Applications

simple and exotic options

American type

prepayments

CF4 slide 3Zvi Wiener

Monte Carlo

CF4 slide 4Zvi Wiener

Monte Carlo

-1 -0.5 0.5 1

-1

-0.5

0.5

1

CF4 slide 5Zvi Wiener

Monte Carlo

-1 -0.5 0.5 1

-1

-0.5

0.5

1

CF4 slide 6Zvi Wiener

Monte Carlo

-1 -0.5 0.5 1

-1

-0.5

0.5

1

CF4 slide 7Zvi Wiener

20 40 60 80 100

-0.04

-0.02

0.02

0.04

0.06

0.08

Speed of convergence

Whole circle

Upper triangle

CF4 slide 8Zvi Wiener

Smart Sampling

CF4 slide 9Zvi Wiener

Spectral Truncation

CF4 slide 10Zvi Wiener

Variance Reduction

Let X() be an option.

Let Y be a similar option which is correlated with X but for which we have an analytic formula.

Introduce a new random variable

YYXX )()()(

CF4 slide 11Zvi Wiener

Variance Reduction

The variance of the new variable is

]var[],cov[2]var[]var[ 2 YYXXX

If 2cov[X,Y] > 2var[Y] we have reduced

the variance.

CF4 slide 12Zvi Wiener

Variance Reduction

The optimal value of is

Then the variance of the estimator becomes:

]var[

],cov[*

Y

YX

]var[)1(]var[ 2* XX XY

CF4 slide 13Zvi Wiener

Variance Reduction

Note that we do not have to use the optimal

* in order to get a significant variance

reduction.

CF4 slide 14Zvi Wiener

Multidimensional Variance Reduction

A simple generalization of the method can be used when there are several correlated variables with known expected values.

Let Y1, …, Yn be variables with known means.

Denote by Y the covariance matrix of variables Y and by XY the n-dimensional vector of covariances between X and Yi.

CF4 slide 15Zvi Wiener

Multidimensional Variance Reduction

Then the optimal projection on the Y plane is given by vector: 1* Y

TXY

The resulting minimum variance is

]var[)1(]var[ 2* XRX XY

where

]var[

12

XR XYY

TXY

XY

CF4 slide 16Zvi Wiener

Variance Reduction

• Antithetic sampling

• Moment matching/calibration

• Control variate

• Importance sampling

• Stratification

CF4 slide 17Zvi Wiener

Monte Carlo in Risk Management

• Distribution of market factors

• Simulation of a large number of events

• P&L for each scenario

• Order the results

• VaR = lowest quantile

CF4 slide 18Zvi Wiener

How to design MC

The central point is to model the

distribution of relevant risk factors.

For example, in pricing you should use the

risk-neutral distribution.

For risk measurement use true distribution.

What should be used for an estimate of

frequency of hedge?

CF4 slide 19Zvi Wiener

Geometrical Brownian Motion

SdBrSdtdS

)()( SpayoffEeoption neutralrisktTr

CF4 slide 20Zvi Wiener

Lognormal process

SdBrSdtdS

dBdtrSd

2)(log

2

tZtr N

eStS)1,0(

2

2)0()(

CF4 slide 21Zvi Wiener

Euler Scheme

SdBrSdtdS

)()1,0( tOtSZtrSS N

CF4 slide 22Zvi Wiener

Milstein Scheme

SdBrSdtdS

)()1(2

1 22)1,0(

22

)1,0(

tOtZS

tSZtrSS

N

N

CF4 slide 23Zvi Wiener

MC for simple options

Needs["Statistics`NormalDistribution`"]

Clear[MCEuropean, MCEuropeanCall, MCEuropeanPut]

nor[mu_,sig_]:=Random[NormalDistribution[mu,sig]];

CF4 slide 24Zvi Wiener

MC for simple options

MCEuropean[s_, T_, r_, _, n_, exercise_Function]:=

Module[{m = N[Log[s]+(r - 0.52)*T], sg=N[ Sqrt[T] ], tbl},

tbl= Table[nor[m, sg], {i, n}];

Exp[-r*T]*Map[exercise, Exp[Join[tbl, 2*m - tbl]]]//

{Mean[#], StandardErrorOfSampleMean[#]}&

]

CF4 slide 25Zvi Wiener

MC for simple optionsMCEuropeanCall[s_, x_, T_, r_, _, n_]:=

MCEuropean[s, T, r, , n, Max[#-x,0]&]

MCEuropeanPut[s_, x_, T_, r_, _, n_]:=

MCEuropean[s, T, r, , n, Max[x-#,0]&]

CF4 slide 26Zvi Wiener

MC for path dependent options

RandomWalk[n_Integer] :=

FoldList[Plus, 0, Table[Random[] - 1/2, {n}]];

ListPlot[ RandomWalk[500], PlotJoined -> True];

CF4 slide 27Zvi Wiener

MC for path dependent options

The function paths generates a random sample of price

paths for the averaging period. It returns a list of

numberPaths random paths, each consisting of

numberPrices prices over the period from time T1 to time

T. The prices at the start of the period are given by the

appropriate lognormal distribution for time T1.

CF4 slide 28Zvi Wiener

MC for path dependent options

paths[s_,sigma_,T1_,T_,r_,numberPrices_,numberPaths_]:=

Module[{meanAtT1=Log[s]+(r-sigma^2/2)*T1,

sigmaAtT1 = sigma*Sqrt[T1],

meanPath = 1+ r*(T-T1)/(numberPrices-1),

sigmaPath = sigma*Sqrt[(T-T1)/(numberPrices-1)]

},

Table[NestList[# nor[meanPath,sigmaPath]&,

Exp[nor[meanAtT1,sigmaAtT1]],

numberPrices - 1], {i,numberPaths}]

]

CF4 slide 29Zvi Wiener

MC for Asian options

MCAsianCall[s_,x_,sigma_,T1_,T_,r_,numberPrices_,numberPaths_]:=

Module[{ t1, t2, t3},

t1 = paths[s,sigma,T1,T,r,numberPrices,numberPaths] ;

t2 = Map[Max[0,Mean[#] - x]&, t1];

t3 = Exp[-T*r]*t2;

{Mean[t3], StandardErrorOfSampleMean[t3]}

]

CF4 slide 30Zvi Wiener

Quasi Monte Carlo

• Van der Corput

• Halton

• Haber

• Sobol

• Faure

• Niederreiter

• Permutations

• Nets

CF4 slide 31Zvi Wiener

Quasi Monte Carlo

Are efficient in low (1-2) dimensions.

Sobol sequences can be used for small

dimensions as well.

As an alternative one can create a fixed set of

well-distributed paths.

CF4 slide 32Zvi Wiener

Do not use free sequences

0.2 0.4 0.6 0.8 1

0.2

0.4

0.6

0.8

1

CF4 slide 33Zvi Wiener

Other MC applications

• Pricing

• Optimal hedging

• Impact of dividends

• Bounds on a basket

• Prepayments

• Tranches of MBS

CF4 slide 34Zvi Wiener

Other MC related topics

Use of analytical approximations

Richardson extrapolation

Ratchets example

American properties

Bundling

Modeling Fat tails

CF-4 Bank Hapoalim Jun-2001

Zvi Wiener

The Hebrew University of Jerusalem

[email protected]

Value of Value-at-Risk

CF4 slide 36Zvi Wiener

P&L

VaR

1 day

1% probability 1d

1 week

1% probability 1w

CF4 slide 37Zvi Wiener

-1-3 -2

0.5%1%

100%

VaRA

VaR is not sub-additive.Cumulative distribution of assets A and B.

0

CF4 slide 38Zvi Wiener

Joint distribution of A and BThe integral over the gray triangle is

0.99*0.99 + 0.99*0.005*2/2 = 0.98505, which means thatthere are more than 1% chances to be outside the

gray area and VaRA+B > VaRA+VaRB=$2.

-1-3 -2

VaRA+B

AB

-1

-2

-3

Total loss $1

Total loss $2

0.005 0.005 0.99

0.99

0.005

0.005

0.98010.00495

0.004950.000025

0.0000250.000025

0.000025

0.00495

0.00495

CF4 slide 39Zvi Wiener

Model

• Bank’s choice of an optimal system

• Depends on the available capital

• Current and potential capital needs

• Queuing model as a base

CF4 slide 40Zvi Wiener

Required Capital

Let A be total assets

C – capital of a bank

- percentage of qualified assets

k – capital required for traded assets

kAAC 08.0)1(

CF4 slide 41Zvi Wiener

Maximal Risk (Assets)

The coefficient k varies among systems, but a better

(more expensive) system provides more precise risk

measurement, thus lower k.

Cost of a system is p, paid as a rent (pdt during dt).

Amax is a function of C and p.

k

CA

08.0)1(max

CF4 slide 42Zvi Wiener

Risky Projects

Deposits arrive and are withdrawn randomly.

All deposits are of the same size.

Invested according to bank’s policy.

Can not be used if capital requirements are

not satisfied.

CF4 slide 43Zvi Wiener

Arrival of Risky ProjectsWe assume that risky projects arrive randomly (as a Poisson process with density ).

This means that there is a probability dt that during dt one new project arrives.

CF4 slide 44Zvi Wiener

Arrival of Risky ProjectsA new project is undertaken if the bank has enough capital (according to the existing risk measuring system).

We assume that one can NOT raise capital or change systems quickly.

CF4 slide 45Zvi Wiener

Termination of Risky Projects

We assume that each risky project disappears randomly (as a Poisson process with density ).

CF4 slide 46Zvi Wiener

Termination of Risky Projects

We assume that each risky project disappears randomly (as a Poisson process with density ).

This means that there is a probability ndt that during dt one out of n existing projects terminates.

With probability (1-ndt) all existing projects will be active after dt.

CF4 slide 47Zvi Wiener

ProfitWe assume that each existing risky project gives a profit of dt during dt.

Thus when there are n active projects the bank has instantaneous profit (n-p)dt.

CF4 slide 48Zvi Wiener

States

After C and p are chosen, the maximal number of active projects is given by s=Amax(C,p).

0 1 2 s-1 s

0 1 2 s-1 s

2 s

CF4 slide 49Zvi Wiener

States

0 1 2 s-1 s

0 1 2 s-1 s

2 s

Stable distribution:

0 = 1

1 = 2 2

s-1 = s s

where

i

n

i

ns

i

i

n

s

ii

i

n

n

n ,

!

!

!

!

00

CF4 slide 50Zvi Wiener

Probabilities

• Probability of losing a new project due to capital requirements is equal to the probability of being in state s, i. e. s.

• Termination of projects does not have to be Poissonian, only mean and variance matter.

),1()1(

)1(

!

!

0

sn

se

i

nn

s

i

i

n

n

CF4 slide 51Zvi Wiener

Expected Profit

An optimal p (risk measurement system) can be found by maximizing the expected profit stream.

ppprofitE ps )(1)( ps

ss

),1(

),(

CF4 slide 52Zvi Wiener

Example

• Capital requirement as a function of p (price) and q (scaling factor), varies between 1.5% and 8%.

q

p

epk

)015.008.0(015.0)(

CF4 slide 53Zvi Wiener

Example

q

p

epk

)015.008.0(015.0)(

1 2 3 4

12.5

12.75

13.25

13.5

13.75

14

14.25q=0.5

q=1

q=3

p

Amax

CF4 slide 54Zvi Wiener

Example of a bank

• Capital $200M

• Average project is $20K

• On average 200 new projects arrive each day

• Average life of a project is 2 years

• 15% of assets are traded and q=1

• spread =1.25%

CF4 slide 55Zvi Wiener

Bank’s profit as a function of cost p. C=$200M, arrival rate 200/d,size $20K, average life 2 yr.,

spread 1.25%, q=1, 15% of assets are traded.

1 2 3 4 5 629.5

30.5

31

31.5

32

32.5

33

rent p

Expected profit

CF4 slide 56Zvi Wiener

rent p

Expected profit

1 2 3 4 5 6

21

22

23

24

25

Bank’s profit as a function of cost p. C=$200M, arrival rate 200/d,size $20K, average life 2 yr.,

spread 1%, q=1, 5% of assets are traded.

CF4 slide 57Zvi Wiener

Conclusion• Expensive systems are appropriate for banks with

• low capitalization

• operating in an unstable environment

• Cheaper methods (like the standard approach) should be appropriate for banks with

• high capitalization

• small trading book

• operating in a stable environment• many small uncorrelated, long living projects

CF4 slide 58Zvi Wiener

A simple intuitive and flexible model of

optimal choice of risk measuring method.