You are on page 1of 17

2 OPTIONS

2 Options
Exercise 2.1. Prove that
r(T t)
St K  CA PA  S t Ke
RMSC 4001 Since 8
> r(T t)
Simulation Methods for Risk Management Science <PE + St = CE + Ke
CE = CA
>
:
and Finance PA PE
r(T t) r(T t)
Tutorial 1 Solution: Options and Futures PA CA + Ke St ) CA PA  S t Ke
Consider two portfolios:
Chen Kexin⇤ A: one European call option and K money account
B: one American put and one unit of stock
Department of Statistics, The Chinese University of Hong Kong
Case I: The American put is exercised at maturity T

AT = max(ST K, 0) + Ker(T t)
= max(ST , K) + K[er⇤(T t)
1]
1 Forward and Futures
BT = max(K ST , 0) + ST = max(ST , K)  AT
Exercise 1.1. A stock is expected to pay a dividend of $1 per share in two months and in five months.
Case II: The American put is exercised at ⌧ 2 [t, T )
The stock price is $50, and the risk-free rate of interest is 8% per annum with continuous compounding
for all maturities. An investor has just taken a short position in a six-month forward contract on the
stock. AT Ker(T t)

a) What are the forward price and the initial value of the forward contract? r(T ⌧) r(T ⌧)
BT = (K S⌧ + S⌧ )e = Ke  Ker(T t)
 AT
b) Three months later, the price of the stock is $48 and the risk-free rate of interest is still 8% per
annum. What are the forward price and the value of the short position in the forward contract?
Therefore
(a) CE + K = CA + K PA + S t ) CA PA St K
f0 = 0
0.08⇤2/12 0.08⇤5/12
I=e +e = 1.954
F0 = (50 1.954)e0.08⇤1/2 = 50.01
(b)
0.08⇤2/12
I=e = 0.9868
F1/4 = (48 0.9868)e0.08⇤3/12 = 47.96
0.08⇤3/12
f1/4 = (48 0.9868 50.01 ⇤ e ) = 2.01

Exercise 1.2. Suppose that F1 and F2 are two futures prices on the same commodity where the times to
maturity of the contracts are t1 and t2 with t2 > t1 . Prove that F2  F1 er(t2 t1 ) , where r is the interest
rate (assumed constant) and there are no storage costs. For the purposes of this problem, assume that
a futures contract is the same as a forward contract.
If F2 > F1 er(t2 t1 ) ,consider the following strategy:
Take long position of future mature at t1 and short position of future mature at t2
At t1 , buy the commodity with F1 which is borrowed at r,
At t2 , sell the commodity with F2 and pay the debt with F1 er(t2 t1 )
Risk-free profit at t2 = F2 F1 er(t2 t1 ) > 0

⇤ kxchen@link.cuhk.edu.hk

1 2
2 ITO’S PROCESS AND ITO’S LEMMA

2 Ito’s process and Ito’s Lemma


