Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3)...

33
Price path generation by Hybrid Monte Carlo algorithm Tetsuya Takaishi Hiroshima University of Economics IASC2008

Transcript of Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3)...

Page 1: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every

Price path generation by

Hybrid Monte Carlo algorithm

Tetsuya Takaishi

Hiroshima University of Economics

IASC2008

Page 2: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every

•In the Black-Sholes model asset prices are assumed to follow the geometric Brownian motion and in the simplest case of European option an analytical solution is obtained.

•For options with path-dependent payoff functions like Asian option, an analytic formula is not known.

•We generate price paths by Markov Chain Monte Carlo (MCMC) methods and evaluate Asian options.

•Price paths are generated by two MCMC methods, the Hybrid Monte Carlo (HMC) and Metropolis method. We find that the HMC algorithm reduces correlations between the generated price paths effectively.

Introduction

Page 3: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every

Options

•European Option

•American option

•Asian option

An option that can only be exercised at the end of its life.

An option that can be exercised anytime during its life.

An option whose payoff depends on the average price of the underlying

asset over a certain period of time as opposed to at maturity.

payoff function for an Asian option:

Max(m-K,0) or Max(K-m,0) where m is the average price and K is the strike price

Page 4: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every

time

K

S0

Sn

strike price

price path

average

SnーK

m-K

payoff function

Max(m-K,0)Max(Sn-K,0)European call option Asian call option

Page 5: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every

Evolution of price path

SdWrSdtdS

dtAdt

