Formula relating stochastic processes to partial differential equations
The Feynman–Kac formula, named after Richard Feynman and Mark Kac, establishes a link between parabolic partial differential equations and stochastic processes. In 1947, when Kac and Feynman were both faculty members at Cornell University, Kac attended a presentation of Feynman's and remarked that the two of them were working on the same thing from different directions.[1] The Feynman–Kac formula resulted, which proves rigorously the real-valued case of Feynman's path integrals. The complex case, which occurs when a particle's spin is included, is still an open question.[2]
It offers a method of solving certain partial differential equations by simulating random paths of a stochastic process. Conversely, an important class of expectations of random processes can be computed by deterministic methods.
Theorem
Consider the partial differential equation
defined for all and , subject to the terminal condition
where are known functions, is a parameter, and is the unknown. Then the Feynman–Kac formula expresses as a conditional expectation under the probability measure
where is an Itô process satisfying
and are functions defined as
where can be substituted for or as appropriate, and a Wiener process (also called Brownian motion) under .
Intuitive interpretation
Suppose that the position of a particle evolves according to the diffusion process
Let the particle incur "cost" at a rate of at location at time . Let it incur a final cost at .
Also, allow the particle to decay. If the particle is at location at time , then it decays with rate . After the particle has decayed, all future cost is zero.
Then is the expected cost-to-go, if the particle starts at
Partial proof
A proof that the above formula is a solution of the differential equation is long, difficult and not presented here. It is however reasonably straightforward to show that, if a solution exists, it must have the above form. The proof of that lesser result is as follows:
Derivation of the Feynman-Kac formula
Show that the solution from the Feynman-Kac formula satisfies the PDE:
For to be a martingale, the drift term must vanish:
Remarks about the derivation
The proof above that a solution must have the given form is essentially that of [3] with modifications to account for .
The expectation formula above is also valid for N-dimensional Itô diffusions. The corresponding partial differential equation for becomes:[4] where, i.e. , where denotes the transpose of .
When originally published by Kac in 1949,[5] the Feynman–Kac formula was presented as a formula for determining the distribution of certain Wiener functionals. Suppose we wish to find the expected value of the function in the case where x(τ) is some realization of a diffusion process starting at x(0) = 0. The Feynman–Kac formula says that this expectation is equivalent to the integral of a solution to a diffusion equation. Specifically, under the conditions that , where w(x, 0) = δ(x) and
The Feynman–Kac formula can also be interpreted as a method for evaluating functional integrals of a certain form. If
where the integral is taken over all random walks, then where w(x, t) is a solution to the parabolic partial differential equation with initial condition w(x, 0) = f(x).
Example Application
In practical applications, the Feynman–Kac formula can be used with numerical methods like Euler-Maruyama to numerically approximate solutions to partial differential equations. For instance, it can be applied to the convection–diffusion partial differential equation (PDE):
Consider the convection–diffusion PDE with parameters , and terminal condition is with . Then the PDE has analytic solution:
Applying the Feynman-Kac formula, the solution can also be written as the conditional expectation:
where is an Itô process governed by the SDE and is a Wiener process. Then using the Euler-Maruyama method, the SDE can be numerically integrated forwards in time from the initial conditions till the terminal time , yielding simulated values of . To approximate the expectation in the Feynman-Kac method, the simulation is repeated times. These are often called realizations. The solution is then estimated by the Monte Carlo average
The figure below compares the analytical solution with the numerical approximation obtained using the Euler–Maruyama method with . The left-hand plots show vertical slices of the gradient plot on the right, with each vertical line on the surface corresponding to a colored curve on the left. While the numerical solution exhibits some noise, it closely follows the shape of the exact solution. Increasing the number of simulations or decreasing the Euler–Maruyama time step improves the accuracy and reduces the variance of the approximation.
Exact solution (below) and Euler-Maruyama (top) approximation to the convection-diffusion PDE. Time slices of the gradient plot are plotted on the left.
This example illustrates how stochastic simulation, enabled by the Feynman–Kac formula and numerical methods like Euler–Maruyama, can approximate PDE solutions. In practice, such stochastic approaches are especially valuable when dealing with high-dimensional systems or complex geometries where traditional PDE solvers become computationally prohibitive. One key advantage of the SDE-based method is its natural parallelism—each simulation, or realization, can be computed independently—making it well-suited for high-performance computing environments. While stochastic simulations introduce variance, this can be mitigated by increasing the number of realizations or refining the time discretization. Thus, stochastic differential equations provide a flexible and scalable alternative to deterministic PDE solvers, particularly in contexts where uncertainty is intrinsic or dimensionality poses a computational barrier. In contrast to traditional PDE solvers, which typically require solving for the entire solution over a grid, this method enables direct computation at specific points in space and time. This targeted approach allows computational resources to be focused on regions of interest, potentially resulting in substantial efficiency gains.
For example, consider a stock price undergoing geometric Brownian motion
where is the risk-free interest rate and is the volatility. Equivalently, by Itô's lemma,
Now consider a European call option on an expiring at time with strike . At expiry, it is worth Then, the risk-neutral price of the option, at time and stock price , is
Plugging into the Feynman–Kac formula, we obtain the Black–Scholes equation:
where
More generally, consider an option expiring at time with payoff . The same calculation shows that its price satisfies
Some other options like the American option do not have a fixed expiry. Some options have value at expiry determined by the past stock prices. For example, an average option has a payoff that is not determined by the underlying price at expiry but by the average underlying price over some predetermined period of time. For these, the Feynman–Kac formula does not directly apply.