Numerical Methods
Numerical Methods
Numerical Methods
In this lecture. . .
1
By the end of this lecture you will be able to
2
Introduction
3
Relationship between derivative values and simulations
Theory says:
• dS = rS dt + σS dX.
This is simply our usual lognormal random walk but with the
risk-free rate instead of the real growth rate.
4
Justification:
• Binomial method
• Martingale theory
5
We can therefore write
6
The algorithm:
7
How do we simulate the asset?
Two ways:
1. If the s.d.e. for the asset path is integrable and the contract
is not path dependent (or American) then simulate in ‘one
giant leap’
8
One giant leap: A method that works in special cases
For the lognormal random walk we are lucky that we can find a
simple, and exact, time stepping algorithm.
t
S(t) = S(0) exp r−1 σ 2 t+σ dX .
2 0
i.e.
1 2
√
• S(T ) = S(0) exp r − 2σ T + σ T φ .
9
Because this expression is exact and simple it is the best time
stepping algorithm to use. . . but only if we have a payoff that
only depends on the final asset value, i.e. is European and path
independent.
We can then simulate the final asset price in one giant leap,
using a time step of T if both of these are true
10
Simulating the entire path: A method that always works
√
δS = rS δt + σS δt φ,
11
Errors
There are two (at least) sources of error in the Monte Carlo
method:
12
Generating Normal variables
13
Accuracy and computational time
If you want to halve the error it will take eight times as long.
14
In higher dimensions. . .
15
Other issues
• Greeks
16
Advantages of Monte Carlo simulations
17
• The effort in getting some answer is very low
18
Disadvantages of Monte Carlo simulations
19
Finite difference methods
20
Grids
21
S
The finite-difference grid usually has equal time steps and equal
S steps.
22
Differentiation using the grid
Notation: time step δt and asset step δS. The grid is made up
of the points at asset values
S = i δS
and times
t = T − k δt
where 0 ≤ i ≤ I and 0 ≤ k ≤ K.
We will be solving for the asset value going from zero up to the
asset value I δS.
23
Write the option value at each of these grid points as
Expiration
i k
Vi
S =0
k t
24
Approximating θ
∂V V (S, t) − V (S, t − h)
= lim .
∂t h→0 h
∂V Vik − Vik+1
(S, t) ≈ .
∂t δt
25
S
Use the option values
at these two points to
calculate the theta
26
We can expand the option value at asset value S and time t − δt
in a Taylor series about the point S, t as follows.
∂V
V (S, t − δt) = V (S, t) − δt (S, t) + O(δt2).
∂t
k k+1 ∂V
Vi = Vi + δt (S, t) + O(δt2).
∂t
∂V Vik − Vik+1
(S, t) = + O(δt).
∂t δt
27
Approximating ∆
Backward difference
Forward
difference
We want to
approximate the
derivative at this point
S
28
These three approximations are
k −Vk
Vi+1 i
,
δS
Vik − Vi−1
k
δS
k −Vk
Vi+1 i−1
and .
2 δS
29
From a Taylor series expansion of the option value about the
point S + δS, t we have
∂V 1 2 ∂ 2V 3 ).
V (S + δS, t) = V (S, t) + δS (S, t) + 2 δS (S, t) + O(δS
∂S ∂S 2
Similarly,
∂V 2
1 2∂ V 3
V (S − δS, t) = V (S, t) − δS (S, t) + 2 δS 2
(S, t) + O(δS ).
∂S ∂S
30
From these we get
k −Vk
Vi+1
∂V i−1
(S, t) = + O(δS 2).
∂S 2 δS
31
S
Use the option value at
these two points to
calculate the delta
32
Approximating Γ
k
V
i+ 1
k
V
i
k
V
i -1
i -1 i i +1
33
Calculate the delta half way between i and i + 1, and the delta
half way between i − 1 and i . . . and difference them!
k −Vk
Vi+1 i
Forward difference = .
δS
Vik − Vi−1
k
Backward difference = .
δS
34
Therefore the natural approximation for the gamma is
k −V k
Vi+1 Vik −Vi−1
k
∂ 2V δS
i
− δS
(S, t) ≈
∂S 2 δS
k − 2V k + V k
Vi+1 i i−1
= .
δS 2
35
S
Use the option value at
these three points to
calculate the gamma
36
Final conditions and payoffs
We know that at expiry the option value is just the payoff func-
tion. At expiry we have
V (S, T ) = Payoff(S)
37
For example, if we are pricing a call option we have
38
The explicit finite-difference method
∂V ∂ 2V ∂V
1 2 2
+ 2σ S + rS − rV = 0.
∂t ∂S 2 ∂S
Write this as
∂V ∂ 2V ∂V
+ a(S, t) 2 + b(S, t) + c(S, t)V = 0
∂t ∂S ∂S
39
Using the above approximations
Vi − Vi
k k+1 Vi+1 − 2Vi + Vi−1
k k k Vi+1 − Vi−1
k k
k
+ ai + bk
2 i
δt δS 2δS
40
Vik+1 = · · · Vi+1
k
+ · · · Vik + · · · Vi−1
k
.
41
The relationship between the option values in the algorithm is
shown in the figure below.
is
This calculated
option from
value these
three
42
Points to note:
43
• The asset- and time-dependent functions a, b and c have
been valued at Si = i δS and t = T − k δt with the obvious
notation.
44
S
45
S
46
S
47
S
48
S
49
S
50
Boundary conditions
V0k = 0.
51
Example 3: Put option at S = 0
VIk = 0.
52
Example 5*: General condition at S = 0
∂V
(0, t) − rV (0, t) = 0 V0k = (1 − rδt)V0k−1.
∂t
53
Example 6*: General condition at infinity
When the option has a payoff that is linear in the underlying for
large S then
∂ 2V
(S, t) → 0 as S → ∞.
∂S 2
VIk = 2VI−1
k k
− VI−2 .
54
S
55
S
56
linear extrapolation
S
57
S
58
S
59
S
60
Accuracy and computational time
We know that errors are O(δt) and O(δS 2). It makes sense to
have errors due to the time step and to the finite number of
simulations to be of the same order. So we would choose:
61
In higher dimensions. . .
62
Other issues
• Greeks
63
The advantages of the explicit method
64
The disadvantages of the explicit method
65
Monte Carlo versus Finite Difference
66
Summary
67