EFREI – M1 IFM Numerical analysis applied to financial issues
Practical Work #4
The Finite Difference Method (FDM) has been presented in the course. We aim at applying this method to the well-known Black & Scholes equation with constant volatilityσand constant interest rater for the modelling of a European vanilla put option:
∂P˜
∂t (t,S)+σ2S2 2
∂2P˜
∂S2(t,S)+r S∂P˜
∂S(t,S)−rP˜(t,S)=0, P˜(T,S)=max(0,K−S),
or equivalently (by means of the change of variablesP(t,S)=P˜(T −t,S))
∂P
∂t(t,S)−σ2S2 2
∂2P
∂S2(t,S)−r S∂P
∂S(t,S)+r P(t,S)=0, (1a)
P(0,S)=max(0,K−S). (1b)
We set for the present study
K=100,T =1,σ=0.2 and r=0.04 . IfPis a solution to (1), then the following function
ϕ(θ,x)=P(θ,ex)e−αθ−βx with β=1 2− r
σ2,α= −r−σ2β2 2 , is a solution to
∂ϕ
∂θ−σ2 2
∂2ϕ
∂x2 =0, (2a)
ϕ(0,x)=e−βx·max(0,K−ex). (2b)
We recall that the exact solution is given by
P˜(t,S)=K e−r(T−t)Φ(−d2)−SΦ(−d1), withΦ(d)= 1
p2π Z d
−∞
exp µ
−z2 2
¶
dzand:
d1=ln(S/K)+(r+σ2/2)(T −t) σp
T −t ,d2=d1−σp T −t.
We thus aim at simulating equivalent formulations (1) and (2) and then at comparing corresponding solu- tions.
08/04/2013 1 M. Girardin – B. Meltz
EFREI – M1 IFM Numerical analysis applied to financial issues
Exercise 1 (Heat equation on a uniform grid) Let x and x be two real numbers such that x¿lnK ¿x.
We consider a space discretization given by xj =x+(j−1)∆x,∆x= x−x
Nx−1 for some Nx >1and a time discretization tn=(n−1)∆t ,∆t= T
Nt−1for a suitable Nt>1.
Implement and compare performance of the explicit Euler scheme, the implicit Euler scheme and the Crank- Nicholson scheme for the resolution of (2). Comparisons will be made on the primitive functionP .˜
Note that the stability condition reads∆t≤∆x2 σ2 .
Exercise 2 (Heat equation on a nonuniform grid) Let S and S be two real numbers such that S¿K ¿S.
We consider an asset discretization given by Sj =S+(j−1)∆S,∆S= S−S
NS−1 for some NS >1and a time discretization tn=(n−1)∆t ,∆t= T
Nt−1for some Nt>1. The corresponding space discretization is imposed by the change of variable:
xj=lnSj. We set∆xj=xj+1−xj.
1. Derive a formula approaching the second order spatial derivative on nonuniform grids.
2. Then implement the resolution of (2)by means of the Crank-Nicholson scheme.
Exercise 3 (Resolution of the Black & Scholes model in primitive variables)
1. Given a uniform discretization of the time-asset space [0,T]×[S,S], propose a numerical scheme based on the explicit Euler scheme for the time derivative to solve(1).
2. Find out by means of numerical simulations a suitable value for∆t . 3. Implement the Crank-Nicholson scheme applied to(1).
4. Comment numerical results.
08/04/2013 2 M. Girardin – B. Meltz