solving the Black-Scholes PDE by finite differences

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

:

r

⁢

f

=

∂

⁡

f

∂

⁡

t

+

r

⁢

x

⁢

∂

⁡

f

∂

⁡

x

+

1

2

⁢

σ

2

⁢

x

2

⁢

∂

2

⁡

f

∂

⁡

x

2

,

f

=

f

⁢

(

t

,

x

)

,

over the rectangle

0

≤

t

≤

T

,

X

L

≤

x

≤

X

U

,
with various

boundary conditions

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 equation

can be solved
numerically using the basic methods
based on approximating the

partial derivatives

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

u

i

,

j

to be the approximation to

f

⁢

(

T

-

i

⁢

Δ

⁢

t

,

j

⁢

Δ

⁢

x

)

,
for

0

≤

i

≤

m

and

k

≤

j

≤

k

+

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

=

T

m

,

Δ

⁢

x

=

X

U

-

X

L

n

+

1

Explicit method

.

u

i

+

1

,

j

-

u

i

,

j

Δ

⁢

t

=

-

r

⁢

u

i

,

j

+

r

⁢

j

⁢

Δ

⁢

x

⁢

u

i

,

j

+

1

-

u

i

,

j

-

1

2

⁢

Δ

⁢

x

+

1

2

⁢

σ

2

⁢

(

j

⁢

Δ

⁢

x

)

2

⁢

u

i

,

j

-

1

-

2

⁢

u

i

,

j

+

u

i

,

j

+

1

Δ

⁢

x

2

u

i

+

1

,

j

=

(

1

2

⁢

(

σ

⁢

j

)

2

⁢

Δ

⁢

t

-

1

2

⁢

r

⁢

j

⁢

Δ

⁢

t

)

⁢

u

i

,

j

-

1

+

(

1

-

(

σ

⁢

j

)

2

⁢

Δ

⁢

t

-

r

⁢

Δ

⁢

t

)

⁢

u

i

,

j

+

(

1

2

⁢

(

σ

⁢

j

)

2

⁢

Δ

⁢

t

+

1

2

⁢

r

⁢

j

⁢

Δ

⁢

t

)

⁢

u

i

,

j

+

1

.

Since the PDE to solve is parabolic and time-dependent,
we can step through time to numerically approximate it.
Given

u

i

,

*

, we can recursively compute

u

i

+

1

,

*

.

(Add stencil of numerical method here…)

Implicit method

.

u

i

+

1

,

j

-

u

i

,

j

Δ

⁢

t

=

-

r

⁢

u

i

+

1

,

j

+

r

⁢

j

⁢

Δ

⁢

x

⁢

u

i

+

1

,

j

+

1

-

u

i

+

1

,

j

-

1

2

⁢

Δ

⁢

x

+

1

2

⁢

σ

2

⁢

(

j

⁢

Δ

⁢

x

)

2

⁢

u

i

+

1

,

j

-

1

-

2

⁢

u

i

+

1

,

j

+

u

i

+

1

,

j

+

1

Δ

⁢

x

2

u

i

,

j

=

(

-

1

2

⁢

(

σ

⁢

j

)

2

⁢

Δ

⁢

t

+

1

2

⁢

r

⁢

j

⁢

Δ

⁢

t

)

⁢

u

i

+

1

,

j

-

1

+

(

1

+

(

σ

⁢

j

)

2

⁢

Δ

⁢

t

+

r

⁢

Δ

⁢

t

)

⁢

u

i

+

1

,

j

+

(

-

1

2

⁢

(

σ

⁢

j

)

2

⁢

Δ

⁢

t

-

1

2

⁢

r

⁢

j

⁢

Δ

⁢

t

)

⁢

u

i

+

1

,

j

+

1

.

Crank-Nicolson method

.

(

-

1

4

⁢

(

σ

⁢

j

)

2

⁢

Δ

⁢

t

+

1

4

⁢

r

⁢

j

⁢

Δ

⁢

t

)

⁢

u

i

+

1

,

j

-

1

+

(

1

+

1

2

⁢

(

σ

⁢

j

)

2

⁢

Δ

⁢

t

-

1

2

⁢

r

⁢

Δ

⁢

t

)

⁢

u

i

+

1

,

j

+

(

-

1

4

⁢

(

σ

⁢

j

)

2

⁢

Δ

⁢

t

-

1

4

⁢

r

⁢

j

⁢

Δ

⁢

t

)

⁢

u

i

+

1

,

j

+

1

=

(

1

4

⁢

(

σ

⁢

j

)

2

⁢

Δ

⁢

t

-

1

4

⁢

r

⁢

j

⁢

Δ

⁢

t

)

⁢

u

i

,

j

-

1

+

(

1

-

1

2

⁢

(

σ

⁢

j

)

2

⁢

Δ

⁢

t

-

1

2

⁢

r

⁢

Δ

⁢

t

)

⁢

u

i

,

j

+

(

1

4

⁢

(

σ

⁢

j

)

2

⁢

Δ

⁢

t

+

1

4

⁢

r

⁢

j

⁢

Δ

⁢

t

)

⁢

u

i

,

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

.

X

L

=

0

,

X

U

=

100.00

.

⁢

m

=

100

,

n

=

200

,

Δ

⁢

t

=

0.005

,

Δ

⁢

x

=

0.4975

.

f

⁢

(

T

,

x

)

=

max

⁡

(

x

-

K

,

0

)

,

X

L

≤

x

≤

X

U

f

⁢

(

t

,

0

)

=

0

,

0

≤

t

≤

T

,

f

⁢

(

t

,

X

U

)

=

x

-

K

⁢

e

-

r

⁢

(

T

-

t

)

,

0

≤

t

≤

T

.

(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

.

X

L

=

0

,

X

U

=

100.00

.

⁢

m

=

100

,

n

=

200

,

Δ

⁢

t

=

0.005

,

Δ

⁢

x

=

0.4975

.

f

⁢

(

T

,

x

)

=

max

⁡

(

x

-

K

,

0

)

,

X

L

≤

x

≤

X

U

f

⁢

(

t

,

0

)

=

0

,

0

≤

t

≤

T

,

f

⁢

(

t

,

X

U

)

=

0

,

0

≤

t

≤

T

.

•

http://svn.gold-saucer.org/math/PlanetMath/SolvingTheBlackScholesPDEByFiniteDifferences/bss.py

Python 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

Generated on Sat Feb 10 12:36:36 2018 by

LaTeXML