An option's value can be found two ways: average its payoff over thousands of simulated paths, or solve a partial differential equation on a grid. Feynman-Kac says the two answers are the same number, so you can pick whichever is faster for the problem in front of you.
A partial differential equationPartial differential equation (PDE): an equation linking an unknown function of several variables to its partial derivatives. ties a function of time and state to its rates of change in each. The simplest is the heat equationHeat equation: u_τ = ½σ²u_xx. It smooths a profile out over time, like heat spreading along a rod., uτ = ½σ²uxx. Start it from a step, 0 to the left of zero and 1 to the right, and it smooths the step out:
τ = 0 τ = 0.1 τ = 0.5 τ = 2
The smoothed profile is an average: u(τ, x) is the chance that x + σW(τ) lands above zero. At x = 0.5 it falls from 1 to 0.9431, 0.7602 and 0.6382 as τ goes 0.1, 0.5, 2. That is the Feynman-KacFeynman-Kac formula: the solution of v_t + μv_x + ½σ²v_xx − rv = 0 with v(T, x) = g(x) is the discounted expected value E[e^{−r(T−t)} g(X(T)) | X(t) = x]. link: a PDE of this kind is solved by an expected value over Brownian paths, and an expected value can be found by solving a PDE.
The rules
The heat equation. What the symbols mean, and its solution as an average.
Feynman-Kac. From an expected value to a PDE, with Itô's lemma and a terminal conditionTerminal condition: the known values v(T, x) = g(x) at the final time. The PDE is solved backwards from it..
A grid. The explicit schemeExplicit scheme: each new time level is computed directly from the previous one, as a weighted sum of three neighbours. on a finite-difference gridFinite-difference grid: points (τ_n, x_j) spaced Δτ and Δx apart, with derivatives replaced by differences between neighbouring values., and its stabilityStability: small errors stay small as the scheme steps forward. For the explicit heat scheme this needs α = ½σ²Δτ/Δx² ≤ ½..
μ, σ and g are regular enough for the expectation to exist and be smooth, and r is a constant rate. The converse also holds: a well-behaved solution of the PDE with that terminal condition equals the expected value. α ≤ ½ is the condition for the explicit scheme to be stable, so that its errors do not grow as Δτ and Δx shrink together. Sources: Shreve (2004), volume II, section 6.4; Wilmott, Howison and Dewynne (1995).
Try it
Solve the heat equation on a grid, backwards from the payoff, and compare it with the exact Feynman-Kac value and a Monte Carlo average. Start at α = 0.4, then push α past ½.
Try itAn explicit finite-difference grid
Payoff g(x)
Discount rate r
Time steps N
Payoff g(x), at T Exact v(0, x) Grid values after 25 steps
Δτ, Δx0.04, 0.224
Weights α, 1 − 2α − rΔτ, α0.4, 0.2, 0.4
Grid value at x = 00.3985
Exact (Feynman-Kac)0.3989
Monte Carlo, 10,000 draws0.4024 ± 0.0115
Largest error, |x| ≤ 20.0011
X = x + W over one year (σ = 1), grid out to |x| = 5. Δτ = 1/N is set by N, and Δx is chosen to give the α on the slider. A zigzag error is multiplied by 1 − 4α = −0.6 each step.
Every weight is non-negative, so each new value is an average of old ones: the grid is a random walk, and it converges.
Solve vt + ½vxx − rv = 0 with v(1, x) = max(x, 0), and find v(0, 0). Here σ = 1, μ = 0 and r = 5%.
3. One grid step by hand, then the whole grid
Step 1 of 5
1
The grid
σ = 1, r = 0, Δx = 0.5 and Δτ = 0.1, so α = ½ × 1 × 0.1 / 0.25 = 0.2. The payoff max(x, 0) at x = −1, −0.5, 0, 0.5, 1 is 0, 0, 0, 0.5, 1.
Common mistakes
Each line below is a tempting slip. Spot what is wrong, then check.
Reaction
Check what stuck
Question 1 · objective 2
v(t, x) = E[(x + σ(W(T) − W(t)))²]. What is v for x = 2, σ = 0.5 and T − t = 4?
Question 2 · objective 2
What does the Feynman-Kac formula say the PDE solution v(t, x) equals?
Question 3 · objective 3
For the explicit heat scheme with σ = 0.2 and Δx = 0.01, what is the largest stable time step Δτ?
Question 4 · objective 4
With α = 0.75, by what factor is a zigzag error multiplied at each step?
Question 5 · objective 4
You halve Δx and keep α fixed. What happens to Δτ?
Glossary
Partial differential equation
Partial differential equation (PDE): an equation linking an unknown function of several variables to its partial derivatives.
Heat equation
Heat equation: u_τ = ½σ²u_xx. It smooths a profile out over time, like heat spreading along a rod.
Terminal condition
Terminal condition: the known values v(T, x) = g(x) at the final time. The PDE is solved backwards from it.
Feynman-Kac formula
Feynman-Kac formula: the solution of v_t + μv_x + ½σ²v_xx − rv = 0 with v(T, x) = g(x) is the discounted expected value E[e^{−r(T−t)} g(X(T)) | X(t) = x].
Finite-difference grid
Finite-difference grid: points (τ_n, x_j) spaced Δτ and Δx apart, with derivatives replaced by differences between neighbouring values.
Explicit scheme
Explicit scheme: each new time level is computed directly from the previous one, as a weighted sum of three neighbours.
Stability
Stability: small errors stay small as the scheme steps forward. For the explicit heat scheme this needs α = ½σ²Δτ/Δx² ≤ ½.
Deep Dives & Origins
Deep Dives
Wilmott, Howison and Dewynne, The Mathematics of Financial Derivatives: the heat equation, and implicit and Crank–Nicolson schemes, which remove the α ≤ ½ limit. Intermediate.
Shreve, Stochastic Calculus for Finance II, section 6.4: the Feynman-Kac theorem stated and proved for general drift and diffusion. Advanced.
Origins
Steven E. Shreve, Stochastic Calculus for Finance II: Continuous-Time Models, Springer Finance, Springer, 2004 (section 6.4, partial differential equations and Feynman-Kac).
Paul Wilmott, Sam Howison and Jeff Dewynne, The Mathematics of Financial Derivatives: A Student Introduction, Cambridge University Press, 1995.