dWAdtSd

)(ln

Sz ln

dt

Adtzz

dtzzp

2

2

2 2

))((exp

2

1)|(

Asset prices are assumed to follow a geometric Brownian motion.

2

2 rA

Transition probability from z to z’

Page 6: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every

)|()|()|()|( 012110 zzpzzpzzpdzdzzzp nnnn

dt

Adtzz

dtdzdzzzp kk

n

kn

nn 2

2

11

112

1012

))((exp

)2(

1)|(

Chapman-Kolmogorov equation

dt

Adtzz

dtzzp kk

n

kn

n 2

2

11

112

012

))((exp

)2(

1),,(

probability of finding the price path ),,( 01 zzz n

Page 7: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every

dt

Adtzz

dtzzp kk

n

kn

n 2

2

11

112

012

))((exp

)2(

1),,(

rt

nnn ezzpzzOdzdzZ

O

),,(),,(1

010111

We generated price paths with this probability by k

n

k zzz ),,( 01

rtM

k

k ezOM

O

1

)(1

average over M price paths

Option price ),,( 01 zzO n

payoff function

An option price is given by an expectation value with

Page 8: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every

1. Choose a new candidate

2. Calculate

3. We accept the candidate with

Otherwise keep the old value

Metropolis method

))(exp()( xfxp

)()( xfxfdh

))exp(,1min( dh

)5.0( dxx

Local update uniform random number in [0,1]

generate x with

Page 9: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every

price

time

x

x

))exp(,1min( dhaccept the new path with

candidate path

Page 10: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every

Hybrid Monte Carlo

•Molecular dynamics simulations

•Metropolis accept/reject step

HMC is a global algorithm that can update all the parameters at once.

S. Duane , A.D. Kennedy , B.J. Pendleton, D. Roweth (1987)

HMC consists of two steps:

HMC is useful for the models which have global interactions.

It is expected that HMC reduces the correlation between variables generated by MCMC.

Page 11: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every

))(exp( fdZ

))(exp()(1

fOdZ

O

)exp(

))(2

1exp( 2

Hdpd

fpdpdZ

)(2

1 2 fpH

Partition function

we introduce momenta p

conjugate to θ.

define

Hamiltonian

Hybrid Monte Carlo

Expectation value of O(θ)

This partition function unchanges the value of <O(θ)>.

Momenta have no dynamics.

This does not change the results.

Page 12: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every

•Solve the Hamilton's equations of motion (Molecular

dynamics simulation)

),(),( pHpH

HHdH

•Metropolis accept/reject step

)1),min(exp( dH

In general, dh is not zero in

the numerical integration.

Hybrid Monte Carlo

Hamiltonian is conserved.

p

H

Hp

pp

Accept new theta with

This can be small.

Page 13: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every

Hgg , , Poisson bracket

HggHL ,)(

)())(exp()( tgHtLttg

VT

xfLpLHL

))((2/)( 2

)()2/exp()exp()2/exp())(exp( 3ttTtVtTHtL

Leapfrog integrator

In general, we cannot solve this.

operator

g is x or p.

Simplectic integrator

Hamilton's equations of motion

Page 14: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every

2/)()2/()( :3

)2/()()( :2

2/)()()2/( :1

tttptttt

tttH

tpttp

ttpttt

θ

p

2/t

t

Δt is chosen such that the acceptance ratio takes 60~70%.

elementary step

repeat this step

Leapfrog integrator

t

t

optimal acceptance

Page 15: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every

interest rate r=0.05

volatility σ=0.01

expiration day T=1 (year)

dt=T/100=1/100

parameters

initial price S0=100

MCMC simulations

Page 16: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every

10 price paths generated every 1000sweeps

Page 17: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every

10 paths generated by HMC every 100sweeps

Page 18: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every

Acceptance ratio=約50%

d=0.4

Page 19: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every
Page 20: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every

Log(S100)

Autocorrelation is small

Page 21: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every

Log(S100)

Page 22: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every

distribution of Log(S100)

Page 23: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every

Asian option

rT

nnn

rT ezzpzzOdzdzZ

eO

),,(),,(1

010111

1

0

1

0

01

0,1

1max

0,)exp(1

1max),,(

n

k

k

n

k

kn

KSn

Kzn

zzO

payoff function depends on the average value over a price path

interest rate r=0.095

volatitiliy σ=0.2

T=1 (year)

initial price S0=100

dt=0.01

parameters

Page 24: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every

strike price K K=60 K=100 K=150

Metropolis

HMC

MCRW

40.923(18) 7.147(14) 0.0051(3)

40.86(2)

40.830(25)

6.923(13)

6.899(19)

0.0063(4)

0.0054(5)

Metropolis: 400k (every 100 sweeps)

HMC:400k(every 10 sweeps)

MCRW:200k

statistics

RCRW=Monte Carlo random walk

Page 25: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every
Page 26: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every
Page 27: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every
Page 28: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every

Summary

We have generated price paths by HMC

and Metropolis methods.

The price paths are generated effectively

by the HMC method.

Asian option prices are calculated based on

the price paths generated by the HMC.

Page 29: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every

182

Page 30: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every

A-2 , B-1

Page 31: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every

Option

あることが選択できる権利(一般)

ある資産を一定の価格で購入または売却できる権利(ファイナンス)

権利は購入する必要がある

権利は行使してもしなくても良い

Page 32: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every

オプションの例

1年後に1株300円で1000株購入できる権利

満期日の株価 S

300円 500円

200円の得

コール・オプション

株価が300円以下の場合は買う必要なし。

200円

この権利の価格は?

満期日

行使価格 K

)0,max( KS

Page 33: Price path generation by Hybrid Monte Carlo algorithm · MCRW 40.923(18) 7.147(14) 0.0051(3) 40.86(2) 40.830(25) 6.923(13) 6.899(19) 0.0063(4) 0.0054(5) Metropolis: 400k (every

Option prices

)|( 0Sqp

ヨーロピアンオプションの場合、解析解が得られている

rtrt eSqpqdqOZ

eO

)|()(1

0 r:利子率

満期日に株価がqの場合、どれだけ得するか(ペイオフ)

株価が(幾何)ブラウン運動をすると仮定すると

ブラック・ショールズ式

平均したらどれだけ得するか

満期日の株価のみに依存