4.) Girsanov Thoerem (Change of measure) & its application
Brief Intro to Multivariate Normal Distribution
(iv) Generating Normal R.V.s with correlation (Cholesky Decomposition)
喺我再講落去之前 我想大家由一個practical啲嘅角度去諗
我地一路以嚟揾到咁多close form pricing formula其實某程度上都係因為我地用緊一個最簡單嘅model (BS) 同處理緊比較簡單嘅derivatives
如果換轉係一隻有奇怪payoff嘅deriv 或者 一個更加複雜嘅model
其實係好難純粹靠stoc cal去寫低一個close form
而呢個時候 Monte Carlo Simulation就大派用場
個原理其實就係Law of large numbers (LLN)
當同一個experiment重複做好多好多次 咁sample mean就會converge to expected value (population mean)
而simulation就係base on呢個result
假設我地想simulate普通european call price
咁首先定咗一個constant "n" 先 (e.g. n = 100,000) 同埋我地用乜model先 為咗方便起見假設係用BS model先
跟住要做嘅嘢好簡單
首先generate n 條 stock price path 得到每條path嘅 S_T
然後就將每條path嘅discounted payoff, i.e. exp(-rT)*max(S_T - K,0) 計出黎
最尾將呢n個discounted payoff take average就會得到一個"estimated" call price
而理論上當n tends to +infinity, sim出黎嘅call price就會同用BS close form計出黎嘅call price一樣
點解會一樣? 因為本來call price就係expectation of discounted payoff (其實under risk-neutral pricing嘅話就所有deriv都係)
而simulation正正就係計緊sample mean
所以根據LLN 當n趨向無限我地就會得到返真正嘅expectation
(遲啲我真係開始講simulation就會講得詳細啲 所有proof同數都會留返個時先講
依家只係交待返個背景 等大家有足夠嘅background knowledge繼續睇落去)
咁大家諗下 如果我地做simulation一開始要generate stock price path嘅話
其實即係要將原本條SDE discretise擺落programme入面 (或者直接one-shoot由0 sim去 T, 但係下述嘅問題都係存在)
而咁樣做最大嘅問題就係我地應該點樣塞一條wiener process落個programme裡面?
大家睇完上半part應該都仲記得 (change of) Wiener process dW_t ~ N(0,dt)
所以我地其實可以當change of wiener process係一粒follow normal distribution嘅random number咁睇
因為咁 個問題就簡化到點樣generate一粒follow normal distribution嘅random number?
或者換個角度問就係我地用電腦可以點喺一個normal distribution入面拎一粒sample出黎?
( 詳細點樣generate容後再講 因為我想連埋variance reduction去講 咁樣個脈絡會完整啲 )
***IMPORTANT DISCLAIMER***
我知道一定會有人講 所以我自己利申曬先
用電腦gen出黎嘅所謂"random number"一定唔會係真正意義上嘅random
電腦default又好 你自己寫又好 其實都係靠一啲algorithm去gen呢啲數
當然粒seed可以真係random 但係通常電腦default都係用時間去做seed
所以呢啲pseudo-random number只係feels random
只要computing power夠勁就可以predict到一條pseudo-random number series嘅result
或者你可以將個algorithm寫到以現今嘅computing power根本冇可能recognise到究竟條series係咪random
咁你就可以老屈你gen緊嗰啲數係"random"嘅
但係真正嘅random都唔係冇辦法做到
大家可以參考以下numberphile嘅兩段片
兩段都係討論randomness 而且都講得好好
https://www.youtube.com/watch?v=SxP30euw3-0
https://www.youtube.com/watch?v=tP-Ipsat90c
***IMPORTANT DISCLAIMER***
咁假設我地真係寫到個programme 可以喺一個standard normal distribution裡面抽到任意咁多粒independent嘅sample出黎
i.e. 我地個programme generate到任意咁多粒independent嘅random number 而佢地全部follow N(0,1)
上面咁講係咪好長氣呢 所以通常我地會好似下面幅圖咁寫
where i.i.d. = independent and identically distributed
咁其實我地已經處理到n條互相冇correlation嘅wiener processes嘅simulation
但係當我地加咗correlation入去嗰n條processes入面 真正嘅問題就出現
上面我地一路都係講緊in general n粒R.V.s 嘅case
首先我地簡化少少先 剩係consider兩粒 R.V.s , i.e. X_1 and X_2
然後再assume埋 X_1 , X_2 ~ N(0,1)
而佢地係jointly follow Bivariate Normal Distribution (with correlation ρ)
有咗上面堆assumption之後 我地就可以開始問真正關鍵嘅問題
「究竟有冇辦法用
另外兩粒iid 嘅 standard normal R.V.s (i.e. Z_1 and Z_2) 去
generate到 X_1 同 X_2 出黎?」
換句話講即係問緊我地有冇辦法將個correlation structure塞入去 Z_1 , Z_2 入面令佢地變成 X_1 , X_2
點解我要特別強調用兩粒iid 嘅 R.V.s Z_1 , Z_2 去 generate X_1 同 X_2?
因為上面我地講咗我地係識點gen iid 嘅random number
如果我地有得apply一啲transformation落去Z_1同Z_2身上 令我地真係可以將個correlation structure塞入去
從而最後得到X_1同X_2 你話世界幾美好?
今次大家夠運啦 因為真係咁美好 有一個transformation係做到呢樣嘢 請睇下圖
咁依家我claim佢work姐 佢係咪真係work先?
大家唔洗煩惱 寫個簡單嘅proof就可以證明呢個transformation真係work
而呢個transformation technique就係好出名嘅
Cholesky Decomposition
所以好naive咁諗 如果我地將本來啲X_1 , X_2 , Z_1 , Z_2轉曬做wiener processes
咁我地已經可以將兩條有correlation ρ嘅wiener processes decompose返做兩條independent嘅 wiener processes
實際嘅寫法就好似下圖咁 (想知點解咁寫就自己再睇書 我又爆字數
)