Finite Difference Methods for Option Pricing › Boundary Conditions
Quantitative FinanceAll chapters Finite Difference Methods for Option Pricing › Boundary ConditionsOne section · Sections in this chapter6 / 14 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
Proper boundary conditions are essential for finite difference methods. They determine the option value at the edges of the computational grid, where the standard update formulas cannot be applied directly because they would require values outside the grid.
Terminal Condition
At expiration (), the option value equals its payoff. This is the fundamental condition that initializes our backward-in-time computation:
where:
- : option value at expiration
- : stock price at expiration
- : strike price
This condition initializes the grid before we begin the backward time-stepping process. The non-smooth nature of the payoff function at can introduce complications, as the second derivative is undefined at that point. You might sometimes smooth the payoff near the strike to improve numerical behavior.
Boundary at
When the underlying asset price is zero, it remains at zero forever (assuming geometric Brownian motion). This follows because geometric Brownian motion has the property that zero is an absorbing state: if , then implies . Therefore:
-
where:
- : option value at asset price zero
(a call is worthless if the stock is worthless)
-
Put option:
where:
- : option value at asset price zero
- : strike price
- : risk-free interest rate
- : time to expiration
(a put pays at expiration with certainty)
Boundary at
At very high stock prices, we need to specify the option value at the upper edge of the grid. The exact value depends on the type of option:
-
Call option:
where:
- : option value at maximum grid price
- : maximum asset price on the grid
- : strike price
- : risk-free interest rate
- : time to expiration
(deep in-the-money, behaves like a forward)
-
Put option:
where:
- : option value at maximum grid price
(deep out-of-the-money)
The boundary at requires some care. If is chosen too small, the boundary condition may distort the solution in the region of interest. A rule of thumb is to set to for typical volatilities.
Implementing Put Option Boundaries
def crank_nicolson_european_put(S_max, K, T, r, sigma, M, N):
"""
Price a European put option using Crank-Nicolson.
"""
dS = S_max / M
dt = T / N
S = np.linspace(0, S_max, M + 1)
# Terminal condition: put payoff
V = np.maximum(K - S, 0)
# Coefficients
j = np.arange(1, M)
alpha = 0.25 * dt * (sigma**2 * j**2 - r * j)
beta = 0.5 * dt * (sigma**2 * j**2 + r)
gamma = 0.25 * dt * (sigma**2 * j**2 + r * j)
a_left = -alpha[1:]
b_left = 1 + beta
c_left = -gamma[:-1]
for n in range(N - 1, -1, -1):
d = alpha * V[0 : M - 1] + (1 - beta) * V[1:M] + gamma * V[2 : M + 1]
# Put boundary conditions
boundary_0 = K * np.exp(-r * (N - n) * dt) # PV of strike
boundary_M = 0
d[0] += alpha[0] * boundary_0
d[-1] += gamma[-1] * boundary_M
V[1:M] = thomas_algorithm(a_left, b_left, c_left, d)
V[0] = boundary_0
V[M] = boundary_M
return S, V