Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1
We may rewrite equation (3) as
pu Ci;j+1 + pm Ci;j + pd Ci;j"1 = !pu Ci+1;j+1 ! (pm ! 2) Ci+1;j ! pd Ci+1;j"1 (4)
where
% &
1 %2 -
pu = ! 4t +
4 4x2 4x
2
% r4t
pm = 1 + 4t 2
+
24x 2
% 2 &
1 % -
pd = ! 4t !
4 4x2 4x
By working backward in time, the right-hand side of equation (4) is made up of known option values and
the known constant coecients pu ; pm and pd : Therefore, the right-hand side of the equation (4) can be
considered as a known constant.
Each equation (4) for j = !M + 1; :::; M ! 1 cannot be solved individually for the option values at time
step i. Instead, they must be considered, together with the boundary conditions,
Ci;M ! Ci;M "1 = 6U
Ci;"M +1 ! Ci;"M = 6L
to be a system of 2M + 1 linear equations which implicitly determine the 2M + 1 option values at time step
i:
The boundary condition parameters 6U and 6L are determined by the type of option being valued. For
example, for valuing call option, we have
6U = SM ! SM "1
6L = 0
For put option, we have
6U = 0
6L = S"M ! S"M +1
The set of equations in (4) makes up a tridiagonal system of linear equations for each xed time index i:
0 10 1
1 !1 0 ::: ::: ::: 0 Ci;M
B pu p m pd 0 ::: ::: 0 C B C
B C B Ci;M "1 C
B 0 p p p 0 ::: 0 C B C C
B u m d C B i;M "2 C
B ::: ::: ::: ::: ::: ::: ::: C B ::: C
B CB C
B 0 ::: 0 p p p 0 C B C C
B u m d C B i;"M +2 C
@ 0 ::: ::: 0 pu pm pd A @ Ci;"M +1 A
0 ::: ::: ::: 0 1 !1 Ci;"M
0 1
6U
B !pu Ci+1;M ! (pm ! 2) Ci+1;M "1 ! pd Ci+1;M "2 C
B C
B !pu Ci+1;M "1 ! (pm ! 2) Ci+1;M "2 ! pd Ci+1;M "3 C
B C
B
= B ::: C
C
B !pu Ci+1;"M +3 ! (pm ! 2) Ci+1;"M +2 ! pd Ci+1;"M +1 C
B C
@ !pu Ci+1;"M +2 ! (pm ! 2) Ci+1;"M +1 ! pd Ci+1;"M A
6L
which can be solved eciently.
The pseudo-code implementation of the Crank-Nicolson nite dierence method for pricing an American
put option is given below. In our implementation, we have introduced a storage eciency improvement. The
option value array C[i,j] only has two time indices, namely i=0,1. The time index i=1 is used to temporar-
ily store the discounted expectation. The boundary conditions and early exercise test store the appropriate
value in the time index i=0. The range of space index remained to be j=-M,-M+1,...,-1,0,1,...,M-1,M.
2
ALGORITHM (American Put Option by the Crank-Nicolson Finite Dierence Method)
initialize_parameters { K, T, S, sig, r, div, N, M, dx }
{ precompute constants }
dt = T/N
nu = r - div - 0.5 * sig^2
edx = exp(dx)
pu = -0.25*dt*( (sig/dx)^2 + nu/dx )
pm = 1.0 + 0.5*dt*(sig/dx)^2 + 0.5*r*dt
pd = -0.25*dt*( (sig/dx)^2 - nu/dx )
American_put = C[0,0]
{ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
subroutine solve_Crank_Nicolson_system( C, pu, pm, pd, lambda_L, lambda_U )
{ back-substitution }
for j = M-2 downto -M+1 do
C[i,j] = ( pp[j] - pu*C[1,j+1] )/pmp[j]
next j