S10-matlab代写
时间:2024-04-16
Generating Correlated Paths
Example 1: (S10 ,S
2
0 ,S
3
0 ) = (100, 110, 90), T = 1, h = 1/252, r = 0.05,
(σ1, σ2, σ3) = (0.4, 0.3, 0.2), (ρ12, ρ13, ρ23) = (0.5,−0.5,−0.25)
• Generate correlated paths of (S1t ,S2t ,S3t ) under GBM:
S it+h = S
i
t exp
{
(r − σ2i /2)h +

hXi
}
for i = 1, 2, . . . , n
where X = (X1,X2, . . . ,Xn) ∼ N(0,Σ), and
Σ =
 σ21 ρ12σ1σ2 ρ13σ1σ3ρ12σ1σ2 σ22 ρ23σ2σ3
ρ13σ1σ3 ρ23σ2σ3 σ
2
3
 .
• Plot 3 paths in the same figure.
1
Antithetic Variates
Example 2: (Call Option Pricing)
S0 = 100, T = 1, r = 0.05, σ = 0.4, K = 110, n = 100, 000
• Generate original paths from (Z1,Z2, . . . ,Zn) and antithetic paths
from (−Z1,−Z2, . . . ,−Zn)
• Compute and compare the call prices and standard errors using both
of the naive method and antithetic variates.
• Find the variance reduction factor (σˆ2naive/σˆ2new ).
2
Common Random Number (CRN)
Example 3: (Delta Forward Estimation)
S0 = 100, δ = 2, T = 1, r = 0.05, σ = 0.4, K = 110, n = 100, 000
• Compute the deltas (forward estimation) of the call option using a
naive method and CRN.
• Compare the deltas and standard errors and find the variance
reduction factor (σˆ2naive/σˆ
2
new ).
3
Importance Sampling
Example 4: (Cash-or-Nothing Call Option Pricing)
S0 = 100, T = 0.25, r = 0.05, σ = 0.2, c = 10, K = 150, n = 100, 000
ST = S0e
Z , Z ∼ N((r − σ2/2)T , σ2T )
Let X ∼ N(ln(K/S0)− σ2T/2, σ2T ). Then, E[S0eX ] = K .
• Compute the option price and standard error using naive Monte
Carlo simulation
• Compute the option price and standard error using importance
sampling with X .
• Compare the prices and standard errors and find the variance
reduction factor (σˆ2naive/σˆ
2
new ).
4
Conditional Monte Carlo
Example 5: (Best-of-Assets-or-Cash Option Pricing)
S10 = 100, S
2
0 = 80, T = 1, r = 0.05, σ1 = 0.2, σ2 = 0.4, K = 110,
n = 100, 000
Assume that S1t and S
2
t are independent. Recall that the payoff of this
option is max{S1T ,S2T ,K}. Thus, if S2T is known, the payoff is equal to
(S1T − K ′)+ + K ′
where K ′ = max{S2T ,K}. Consequently, conditional on S2T , the option
price is
E
[
e−rT max{S1T ,S2T ,K}|S2T
]
= E
[
e−rT (S1T − K ′)+|S2T
]
+ e−rTK ′
= c0(S
1
0 ;T ,K
′) + e−rTK ′
• Compute the option price and S.E. using naive MC simulation
• Compute the option price and S.E. using conditional Monte Carlo
• Compare the prices and standard errors and find the variance
reduction factor (σˆ2naive/σˆ
2
new ). 5
essay、essay代写