Numerical Dupire Local Volatility Pricing in Log-Moneyness Space
Summary
The document presents an implementation question about numerically solving a Dupire partial differential equation to price vanilla options in log-moneyness and time coordinates. The author uses a fully implicit finite-difference scheme and reports difficulty reproducing market Black prices despite testing a flat local volatility and zero interest rates. The code also interpolates a sample volatility curve, sets boundary values, builds a tridiagonal system, and steps the solution through time.
The central issue raised is whether the chosen boundary conditions are appropriate: the code assigns intrinsic-value expressions at both spatial endpoints. The document does not provide a corrected scheme, a diagnosis, or numerical comparisons that isolate the source of the pricing mismatch. It is useful as an example of implementation concerns in local-volatility PDE pricing, but readers would need to check the PDE’s coordinate convention, time and space step definitions, boundary behavior, and matrix indexing before relying on the results.
Key ideas
- The document applies an implicit finite-difference method to the Dupire pricing equation in log-moneyness space.
- It compares computed vanilla prices with Black prices and reports that the results do not match.
- The author suspects that setting both spatial boundaries to intrinsic value may be unsuitable.
- The code’s discretization, coordinate definitions, time stepping, and boundary implementation require scrutiny; no solution is established.
Tags
Full text
# How do you numerically solve the Dupire Local Volatility PDE in log moneyness-time space?
# How do you numerically solve the Dupire Local Volatility PDE in log moneyness-time space?
I am trying to implement a numerical solution to price vanilla calls. I am using the Dupire equation in log moneyness-time (k = ln(F/T)) space as per below PDE
I have tried solving it using a fully implicit scheme in Matlab and can't match market prices (black prices). I have used a flat local vol of 30% and a zero interest rate in the below matlab code. I suspect my k boundary condition may be the issue as I set it to the intrinsic value along these boundaries?
```
clc; clear;
xmin = -1.0890280712271;
xmax = 0.8471200635454;
T = 0.22739726;
M =97; % Number of space steps
dx = (xmax-xmin)/M;
N = 14; % Number of time steps
dt = (xmax-xmin)/N;
Price = zeros(N+1,M+1);
T_range = 0:dt:T;
x_range = xmin:dx:xmax;
LV = [0.416943422 0.371500369 0.356353595 0.343735066 0.3316299 0.319610453 0.309502636 0.320541186 0.35365883];
X = [-0.475738211 -0.237869105 -0.158579404 -0.079289702 0 0.079289702 0.158579403 0.237869105 0.475738211];
vols = interp1(X,LV,x_range,'linear');
for i = 1:(M+1)
if (x_range(i)<min(X))
vols(i) = LV(1);
else
if (x_range(i)>max(X))
vols(i) = LV(end);
end
end
end
vols(:) = 0.9;
%% Initial Condition
Price(1,:) = max( 1 - exp(x_range) , 0);
%% Boundary Conditions
% min k boundary
Price(:,1) = max( 1 - exp(xmin) , 0);
% max k boundary
Price(:,M+1) = max(1 - exp(xmax), 0) ;
%% A matrix
alpha = -(vols.^2)/(2*dx^2);
a = -alpha*dt*(1+dx/2);
b = dt*(2*alpha + 1/dt);
c = alpha*dt*(1-dx/2);
A = zeros(M-1);
for j = 2:M-1
A(j,j-1) = a(j);
end
for j = 1:M-1
A(j,j) = b(j);
end
for j = 1:M-2
A(j,j+1) = c(j);
end
b = zeros(M-1,1);
b(1) = Price(1,1) * a(1);
b(M-1) = Price(N+1,M+1) * c(end);
%% Solve for Y
for i = 2:N+1
Price(i,2:M) = A \ (Price(i-1,2:M)' - b);
end
```Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.