当前位置:
文档之家› Monte_Carlo蒙特卡洛算法模拟
Monte_Carlo蒙特卡洛算法模拟
Monte Carlo Simulation Fall 2014 10 / 59
Xianhua Peng (HKUST)
Simulating Stock Price Under Black-Scholes Model
Simulate Stock Prices Under Black-Scholes Model
d
If we find A such that AAT = Σ, then we obtain µ + AZ ∼ Nn (µ, Σ).
d
Xianhua Peng (HKUST)
Monte Carlo Simulation
Fall 2014
4 / 59
Generating Multivariate Normal and t Random Vectors
Monte Carlo Simulation
FE5107 Risk Analysis and Management
Instructor: Xianhua Peng Department of Mathematics HKUST maxhpeng@ust.hk
Fall 2014
Xianhua Peng (HKUST)
We want to simulate X = (X1 , . . . , Xn )T ∼ Nn (µ, Σ)
d
d
Let Z = (Z1 , . . . , Zn )T ∼ Nn (0, In ). We know how to simulate Z . Let A ∈ Rn×n . We know µ + AZ ∼ Nn (µ, AAT ) How to find such a A?
Spectral Decomposition of Σ
Spectral decomposition of real-valued symmetric matrix Σ: Σ = ΓΛΓT , where Λ = diag{λ1 , . . . , λn } A can be chosen to be A = Γdiag{ λ1 , . . . , λn }
The random vector X has a multivariate t distribution with dof ν (denoted by tn (ν, µ, Σ)), if X =µ+
d d
H V /ν
, where
H ∼ Nn (0, Σ)
X can be simulated by simulating H and V respectively. Matlab function: mvtrnd
2
3
4
5
6
Xianhua Peng (HKUST)
Monte Carlo Simulation
Fall 2014
3 / 59
Generating Multivariate Normal and t Random Vectors
Generate Multivariate Normal Random Vectors
Logarithm of stock price is a constant plus a Brownian motion: σ2 )t + σ Wt , for all t 2 Log return of the stock from time s to time s + t : log St = log S0 + (µ − log σ2 σ2 S s +t d = (µ − )t + σ (Ws+t − Ws ) ∼ N ((µ − )t , σ 2 t ) Ss 2 2
Xianhua Peng (HKUST) Monte Carlo Simulation Fall 2014 6 / 59
Generating Multivariate Normal and t Random Vectቤተ መጻሕፍቲ ባይዱrs
Generate Multivariate t Random Vectors
Xianhua Peng (HKUST)
Monte Carlo Simulation
Fall 2014
5 / 59
Generating Multivariate Normal and t Random Vectors
Cholesky Decomposition of Σ
Cholesky decomposition: any positive semi-definite symmetric matrix Σ can be decomposed into Σ = AAT , where A is a lower triangular matrix with all elements above diagonal being zero. The 3-dimensional case: a11 0 0 a11 a21 a31 σ11 σ12 σ13 σ21 σ22 σ23 = a21 a22 0 0 a22 a32 0 0 a33 σ31 σ32 σ33 a31 a32 a33 Matlab function for Cholesky decomposition: chol Be careful! If C = chol(Σ), then Σ = C T C ! Matlab function for simulating Nn (µ, Σ): mvnrnd
Xianhua Peng (HKUST)
Monte Carlo Simulation
Fall 2014
11 / 59
The Monte Carlo Framework and Output Analysis
Outline
1
Generating Multivariate Normal and t Random Vectors Simulating Stock Price Under Black-Scholes Model The Monte Carlo Framework and Output Analysis Calculating VaR via Simulation Importance Sampling Relative Errors
V ∼ χ2 ν and V is independent of Z
Xianhua Peng (HKUST)
Monte Carlo Simulation
Fall 2014
7 / 59
Simulating Stock Price Under Black-Scholes Model
Outline
1
Generating Multivariate Normal and t Random Vectors Simulating Stock Price Under Black-Scholes Model The Monte Carlo Framework and Output Analysis Calculating VaR via Simulation Importance Sampling Relative Errors
Stationary increments: for any s > 0 and t > 0, the distribution of Wt +s − Ws does not depend on s. Normal distribution: for any s ≥ 0 and t > 0,
d
Wt +s − Ws ∼ N (t µ, t σ 2 )
2
3
4
5
6
Xianhua Peng (HKUST)
Monte Carlo Simulation
Fall 2014
2 / 59
Generating Multivariate Normal and t Random Vectors
Outline
1
Generating Multivariate Normal and t Random Vectors Simulating Stock Price Under Black-Scholes Model The Monte Carlo Framework and Output Analysis Calculating VaR via Simulation Importance Sampling Relative Errors
d
σ2 2 )t1
+ σ X1 ), where
Sequentially simulate Sti , i = 2, 3, . . ., by
Sti = Sti −1 exp((µ−
σ2 d )(ti −ti −1 )+σ Xi ), Xi ∼ N (0, ti −ti −1 ), i = 2, 3, . . . , 2
Xianhua Peng (HKUST)
Monte Carlo Simulation
Fall 2014
9 / 59
Simulating Stock Price Under Black-Scholes Model
Black-Scholes Model of Stock Prices
Black-Scholes model: stock price at time t is σ2 )t + σ Wt ), for all t , 2 where Wt is a standard Brownian motion. Overall log return over [0, t ] is a Brownian motion: St = S0 exp((µ − log σ2 σ2 St d = (µ − )t + σ Wt ∼ N (t (µ − ), t σ 2 ) S0 2 2