Exercise 2.1. Let Wt denotes a standard Brownian motion process.
(a) Let Yt = eWt . Write down the di↵usion process governs Yt
Rt
RMSC 4001 (b) Evaluate 0 eWs dWs
(a)
Simulation Methods for Risk Management Science @Yt 1 @ 2 Yt
dYt = dWt + (dWt )2
and Finance @Wt 2 @Wt2
1
= eWt dWt + eWt dt
Tutorial 3 Solution: Wiener process and Ito’s rule 2
(b)
Chen Kexin⇤ Z t Z Z t
1 t Ws
deWs = e dseWs dWs +
Department of Statistics, The Chinese University of Hong Kong 0 0 2 0
Z t Z
Wt Ws 1 t Ws
e 1= e dWs + e ds
0 2 0
Z t Z t
1
1 Wiener Process eWs dWs = eWt
2 0
eWs ds 1
0
Exercise 1.1. Actually Wiener process can be modelled by the following,
Exercise 2.2. Suppose the stock price follows the dynamics
p
W (tk+1 ) = W (tk ) + ✏tk t
dSt = µSt dt + St dWt
Where t = tk+1 tk with t0 = 0 and ✏tk ⇠ N (0, 1) are i.i.d random variable. Assume that W (t0 ) = 0,
Compute dYt if RT
show that this model satisfies the third condition of definition 1.1.. r(⌧ )d⌧
e t
Let i > j, Yt =
i 1
X p St
W (ti ) W (tj ) = ✏ tk t
k=j
@Yt @Yt 1 @ 2 Yt
Therefore dYt = dt + dSt + (dSt )2
@t @St 2 @St2
E[W (ti ) W (tj )] = 0 and V ar[W (ti ) W (tj )] = (i j) t = ti tj RT
r(⌧ )d⌧
RT
r(⌧ )d⌧
r(t)e t e t
= dt (µSt dt + St dWt )
Exercise 1.2. Prove that Wt3 3tWt is a martingale. St St2
RT
1 2e t r(⌧ )d⌧ 2
+ ( St2 dt)
E(Wt3 3tWt |Ws ) = E[(Wt Ws + Ws ) 3 3t(Wt Ws + Ws )|Ws ] 2 St3
2
= E[(Wt Ws )3 + 3(Wt Ws )2 Ws + 3(Wt Ws )Ws2 + Ws3 3t(Wt Ws ) 3tWs |Ws ] =[ µ r(t)]Yt dt Yt dWt
= 0 + 3Ws (t s) + Ws3 + 0 3tWs Exercise 2.3. Solve (
= Ws3 3sWs . dXt = (b aXt )dt + dWt
X0 = x

deat Xt = aeat Xt dt + eat dXt


= aeat Xt dt + eat [(b aXt )dt + dWt ]
= beat dt + eat dWt
Z t Z t Z t
as
de Xs = b eas ds + eas dWs
0 0 0
Z t
b
eat Xt x = (eat 1) + eas dWs
a 0
Z t
b
Xt = xe at + (1 e at ) + e a(t s)
dWs
a 0

⇤ s1155029151@link.cuhk.edu.hk

1 2
Exercise 0.2. .

1
RT
Suppose Y = T 0
lnSt dt and (
dSt = rSt dt + St dWt
RMSC 4001 S0 = s

Simulation Methods for Risk Management Science Determine the distribution of Y .

and Finance 1
Z T
Y = ln(St ) ln(S0 ) + ln(S0 )dt
T 0
Tutorial 4 Solution: Black-Scholes Model and Ito’s integral Z T
1 St
= ln( )dt + ln(S0 )
T 0 S0
Chen Kexin⇤ Z
1 T 1 2
= ln(S0 ) + (r )t + Wt dt
T 0 2
Department of Statistics, The Chinese University of Hong Kong 1 2
where we have used St = S0 e(r 2 )t+ Wt
Z Z
1 T 1 2 1 T
Exercise 0.1. Suppose the price of contingent claim satisfies the PDE = ln(S0 ) + (r )tdt + Wt dt
T 0 2 T 0
( 2 Z T
@f @f 1 2 2@ f 1 1 1
@t + rS @S + 2 S @S 2 rf = 0 = ln(S0 ) + (r )T + Wt dt
2 2 T 0
f (S, T ) = max(S K, 0)
1
RT
Show that Now we check the expectation and variance of T 0
Wt dt. First we apply Ito’s lemma to tWt .
rT (This guessed by integration by part). In fact,
f (S, 0) = e E[max(ST K, 0)]
Where ST is the solution to the SDE: dtWt = Wt dt + tdWt
(
dSt = rSt dt + St dWt Therefore, by taking integral on both sides:
S0 = s Z T Z T
T WT 0= Wt dt + tdWt
0 0

@f @f 1 2 2@ f 2
@f RT RT
df (S, t) = (
+ rS + S )dt + S dWt We conclude that 0
Wt dt = T WT 0
tdWt .
@t @S 2 @S 2 @S
@f Z T
= rf dt + S dWt 1
@S E[ Wt dt] = 0
T 0
rt rt @f Z T Z T Z T
e (df rf dt) = e S dWt 1 2 t 2 t
@S V ar[ Wt dt] = V ar[WT dWt ] = V ar[ (1 )dWt ]
T T T
rt rt @f Z
0 0 0
d(e f ) = e S dWt T 2
@S t 2 T
Z T = 2 (1 ) dt = .
rT rt @f 0 T 3
e f (S, T ) f (S, 0) = e S dWt
0 @S
Y is normally distributed with
rT rT
f (S, 0) = e E[f (S, T )] = e E[max(ST K, 0)] ✓ ◆
1 1 2
E(Y ) = lns + r T
2 2
Z T ✓ ◆2 2
2 t T
V ar(Y ) = 1 dt =
0 T 3

⇤ s1155029151@link.cuhk.edu.hk

1 2
2 MONTE CARLO SIMULATION

2 Monte Carlo Simulation


Notations:
• X = {X1 , ..., Xn } is a random vector, which could represent a stochastic process with Xi
RMSC 4001 representing the value at i-th time point.
Simulation Methods for Risk Management Science • h(X) : X 7! R is a function of X.

and Finance • ✓: the interested parameter related to X in the form E(h(X)), e.g. E(X), E(X 2 ).

Tutorial 5: Random number generation I • X : the domain of random variable X

Objective: Estimate ✓
⇤†
Kexin CHEN Algorithm:
• Step 1: Generate Xi

• Step 2: Calculate hi = h(Xi )


1 The Laws of Large Number
• Step 3: Repeat Step 1 and Step 2 for n times
As one of the most important theorems in statistics, Law of Large Number (LLN) is a model free
theorem, enabling us to estimate true parameters by simulation. • Step 4: ✓ˆ = 1
n (h1 + h2 + ... + hn )

Theorem 1.1 (# Weak Law of Large Number). Let X1 , X2 , . . . are independent identically distributed When n is large enough, ✓ˆ is a good estimator because it is unbiased and consistent by Week Law
(i.i.d.) random variables with of Large Number.
x P (|Xi | > x) ! 0 as x ! 1
Exercise 2.1. Suppose a stock follows the dynamics
Let Sn = X1 + · · · + Xn and µn = E(X1 1(|X1 |<n) ), then
dSt = rSt dt + St dWt
Sn /n µn ! 0 in probability as n ! 1
The risk-neutral pricing formula of European call option is
Theorem 1.2 (# Strong Law of Large Number). Let X1 , X2 , . . . are pairwise independent identically rT
C0 = e E[max(ST K, 0)]
distributed random variables with
E|Xi | < 1 Suppose r = 0.05, = 0.3, S0 = 50, K = 52, write down the algorithm and VBA programme to
Let Sn = X1 + · · · + Xn and EXi = µ, then approximate the half-year call option price by 10000 simulation paths.

Sn /n ! µ almost surely (a.s.) as n ! 1 Algorithm:


• Step 1: Generate Zi ⇠ N (0, 1) Application.NormSInv(Rnd())
To put it simple, the above two theorems tell us: if we assume E(X) or E(h(X)) exists, then the average p
of a large number of ‘independent’ simulations of X or h(X) will approach the true expectation, i.e. (i) (r 1 2
)T + T Zi
• Step 2: ST = S0 e 2 Sqr(T)
E(X) or E(h(X)).
(i) (i)
• Step 3: Compute hi = max(ST K, 0) Application.Max(ST K, 0)
Note the content marked # is NOT required.
• Step 4: Repeat Step 1 to 3 for 10000 times For i = 1 To 10000; Next i
e rT
P10000
• Step 5: C0 = 10000 i=1 hi

Sub calloption()
Dim r, sigma, S0, ST, K, T, payoff, price, z As Variant
Randomize
r = 0.05
sigma = 0.3
S0 = 50
K = 52
T = 0.5
price = 0
For i = 1 To 10000
z = Application.NormSInv(Rnd())
ST = S0 * Exp((r - 0.5 * sigma ˆ 2) * T + sigma * Sqr(T) * z)
payoff = Application.Max(ST - K, 0)
price = price + payoff / 10000
Next i
Cells(1, 1).Value = Exp(-r * T) * price
End Sub
⇤ kxchen@link.cuhk.edu.hk, Department of Statistics, The Chinese University of Hong Kong
† Material is based on the previous version by Zhiling GU

1 2
3 INVERSE TRANSFORM 3 INVERSE TRANSFORM

As shown in Monte Carlo simulation algorithm, we need to simulate the random variable related to our Exercise 3.1. The PMF of the geometric random variable X is :
interested parameters. If we know the distribution of the random variables, we can simulate them using
multiple algorithms. Here we first introduce inverse transform. P(X = j) = p(1 p)j 1
j = 1, 2, ...

Provide an algorithm of generating X. If p = 0.25,


Pj write a VBA code to generate X.
3 Inverse Transform First calculate the CMF: FX (j) = P(X  j) = i=1 p(1 p)i 1

Notations: 1 (1 p)j
FX (j) = p =1 (1 p)j
1 (1 p)
• fX (x) : X 7! [0, 1) is the probability density function (PDF) or probability mass function
(PMF) of random variable X Algorithm:

• FX (x) : X 7! [0, 1] is the cumulative density function (CDF) or cumulative mass function • Step 1: Generate a random number U ⇠ Uniform(0, 1)
(CMF) of random variable X
• Step 2: Set X = j if U 2 [FX (j 1), FX (j))
• X : the domain of random variable X
Objective: Simulate X ⇠ FX To be specific,
X=j if 1 (1 p)j 1
U <1 (1 p)j
Algorithm (Discrete case): Generate a discrete random variable X with PMF: ln(1 U) ln(1 U)
<j +1
X ln(1 p) ln(1 p)
P(X = xj ) = pj j = 0, 1, ..., pj = 1
ln(1 U)
j X=b c+1
ln(1 p)
• Step 1: Generate a random number U ⇠ Uniform(0, 1). where buc = the maximum integer less or equal to u, called the floor of a number
• Step 2: Transform U into X as follows,
Log(): natural log
j 1
X j
X Int(): floor, rounds a real number down to an interger
X = xj if pi  U < pi
i=0 i=0

Sub geometric()
This algorithm works because Dim u, x, p As Variant
p = 0.25
j 1 j j j 1 Randomize
X X X X For i = 1 To 10000
P(X = xj ) = P( pi  U < pi ) = pi p i = pj u = Rnd()
i=0 i=0 i=0 i=0 x = Int(Log(1 - u) / Log(1 - p)) + 1
Cells(i, 1).Value = x
Next i
End Sub

Remark 3.1. To generate U ⇠ Uniform(0, 1) in VBA, following code generate a random number from
[0, 1) uniformly.
U = Rnd()

Remark 3.2. The algorithm above can be summarize as: if xj are ordered so that x0 < x1 < ... and F
denotes the distribution of X, then

X = xj if F (xj 1)  U < F (xj )

That is after generating U , we determine the value of X by finding the interval [F (xj 1 ), F (xj )) in
which U lies. This also means that we want to find the inverse of F (U ) and thus the name of inverse
transform.

3 4
3 INVERSE TRANSFORM

Algorithm (Continuous case): Generate a continuous random variable X ⇠ FX ,


• Step 1: Generate a random number U ⇠ Uniform(0, 1).
• Step 2: Set X = FX 1 (U ), assuming the inverse FX 1 (x) exists.
RMSC 4001
This algorithm works because
Simulation Methods for Risk Management Science
P(X  x) = P(FX 1 (U )  x) = P(U  FX (x)) (1)
= FX (x) (2)
and Finance
(1) holds because FX is an non-decreasing function.
Tutorial 6: Random number generation II
(2) holds because 0  FX (x)  1 and the CDF of a uniform FU (y) = y for all y 2 [0, 1]
⇤†
Kexin CHEN
Exercise 3.2. Provide an algorithm and write a VBA code to generate
(
x if 0  x < 1
f (x) =
2 x if 1  x  2
1 Acceptance-rejection method
Rx
First calculate the CDF: FX (x) = P(X  x) = 1
f (t) dt
Notations:
(
x2
2 0x<1 • f : X 7! R is the density function of X, where X is domain of X
FX (x) = (2 x)2
1 2 1x2
• F : X 7! R is the distribution function of X
Algorithm:
• g : Y 7! R is the density function of Y, where Y is domain of Y

• Step 1: Generate U1 ⇠ U nif orm(0, 1). • G : Y 7! R is the distribution function of Y


p p Rx
• Step 2: If U1 < 0.5, set X = 2U1 , if U1 0.5, set X = 2 2(1 U1 ). Objective: Simulate X ⇠ F . However FX (x) = 1 f (t) dt can be very difficult to calculate. The
idea of acceptance-rejection method is to use another density g whose corresponding distribution G
‘If’ Statement: If ... Then ... ; ElseIf ... Then ... ; End If is easy to calculate, i.e. simulating Y ⇠ G is easy. The method then make use of the relationship
between f and g to simulate X ⇠ F .
Sub triangle()
Dim u, x As Variant
Randomize
Algorithm:
For i = 1 To 10000
1
u = Rnd() • Step 1: Generate Yi from a density g: Generate U1 ⇠ Uniform(0, 1); Yi = G (U1 ).
If u < 0.5 Then
x = Sqr(2 * u)
ElseIf u >= 0.5 Then
• Step 2: Generate a random number U2 ⇠ Uniform(0, 1).
x = 2 - Sqr(2 * (1 - u))
f (Yi )
End If • Step 3: If U2  cg(Yi ) , set Xi = Yi , otherwise return to Step 1.
Cells(i, 1).Value = x
Next i
End Sub where c satisfies
f (y)  cg(y) 8y
1
In order that the acceptance rate c (Proved in Thoerem 1.1) is as high as possible, we let

f (y)
c = max
y g(y)

⇤ kxchen@link.cuhk.edu.hk, Department of Statistics, The Chinese University of Hong Kong


† Material is based on the previous version by Zhiling GU

5 1
1 ACCEPTANCE-REJECTION METHOD 1 ACCEPTANCE-REJECTION METHOD

Theorem 1.1. The random variable X generated by rejection method has density f . Moreover, Program Hints
the number of iterations that this algorithm needs is geometric random variable with mean c. ‘Do-While’ Loop: Do... Loop While...
Assign value to a vector: Dim v() As Variant; v = [{1,2,3,4,5,7}]
Proof Change the length of a vector: ReDim v(1 to 7)
Let A be acceptance event, consider ‘Floor’ function: Int(), i.e. round down to the nearest integer
Z 1
P(A, Y  x) = P(A, Y  x|Y = y)g(y)dy Solution
1
Z x
Let Y be a discrete uniform random variable with P(Y = k) = 1
7 for k = 1, . . . , 7. Observe that
= P(A|Y = y)g(y)dy
1 P(X = k)
Z x ✓ ◆ c = max = max 7 · P(X = k) = 7 · P(X = 1) = 2.1.
f (Y ) k P(Y = k) k
= P U Y = y g(y)dy
1 cg(Y )
Z x ✓ ◆ Therefore, we set c = 2.1. Here is the algorithm:
f (y)
= P U g(y)dy 1. Generate Y from the discrete uniform distribution.
1 cg(y)
Z
1 x 2. Generate U from Uniform(0, 1).
= f (y)dy
c 1
P(X = y) P(X = y)
3. If U  = , set Xi = Y . Otherwise, return to step 1.
Note that the last equality holds only when f (y)
 1. c · P(Y = y) 0.3
cg(y)
4. Repeat Step 1 to 3 for 1, 000 times.
By passing x ! 1,
1
P(A) = Function rejection_discrete3()
c
Dim p() As Variant
Therefore, Z ’Assign a vector to p
x
P(A, Y  x) p = [{0.3,0.12,0.09,0.12,0.1,0.17,0.1}]
P(X  x) = P(Y  x | A) = = f (y)dy
P(A) 1 Do
’Step 1: Inverse transform to simulate dicrete uniform
u1 = Rnd()
Exercise 1.1. Use acceptance-rejection method to simulate 1000 samples from the following discrete
y = Int(7 * u1 + 1)
distribution. What is the theoretical acceptance rate? Confirm it by reporting the number of trials until
1000 samples are generated. ’Step 2:
u2 = Rnd()
x 1 2 3 4 5 6 7
rejection_discrete3 = y
P (X = x) 0.3 0.12 0.09 0.12 0.1 0.17 0.1 ’Step 3:
Loop Until u2 < p(y) / 0.3
End Function
Sub run_discrete()
N = 1000
’temp: store the number of trials
temp = 0

Dim x() As Variant


ReDim x(1 To N)

For I = 1 To N
’store accepted simulation in vector x
x(I) = rejection_discrete3()
Next I

For j = 1 To N
Cells(j, 1).Value = x(j)
Next j
Cells(1, 2).Value = temp

End Sub

2 3
2 GENERATING NORMAL RANDOM VARIABLES 2 GENERATING NORMAL RANDOM VARIABLES

Exercise 1.2. Suppose we want to simulate 10000 samples from the density Generate correlated normal random variable
3
Objective: Generate two standard normal random variables X1 and X2 with correlation ⇢.
f (x) = 20x(1 x) 0<x<1 Algorithm:
Provide an acceptance-rejection algorithm to simulate X ⇠ F • Step 1: Generate Z1 and Z2 with i.i.d N (0, 1)

f (x) 135 • Step 2: Transform Z1 and Z2 to X1 and X2 by
c = max =
x g(x) 64 (
X1 = Z 1
1. Generate U1 ⇠ Uniform(0, 1). p
X2 = ⇢Z1 + 1 ⇢2 Z 2
2. Generate U2 ⇠ Uniform(0, 1).
64
3. If U2  135 20U1 (1 U1 )3 , set X = U1 . Otherwise return step 1. Exercise 2.1. Consider two stocks, A and B and let Sa (t) and Sb (t) be the price of them at time t
where the dynamics are
4. Repeat Step 1 to 3 for 10,000 times.
dSa (t) = rSa (t)dt + a Sa (t)dW1 (t)
Function rejection_continuous() dSb (t) = rSb (t)dt + b Sb (t)dW2 (t)
Dim u1, u2 As Variant
Randomize Corr(W1 , W2 ) = ⇢

Do At time t, the wealth process is defined as


u1 = Rnd()
u2 = Rnd() Wt = na Sa (t) + nb Sb (t)
rejection_continuous = u1
Loop Until u2 <= 64 * 20 / 135 * u1 * (1 - u1) ˆ 3 Suppose ⇢ = 0.7, T = 0.5, r = 0.1, a = 0.2, b = 0.18, Sa (0) = 100, Sb (0) = 75 and na = nb = 100,
write down the algorithm and VBA programme to estimate
End Function ✓ ◆
WT
✓=P  0.9
Sub run_continuous() W0
For I = 1 To 10000
Cells(I, 1).Value = rejection_continuous() The simulation should have 10000 paths
Next I

End Sub

2 Generating normal random variables


Box-Muller Transformation
Let Y1 and Y2 are independent uniform random number in [ 1, 1], then conditioned Y12 + Y22 < 1,
( p
Z1 = Y1 2ln(Y12 + Y22 )/(Y12 + Y22 )
p
Z2 = Y2 2ln(Y12 + Y22 )/(Y12 + Y22 )

are two independent standard normal random variables. The following VBA function outputs
standard normal by this method.
Public Function rGauss()
Dim X1 As Variant, X2 As Variant, r As Variant

100
X1=2*Rnd()-1
X2=2*Rnd()-1
r=X1ˆ2+X2ˆ2

If r>=1 Then GoTo 100


rGauss=X1*Sqr(-2*Log(r)/r)

End Function

4 5
2 GENERATING NORMAL RANDOM VARIABLES

1. Generate Zi ⇠ N (0, 1), i = 1, 2


p
2. X1 = Z1 and X2 = ⇢Z1 + 1 ⇢2 Z2
( p
3. Simulate stock price at time T :
Sa (T ) = Sa (0)exp{(r 1 2
2 a )T + ap T X1 }
1 2
RMSC 4001
Sb (T ) = Sb (0)exp{(r 2 b )T + b T X2 }
Simulation Methods for Risk Management Science
4. WT = na Sa (T ) + nb Sb (T )
⇣ ⌘ and Finance
5. hi = 1 WW0  0.9
T

Tutorial 7: Mid-Term Review Solutions


6. Repeat step 1 to 5 by 10000 times
1
P10000
7. ✓ = 10000 i=1 hi LIU, Zicheng ⇤†

Sub probability() Department of Statistics, The Chinese University of Hong Kong


Dim S1, S2, S1T, S2T, p, r, sigma1, sigma2, n1, n2, theta, I As Variant
Dim z1, z2, X1, X2 As Variant
Dim N As Integer
r = 0.1 1 Exercises
sigma1 = 0.2
sigma2 = 0.18 Exercise 1.1. (Arbitrage opportunity)
S1 = 100 An European call option and a put option on a stock both have a strike price of $20 and expiration date
S2 = 75
in three months. Both sell for $3. The risk-free interest rate is 10% per annum, the current stock price is
n1 = 100
n2 = 100
$19 and a $1 dividend is expected in one month. Identify the arbitrage opportunity open to the trader.
T = 0.5
p = 0.7 Portfolio t=0 t = t⇤ t=T
theta = 0 CE CE (0) / (ST K)+
Randomize PE PE (0) / (K ST )+
N = 10000 St S0 St ⇤ + d

ST + der(T t )
For j = 1 To N ⇤
Kt Ke rT Ke r(T t ) K
z1 = Application.NormSInv(Rnd()) ⇤ ⇤

z2 = Application.NormSInv(Rnd()) dt de rt d der(T t )
rt⇤ t⇤ )
X1 = z1 C E + Kt + dt CE (0) + Ke rT + de / (ST _ K) + der(T
t⇤ )
X2 = p * z1 + Sqr(1 - p ˆ 2) * z2 PE + S t PE (0) + S0 / (ST _ K) + der(T
S1T = S1 * Exp((r - 0.5 * sigma1 ˆ 2) * T + sigma1 * Sqr(T) * X1)
S2T = S2 * Exp((r - 0.5 * sigma2 ˆ 2) * T + sigma2 * Sqr(T) * X2) By put-call parity, a non-arbitrage put option should worth:
If n1 * S1T + n2 * S2T <= 0.9 * (n1 * S1 + n2 * S2) Then
rT rt⇤ 0.1⇤3/12 0.1⇤1/12
I = 1 PE = CE + Ke + de S0 = 3 + 20e +e 19 = 4.5
Else ’ElseIf n1 * S1T + n2 * S2T > 0.9 * (n1 * S1 + n2 * S2) Then
I = 0 Therefore, the put option is cheaper than its non-arbitrage price.
End If Consider a portfolio: long one put, long one stock and short one call.
theta = theta + I / N - Initial cost = 19.
Next j - At maturity, either the put or the call will be exercised. The payo↵ is 20 + e0.1⇤2/12 if ST < 20,
Cells(1, 1).Value = theta or ST + (ST 20) + e0.1⇤2/12 if ST > 20.
End Sub The present value of gain is at least
0.1⇤3/12 0.1⇤1/12
19 + 20e +e = 1.5

⇤ s1155061903@link.cuhk.edu.hk
† Material is based on the previous version by Zhiling GU

6 1
1 EXERCISES 1 EXERCISES

Exercise 1.2. (Put-call parity) Exercise 1.4. (Monte Carlo simulation)


Let r be the risk-free rate, q be the continuously compounded dividend rate, K be the strike price, T be Suppose a stock S follows the mean-reverting log-normal model (MRL) under risk neutral measure Q,
the maturity, S0 be the current stock price, CE (S0 , K, r, T ) be the price of a European Call option and
PE (S0 , K, r, T ) be the price of a European Put option. Prove the following equation by constructing two dSt
= [(✓ ln St )]dt + dWt ,
replicating portfolios. St
CE + Ke rT = S0 e qT + PE .
where ✓ and  are non-negative constants and is positive. We are interested in valuing a put option
price on S with strike price K and maturity T . The option price is given by
Portfolio t=0 t=T
CE CE (0) (ST K)+ e rT
E Q [max(K ST , 0)]
PE PE (0) (K ST )+
St S0 e qT ST (a) Use Ito’s lemma to find the stochastic di↵erential equation of yt = et ln St .
Kt Ke rT K (b) Find the distribution of ln ST .
rT (c) Construct an algorithm for the put option with 10000 runs when  = 0.01, ✓ = 0, S0 = 1, K = 0.95,
C E + Kt CE (0) + Ke ST _ K
PE + St e qT PE (0) + S0 e qT
ST _ K r = 0.05, T = 1 and = 0.1.

Since the last two portfolios in the table above are the same at maturity, they must have the same (a) 
value at initial time, i.e. 1 t
CE + Ke rT = S0 e qT + PE . dyt = ✓et e 2
dt + et dWt .
2
⇤ (b)
1 2
T ✓ 2 T
Exercise 1.3. (Random number generation) E(ln ST ) = e lnS0 + (1 e ),

Suppose we want to simulate |Z|, where Z ⇠ N (0, 1). The p.d.f of |Z| is given by 2
V ar(ln ST ) = (1 e 2T ).
2 x2 /2
2
f (x) = p e , 0 < x < 1.
2⇡ ln ST ⇠ N (E(ln ST ), V ar(ln ST )).

Use the acceptance-rejection algorithm to simulate |Z|. Take g to be the exponential distribution, (c)
1. Generate Zi ⇠ N (0, 1).
x 2. Set
g(x) = e , 0 < x < 1. r
1 2 2
⇣ ⌘ T ✓ 2 T 2T )Z
Xi = e lnS0 + (1 e )+ (1 e i.
(a) Determine the value c such that c = max fg(x)
(x)
.  2
(b) Use the acceptance-rejection method to simulate 1000 values of |Z|. 3. Set hi = max(K eXi , 0).
(c) Recover a standard normal distribution from the simulated values of |Z|. Plot its density. 4. Repeat step 1 to step 3 for 10000 times.
e rT
P
10000
5. P0 = 10000 hi .
i=1
(a) ✓ ◆
f (x) 2
c = max = p e1/2
g(x) 2⇡
(b)
1. Generate U1 ⇠ U nif orm(0, 1) and U2 ⇠ U nif orm(0, 1).
2. Set X = ln h U12. i
x 1
3. If U2  exp 2 +x 2 , set Z = X; otherwise return to step 1.

(c)
1. Generate U3 ⇠ U nif orm(0, 1).
2. If U3 < 0.5, set Z = Z; If U3 > 0.5, set Z = Z.

2 3
1 EXERCISES

Exercise 1.5. (Black-Scholes formula derivation)


(a) Suppose X ⇠ N (µ, 2 ). Determine E[max(eX K, 0)].
(b) Suppose the stock price follows Black-Scholes model in a risk neutral world,

dSt = rSt dt + St dWt .


RMSC 4001
Using (a), derive the Black-Scholes formula for a call option.
Simulation Methods for Risk Management Science
(a) and Finance
R1 (x µ)2
E[max(eX K, 0)] = (ex K) p 1 2 e
ln K
2 2 dx Tutorial 8: Value at Risk / Variation Reduction Methods I Solutions
2⇡
R
µ+ 12 2 1 p 1
(x µ 2 )2
R1 (x µ)2
= e ln K
e 2 2 dx K ln K
p1 e 2 2 dx
2 2⇡ 2⇡ 2 ⇤†
LIU, Zicheng
2
h 2
i h i
µ+ 12 ln K µ ln K µ
= e 1 ( ) K 1 ( ) Department of Statistics, The Chinese University of Hong Kong
2 2
µ+ 12 ln K+µ+ ln K+µ
= e ( ) K ( ).

(b) 1 Value at Risk (VaR)


⇣ 1 ⌘
2 2
ln ST ⇠ N ln S0 + (r )T, T .
2 Revenue
p
Substitute x = ln ST , µ = ln S0 + (r 1 2
)T , = T into part (a): Revenue: REV (t, T ) = WT Wt .
2

⇣ ln S0 + (r + 1 2
)T ⌘ ⇣ ln S0 + (r 1 2
)T ⌘ Return
rT K 2 rT K 2
e E[max(ST K, 0)] = S0 p Ke p . Arithmetic return: r(t, T ) = WTWtWt .
T T
Geometric return / Logarithmic return: r(t, T ) = log( W
Wt ) = log(WT )
T
log(Wt ).

Value at Risk (VaR)


VaR↵ : The worst loss over a target horizon with a given level of confidence c (or equivalently, a
lower-tail level ↵ = 1 c).

Absolute VaR
Absolute VaR: The maximum amount we expect to lose with a given level of confidence.
Abs.VaR in dollar = REV ⇤ , where REV ⇤ is the cut-o↵ revenues/returns conditioning on the
confidence level and the horizon we choose.

Relative VaR
Relative VaR: The maximum amount we expect to lose with a given level of confidence relative to
the mean/expected revenue.
Rel.VaR in dollar = Abs.VaR + Mean Revenue = Mean Revenue – REV ⇤ .

VaR in Return
Abs.VaR in arithmetic return = Abs.VaR in dollar / W ;
Rel.VaR in arithmetic return = Rel.VaR in dollar / W ,
where W denotes the initial value of the portfolio.

Remark: VaR measures are non-negative in almost all cases.

⇤ 1155061903@link.cuhk.edu.hk
† Material is based on the previous version by Zhiling GU

4 1
1 VALUE AT RISK (VAR) 2 VOLATILITY CONVERSION OVER DIFFERENT DURATIONS

Exercise 1.1. (2010 final) 2 Volatility Conversion over Di↵erent Durations


Suppose the 3-month log-return of a portfolio is given by
The volatility of an asset’s return can be defined as the standard deviation of its logarithmic
R = µ + X,
return. If the period of the return is 1 year, then is an annualized volatility.
where the 3-month volatility is 10% and the 3-month drift µ is 2%. The current portfolio value is $5
million. Answer the following questions: In general, for any time period T measured in year, we can convert
(a) If X ⇠ N (0, 1), determine the 95% absolute VaR for the portfolio over 3 months. p
T = annual T .
(b) Determine the 95% absolute VaR over 3 months if X follows Laplace distribution with ✓ = 1. The
pdf of Laplace distribution is given by Similarly, if we assume there are 252 trading days per year, then
1 |x| p
f (x) = exp( ), 1 < x < 1, ✓ > 0. annual = daily 252.
2✓ ✓
Confirm your answers by simulation. The mean return over time, however, is linearly proportional to the period T :

Hints: µT = µannual T.

• To find X↵ such that P (X↵  x) = ↵, where X ⇠ N (0, 1) ! Application.NormSInv(↵)


Exercise 2.1. A portfolio has a size of $1 million with an annualized return following N (0.1, 0.2).
• To find ↵-th percentile of an array ! Percentile(Range, ↵) Compute its two-year 95% absolute VaR. Then propose an algorithm to confirm the answer by simulation
of 10000 samples.
(a) R ⇠ N (0.02, 0.12 ).
Solution:

P(R  VaR) = 0.05.


✓ ◆ R1yr ⇠ N (0.1, 0.2).
VaR 0.02
P Z = 0.05. R2yr ⇠ N (0.2, 0.4).
0.1
P(R2yr  VaR) = 0.05.
VaR 0.02 ✓ ◆
= 1.645. VaR 0.2
0.1 P Z p = 0.05.
VaR = 0.1445. 0.4
VaR 0.2
Absolute VaR for the portfolio over 3 months = 5 5⇥e 0.1445
= $0.6727 million. p = 1.645.
0.4
VaR = 0.8404.
(b) (
1 x
2e , 1 < x < 0;
f (x) = 1 x Absolute VaR for the portfolio over 2 years = 1 e 0.8404 = $0.5685 million.
2e , 0  x < 1.
( Algorithm:
1 x
1 < x < 0; 1. Generate Zi (0, 1).
F (x) = 2e , p
1 x 2. Xi = 0.1 ⇥ 2 + 0.2 ⇥ 2Zi .
1 2e , 0  x < 1.
3. Repeat step 1 to 2 for 10000 times.
4. Find the 5% percentile of the revenue {eXi 1}, i.e. REV ⇤ , and Abs.VaR = REV ⇤ .
P(R  VaR) = 0.05.
✓ ◆ Remark:
VaR 0.02
P X = 0.05. We can only rescale means and variances for logarithmic returns (i.e. not applicable to arithmetic
0.1
returns).
VaR 0.02
= ln(0.1).
0.1
VaR = 0.2103.

0.2103
Absolute VaR for the portfolio over 3 months = 5 5⇥e = $0.9483 million.

2 3
3 ANTITHETIC VARIABLES

3 Antithetic Variables
Idea
Suppose we want to estimate ✓ = E[H(X)], where H(.) is monotone function (either increasing or
decreasing) and X is a random variable. Normally, we can do classic Monte Carlo simulations: RMSC 4001
1 X
2n Simulation Methods for Risk Management Science
HM C = H(Xi ).
2n i=1 and Finance
If we can construct a sequence of antithetic variables Yi such that each Yi has the same distribution Tutorial 9: Variation Reduction Method II Solutions
but negatively correlated with Xi . Then the antithetic estimator of ✓ is
n Liu, Zicheng⇤†
1 X
HAN = [H(Xi ) + H(Yi )].
2n i=1 Department of Statistics, The Chinese University of Hong Kong
If H(Xi ) and H(Yi ) are negatively correlated, then Var(HAN ) is smaller than Var(HM C ).

Examples of antithetic variables 1 Control Variate


• Ui ⇠ Unif [0, 1]. Then Vi = 1 Ui would have the same distribution as Ui , but they are Idea
negatively correlated. Suppose we want to estimate ✓ = E(X) by simulation. If we know some other variable Y with
mean µY = E(Y ) is known. Then for any given constant c, the quantity
• Xi ⇠ N (µ, 2 ). Then Yi = 2µ Xi would have the same distribution as Xi , but they are
negatively correlated. XCV = X + c(Y µY )
Remark 3.1. In general, we generate Xi = F 1 (Ui ) by inverse transform. Let Yi = F 1
(1 Ui ). is also an unbiased estimator of ✓. The problem is how we choose c such that variance reduction
Then Xi and Yi share F as their common cdf, but they are negatively correlated. can be achieved. Note that
Think: Why Xi and Yi (and in general, H(Xi ) and H(Yi )) are negatively correlated? 2
CV = Var X + c2 Var Y + 2c Cov(X, Y ).
R1 x3
2
is minimized when c⇤ = Cov(X, Y )/ Var Y , with minimized variance
Exercise 3.1. Consider ✓ = 0 e dx. Provide an algorithm and a VBA program to estimate ✓ using CV

the antithetic variable method. Your simulation should have 10000 paths in all. 2
c⇤ = Var X · (1 Corr2 (X, Y )).
3
Observe that ✓ = E(eU ), where U ⇠ Unif [0, 1].
1. Generate Ui ⇠ Unif [0, 1] The variance of XCV can be reduced as long as X and Y are not uncorrelated. Without prior
3 3 knowledge of population variances and covariance, we may use sample estimations instead. The
2. Set Xi = eUi and Yi = e(1 Ui ) .
control variate estimate is hence
3. Repeat step 1 to 2 by 5000 times.
5000
1 X d
Cov(X, Y) SXY
4. ✓ = (Xi + Yi ). XCV = X̄ (Ȳ µY ) = X̄ (Ȳ µY ).
10000 i=1 d
VarY SY Y

Observe that this result is same as running a linear regression of X against Y .

Remark 1.1. If we want to have more than one control variate, we can use outputs from the
multiple linear regression model by
k
X i.i.d. 2
X =a+ bi Yi + e, e ⇠ N (0, ).
i=1

Then the control variate estimate is given by


k
X
â + b̂i µi ,
i=1

where µi = E(Yi ).

⇤ s1155061903@link.cuhk.edu.hk
† Modified based on tutorial notes in the past years

4 1
1 CONTROL VARIATE 2 STRATIFIED SAMPLING

R1
Exercise 1.1. Estimate ✓ = 0
3 3
ex dx by considering x2 ex as the control variate. 2 Stratified sampling
Z 1 Z
3 3 1 1 x3 3 1
E(U 2 eU ) = x2 ex dx = e dx = (e 1) = µY . Idea
0 3 0 3
Stratification is the process of dividing members of population into homogeneous subgroups before
1. Generate Ui ⇠ U (0, 1). sampling. The strata should be mutually exclusive: every element in the population must be
3 3
2. Set Xi = eUi and Yi = Ui2 eUi . assigned to only one stratum.
3. Repeat step 1 to 2 by 10000 times.
4. In stratified sampling, we use E(X|Y ) as the estimator of X. This estimator is unbiased because
d
Cov(X, Y) of tower property
✓CV = X̄ (Ȳ µY ).
Vd
ar(Y ) E[E(X|Y )] = E(X).
Also, the variance can be reduced since
Exercise 1.2. Suppose we want to price an arithmetic floating strike Asian put option with payo↵
max(AT ST , 0). For tj+1 tj = t, j = 0, 1, ..., n 1 and tn = T , V ar(X) = E[V ar(X|Y )] + V ar[E(X|Y )] V ar[E(X|Y )]

1
m
X Some notations
At m = St j , 1  m  n.
m j=1 • B : number of bins/strata in the sample.

Suppose T = 1, n = 4 and the asset price follows the following dynamics • NB : number of samples in each bin.
• B ⇥ NB : total number of samples.
dSt = rSt dt + St dWt , r = 0.02, = 0.4.
• Xij : the j th sample of ith bin.
The current time is t0 with current asset price St0 = 100. Simulate the Asian option price based on
10000 sample paths using AT as the control variate.
Illustrative generalized example
1h i
Again we want to estimate ✓ = E(X) by stratified sampling by dividing the sample into B strata
µY = E(AT |St0 ) = St0 e0.02/4 + St0 e0.02⇤2/4 + St0 e0.02⇤3/4 + St0 e0.02
4 with equal probability. Suppose we can generate X = F 1 (U ) by inverse transform, then we can
1. Generate stratify the sample X by the following algorithm:
" r # 1
1 2 1 1 iid
1. Generate Vij = B [Ui + (i 1)], i = 1, 2, ..., B, j = 1, 2, ..., NB
S(tj ) = S(tj 1 ) exp (r )( ) + Zj , j = 1, 2, 3, 4, Zj ⇠ N (0, 1).
2 4 4 2. Set Xij = F 1
(Vij ) in each bin.
P4 3. Calculate the sub-sample mean X̄i for each bin.
2. Compute AT = 14 j=1 S(tj ).
3. Set Xi = max(AT St4 , 0) and Yi = AT . 4. Average X̄i over the total number of bins to get the overall estimate of X.
4. Repeat step 1 to 3 10000 times.
5. Asian option price " # The estimate of ✓ is given by
d
Cov(X, Y)
rT NB
pCV = e X̄ (Ȳ µY ) . 1 X
Vd
ar(Y ) (X1j + X2j + ... + XBj ).
B ⇥ NB j=1

2 3
3 IMPORTANCE SAMPLING 3 IMPORTANCE SAMPLING

R1 R R 1)2
Exercise 2.1. Consider ✓ = 2 (x 2)e x dx. It is known that ✓ = E[f (X)] where X ⇠ exp(1). Exercise 3.1. Estimate ✓1 = e |x|
dx and ✓2 = e
(x
8 dx using independent samples following
R R
(a)What is f (X)? N (0, 1).
(b)Provide an algorithm to sample X in [2, 1].
(c) Provide an algorithm and VBA programme to simulate ✓ by stratifying X on the interval [2, 1] with 1. Generate Ui ⇠ N (0, 1).
equal probability 1/4 for each stratified interval. The total sample should be 10000. p Ui2 p (Ui 1)2 Ui2
2. Compute Xi = 2⇡e |Ui |+ 2 , Yi = 2⇡e 8 + 2 .
(a) Z Z 3. Repeat step 1 and 2 for n times.
1 1
x x P
n P
n
✓= (x 2)e dx = (x 2)I(x 2)e dx. 4. Estimate ✓1 = n1 Xi , ✓2 = n1 Yi .
2 0 i=1 i=1
) f (X) = (X 2)I(X 2).
(b) Exercise 3.2. Consider an European call option on a non-dividend paying stock S with the risk-free
Let Y = X 2|X 2. By memoryless property of exponential distribution, Y ⇠ exp(1). instantaneous interest rate r to be a deterministic function of time t. The risk-neutral process of the
Therefore, X|X 2 can be sampled by ln(U ) + 2, where U ⇠ Unif(0, 1). stock and the interest rate movements are

dS(t) = r(t)S(t)dt + S(t)dW (t),


(c) (
Note that E [(X 2)I(X 2)] = E [(X 2)|X 2] P (X 2). 0.005e3t , t  0.5;
r(t) =
1. Generate Uj ⇠hUnif(0,
i 1). 0.04, t > 0.5.
U +i
2. Set Vij = ln j4 + 2, for i = 0, 1, 2, 3 and j = 1, 2, ..., 2500.
S(0) = 100 is the observed initial stock price, and the volatility = 40%. The European call option has
3. Compute Yij = Vij 2. a maturity of 1 year and a strike price of 105.
4. Repeat step 1 to 3 for 2500 times for each i = 0, 1, 2, 3. Suppose that sampling from a standard normal random variable is not available. You have to substitute
P
2500
1
5. ✓stra = 10000 (Y0j + Y1j + Y2j + Y3j ) ⇥ e 2 . by using the Laplace distribution with ✓ = 1 as an additional importance sampling. Provide an algorithm
j=1 and VBA programme to estimate the call option price. The simulation should involve 10000 terminal
asset values.
1. Generate Ui ⇠ Unif(0, 1).
3 Importance sampling 2. (Laplace Sampler) If Ui < 0.5, then Yi = ln(2Ui ); if Ui > 0.5, then Yi = ln[2(1 Ui )].
3. Compute
Suppose we are interested in estimating ⇣ ⌘
R1 1
Yi2
Z Profit · f (Yi ) max S0 exp( 0 r(t)dt 2
2
+ Yi ) K, 0 p12⇡ e 2

✓ = E[h(X)] = h(x)f (x)dx, X ⇠ F. hi = = 1 |Yi |


g(Yi ) 2e

Suppose that the direct generation of X ⇠ F is infeasible. However, there exist another density 4. Repeat step 1 to 3 for 10000 times.
R1 10000
g(x) which is easy to simulate and satisfies exp( 0 r(t)dt) X
5. Price = hi .
10000
f (x) = 0 whenever g(x) = 0. i=1

Then we have the following equities:

✓ = E[h(X)]
Z
= h(x)f (x)dx
Z
h(x)f (x)
= g(x)dx
g(x)

h(Y )f (Y )
=E , Y ⇠ G.
g(Y )

Therefore, we can construct a Monte Carlo estimator of ✓ = E[h(X)] by first sampling i.i.d. Yi ’s
with pdf g, and then computing
n
1 X h(Yi )f (Yi )
✓ˆ = .
n i=1 g(Yi )

4 5
Exercise 0.2. Consider evaluating the price of a European call option. Recall that the payo↵ of the
call is positive if and only if Z > L, where
2
1 K
L= [ln( ) (r )T ], Z ⇠ N (0, T ).
RMSC 4001 S0 2

Let Z̃i = L + eZi denote a shifted lognormal random variable, where Zi ⇠ N (µ, ⌘ 2 T ).
Simulation Methods for Risk Management Science
fZ (x)
and Finance (a) Let R(x) =
fZ̃i (x)
, where fZ (x) denote the pdf of a N (0, T ) random variable evaluated at x and

Tutorial 10: Final Revision Solutions fZ̃i (x) denotes the pdf of the shifted lognormal random variable Z̃i evaluated at x. Show that
( " ✓ ◆2 #)
1 ln(x L) µ
Liu Zicheng⇤† R(x) = ⌘(x L) exp x2
2T ⌘

Department of Statistics, The Chinese University of Hong Kong (b) Show that the important sampling estimator based on the pdf of the shifted lognormal distribution
is given by
n
All materials before the midterm exam may be tested. 1X 2
CLN = e rT (S0 exp[(r )T + Z̃i ] K)+ R(Z̃i ).
n i=1 2
Exercise 0.1. Provide the simulation algorithms for the following methods to generate a bivariate
normal random vector (X1 , X2 ) with zero means, unit variances and a correlation of -0.6.
(a) The cdf of Zei is
1. Cholesky decomposition;
✓ ◆
log(z L) µ
2. Gibbs sampling; P(Zei  z) = P(L + eZi  z) = P(Zi  log(z L)) = p
⌘2 T
3. Metropolis-Hastings algorithm with proposal distributions
for z > L. Therefore, the density function is
X1 ⇠ N (X2 , 1) and X2 ⇠ N (X1 , 1). ✓ ◆ ⇢ ✓ ◆2
log(z L) µ 1 log(z L) µ
p exp 2
p 2
d ⌘2 T ⌘ T
(i) (i) i.i.d. fZei (z) = P(Zei  z) = p = p
1. Step 1: Generate Z1 , Z2 ⇠ N (0, 1). dz (z L) ⌘2 T (z L) 2⇡⌘ 2 T
(i) (i) (i) (i) (i)
Step 2: Take X1 = Z1 , X2 = 0.6Z1 + 0.8Z2 .
Step 3: Repeat Steps 1 and 2 for i = 1, 2, 3, · · · , n. for z > L. Hence,
⇢ ✓ ◆2
(0) (0)
2. Step 1: Initialize X1 , X2 . ✓ ⇢ ✓ ◆2 ◆ ✓ exp 1 log(x L) µ
p 2 ◆
(i) (i 1) fZ (x) 1 1 x 2 ⌘ T
Step 2: Generate X1 ⇠ N ( 0.6X2 , 0.64). R(x) = = p exp p p
(i) (i) fZei (x) 2⇡T 2 T (x L) 2⇡⌘ 2 T
Step 3: Generate X2 ⇠ N ( 0.6X1 , 0.64). ⇢
Step 4: Repeat Steps 2 and 3 for i = 1, 2, 3, · · · , n. 1 2 log(x L) µ 2
= ⌘(x L) exp [x ( ) ] .
Step 5: Discard the first k burn-in samples. 2T ⌘
(0) (0) (b)
3. Step 1: Initialize X1 , X2 .
(i 1) (i 1)
Step 2: Generate Y1 ⇠ N (X2 , 1) and Y2 ⇠ N (X1 , 1). ⇥ 2 ⇤
rT
Step 3: Generate U ⇠ Unif[0,
✓ 1]. h⇣ ⌘ i ◆ C = e EZ (S0 exp{(r )T + Z)} K)+
2
1 (i
X1
1) 2 (i
+X2
1) 2
+1.2X1
(i 1) (i
X2
1)
(Y12 +Y22 +1.2Y1 Y2 ) Z 1 2
Step 4: Compute ⇢ = min e 2⇥0.82 ,1 . rT
= e (S0 exp{(r )T + z)} K)+ fZ (z)dz
Step 5: If U < ⇢, then take X (i) = Y . Otherwise, take X (i) = X (i 1)
. L 2
Z 1 2
Step 6: Repeat Steps 2 to 5 for i = 1, 2, 3, · · · , n. rT fZ (z)
= e (S0 exp{(r )T + z)} K)+ f e (z)dz
Step 7: Discard the first k burn-in samples. L 2 fZei (z) Zi
 2
= e rT
EZei (S0 exp{(r )T + Zei )} K)+ R(Zei ) .
2

Hence, the importance sampling estimator is given by


n
1X
CLN = e rT
(S0 exp[(r 2
/2)T + Zei ] K)+ R(Zei ).
n i=1
⇤ 1155061903@link.cuhk.edu.hk
† Modified based on previous tutorial notes.

1 2
Exercise 0.3. Consider the spread weighted average option whose payo↵ is Exercise 0.4. A non-divended paying stock S has a time-deterministic volatility. It is postulated that

max[A1 (T ) A2 (T ) K, 0]. dS(t) = µS(t)dt + (t)S(t)dW1 (t),


(t) = 0.15e3t for t  0.5 and (t) = 0.3 for t > 0.5,
where Ai (T ) is the weighted average price of asset i, Si (t), for i = 1, 2. For tj+1 tj = t, j = 0, 1, ...n
and tn = T , where the current stock price is S(0) = 100 and µ = 0.1.
m
X j
Ai (tm ) = wj Si (tj ), 81  m  n, where wj = Pn .
j=1 k=1 k (a) What is the distribution of ln S(T ) for T > 0.5?
(b) Construct an important sampling simulation for the 99% VaR of holding the stock for t = 1, based
Suppose that T = 1, n = 12, t = 1/n and the underlying assets follow the Black-Scholes model with on a proposal distribution of N ( 0.3, 0.32 ).
r = 2%, volatility 1 = 40% and 2 = 30% for asset 1 and 2 respectively, and the correlation coefficient
between the two asset returns is ⇢ = 0.5. (a)
1 2
d ln S(t) = (µ )dt + dW1 (t).
(a) Now assume that the current time is t = t4 with current asset prices are S1 (t4 ) = S2 (t4 ) = 100. The 2
Z T
strike price is K = 4 and realized weighted average values are A1 (t4 ) = 12.5 and A2 (t4 ) = 13. Determine 1 2
ln S(T ) = ln S(0) + (µ )dt + dW1 (t).
Āj = E Q [Aj (T )|Sj (t4 ), Aj (t4 )] in close-form solutions for each j = 1, 2. 0 2
2 2
Therefore, ln S(T ) ⇠ N (E, V ), where E and V is given by
Ā1 = E Q [A1 (T )|S1 (t4 ), A1 (t4 )]
12
E = Mean of ln S(T )
X r(j 4) Z T
= A1 (t4 ) + wj S1 (t4 )e 12 1 2
= ln S(0) + (µ )dt
j=5 0 2
12
X r(j 4) = ln 100 + 0.05 0.001875(e3 1) + 0.055(T 0.5),
= 12.5 + 100 wj e 12 ,
V2 = Variance of ln S(T )
j=5 Z T
12
X 2
r(j 4) = dt
Ā2 = 13 + 100 wj e 12 . 0
j=5 = 0.00375(e3 1) + 0.09(T 0.5).
(b) Simulate the option price with 5000 pairs of asset price paths using A1 A2 as the control variate. (b)
Detail the algorithm and save your VBA programme. f (x) (x+0.3)2 x2
R(x) = = 0.3e 2⇥0.32 2
.
Ā1 Ā2 = 0.5. g(x)
i.i.d. 2
(ij) (ij) i.i.d.
Step 1: Generate n samples ⇠ N ( 0.3, 0.3 ).
1. Generate Z1 , Z2 ⇠ N (0, 1). Step 2: Compute the n stock values, S(1), using the samples as the fluctuation.
(ij) (ij) (ij) (ij)
p (i)
2. Set W1 = Z1 and W2 = ⇢Z1 + 1 ⇢2 Z2 . Step 3: Sort all stock values from the smallest to the biggest. Number them as S(1)1 , S(1)2 , · · · ,
3. Compute 8 q and number their underlying samples as x1 , x2 , · · · .
<S (i) (tj+1 ) = S (i) (tj ) exp[(r 1 2 )( 1 1 (ij) Pi
1 1 2 1 12 ) + 1
q 12
W1 ], Step 4: Starting from M0 = 0 and i = 1, compute Mi = n1 R(xk ).
:S (i) (tj+1 ) = S (i) (tj ) exp[(r 1 2 1 1 (ij) k=1
2 2 2 2 )( 12 ) + 2 12 W2 ]. Step 5: If Mi 1 < 0.01 and Mi 0.01, then 99% VaR = S(0) S(1)i . Otherwise, return to step 4.
4. Repeat step 1 to 4 for j = 4, 5, ..., 11.
5. Compute (
(i) P12 (i)
A1 (T ) = A1 (t4 ) + j=5 wj Ŝ1 (tj ),
(i) P12 (i)
A2 (T ) = A2 (t4 ) + j=5 wj Ŝ2 (tj ).
6. Set (
(i) (i)
Yi = max[A1 (T ) A2 (T ) K, 0],
(i) (i)
Xi = A1 (T ) A2 (T ).
7. Repeat step 4hto step 6 for 5000 times.i
d
Cov(X,Y )
8. Price = e rT Ȳ d (X̄ + 0.5) .
V ar(X)

3 4

You might also like