solving the Black-Scholes PDE by finite differences


This entry presents some examples of solving the Black-Scholes partial differential equation in one space dimension:

rf=ft+rxfx+12σ2x22fx2,f=f(t,x),

over the rectangle 0tT, XLxXU, with various boundary conditionsMathworldPlanetmath on the top, bottom, and right sides of the rectangle. The parameters r, σ>0 are arbitrary constants.

(Add diagram of domain here…)

The partial differential equationMathworldPlanetmath can be solved numerically using the basic methods based on approximating the partial derivativesMathworldPlanetmath with finite differences.

0.1 Finite-difference formulae

We summarize the equations for the finite differences below.

Let n, m, k be some chosen positive integers, which determine the grid on which we are approximating the solution of the PDE.

Set ui,j to be the approximation to f(T-iΔt,jΔx), for 0im and kjk+n+1. (For convenience, we have made time move “backwards” as we increase i, because the original PDE is really a backwards heat equation, and evolves backwards in time.)

Also set:

Δt=Tm,Δx=XU-XLn+1

Explicit method.

ui+1,j-ui,jΔt =-rui,j+rjΔxui,j+1-ui,j-12Δx
  +12σ2(jΔx)2ui,j-1-2ui,j+ui,j+1Δx2
ui+1,j =(12(σj)2Δt-12rjΔt)ui,j-1
+(1-(σj)2Δt-rΔt)ui,j
+(12(σj)2Δt+12rjΔt)ui,j+1.

Since the PDE to solve is parabolic and time-dependent, we can step through time to numerically approximate it. Given ui,*, we can recursively compute ui+1,*.

(Add stencil of numerical method here…)

Implicit method.

ui+1,j-ui,jΔt =-rui+1,j+rjΔxui+1,j+1-ui+1,j-12Δx
  +12σ2(jΔx)2ui+1,j-1-2ui+1,j+ui+1,j+1Δx2
ui,j =(-12(σj)2Δt+12rjΔt)ui+1,j-1
+(1+(σj)2Δt+rΔt)ui+1,j
+(-12(σj)2Δt-12rjΔt)ui+1,j+1.

Crank-Nicolson method.

(-14(σj)2Δt+14rjΔt)ui+1,j-1+(1+12(σj)2Δt-12rΔt)ui+1,j+(-14(σj)2Δt-14rjΔt)ui+1,j+1=(14(σj)2Δt-14rjΔt)ui,j-1+(1-12(σj)2Δt-12rΔt)ui,j+(14(σj)2Δt+14rjΔt)ui,j+1

0.2 Convergence of methods

(Briefly discuss convergence properties of these methods here…)

0.3 Example results

Figure 1: Basic stock call option price

Boundary conditions and parameters:

r=0.10,σ=0.40,T=0.5,K=50.00.
XL=0,XU=100.00.
m=100,n=200,Δt=0.005,Δx=0.4975.
f(T,x) =max(x-K, 0), XLxXU
f(t,0) =0, 0tT,
f(t,XU) =x-Ke-r(T-t), 0tT.

(Describe analytic solution here…)

Figure 2: Price of call option with up-and-out barrier
r=0.10,σ=0.40,T=0.5,K=50.00.
XL=0,XU=100.00.
m=100,n=200,Δt=0.005,Δx=0.4975.
f(T,x) =max(x-K, 0), XLxXU
f(t,0) =0, 0tT,
f(t,XU) =0, 0tT.
  • http://svn.gold-saucer.org/math/PlanetMath/SolvingTheBlackScholesPDEByFiniteDifferences/bss.pyPython program that implements the finite-difference methods for the above two problems, and plots the results

Title solving the Black-Scholes PDE by finite differences
Canonical name SolvingTheBlackScholesPDEByFiniteDifferences
Date of creation 2013-03-22 16:30:59
Last modified on 2013-03-22 16:30:59
Owner stevecheng (10074)
Last modified by stevecheng (10074)
Numerical id 6
Author stevecheng (10074)
Entry type Example
Classification msc 65M06
Classification msc 91B28
Classification msc 35K15