Template:Use American English Template:Short description 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.<ref>Template:Cite book</ref> 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.<ref>Template:Cite book</ref>

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.

TheoremEdit

Consider the partial differential equation <math display="block"> \frac{\partial}{\partial t}u(x,t) + \mu(x,t) \frac{\partial}{\partial x}u(x,t) + \tfrac{1}{2} \sigma^2(x,t) \frac{\partial^2}{\partial x^2}u(x,t) -V(x,t) u(x,t) + f(x,t) = 0, </math> defined for all <math>x \in \mathbb{R}</math> and <math>t \in [0, T]</math>, subject to the terminal condition <math display="block"> u(x,T) = \psi(x), </math> where <math>\mu,\sigma,\psi,V,f</math> are known functions, <math>T</math> is a parameter, and <math>u:\mathbb{R} \times [0,T] \to \mathbb{R}</math> is the unknown. Then the Feynman–Kac formula expresses <math>u(x,t)</math> as a conditional expectation under the probability measure <math>Q</math> Template:Equation box 1 where <math>X</math> is an Itô process satisfying <math display="block"> dX_t = \mu(X_t,t) \, dt + \sigma(X_t,t) \, dW^Q_t, </math> <math>g_\tau</math> and <math>g_s</math> are functions defined as <math display="block">g_\kappa(a, b) = \exp\left(-\int_a^b V(X_\kappa, \kappa) \, d\kappa\right)</math> where <math>\kappa</math> can be substituted for <math>\tau</math> or <math>s</math> as appropriate, and <math>W_t^{Q}</math> a Wiener process (also called Brownian motion) under <math>Q</math>.

Intuitive interpretationEdit

Suppose that the position <math>X_t</math> of a particle evolves according to the diffusion process <math display="block"> dX_t = \mu(X_t,t) \, dt + \sigma(X_t,t) \, dW^Q_t. </math> Let the particle incur "cost" at a rate of <math>f(X_s, s)</math> at location <math>X_s</math> at time <math>s</math>. Let it incur a final cost at <math>\psi(X_T)</math>.

Also, allow the particle to decay. If the particle is at location <math>X_s</math> at time <math>s</math>, then it decays with rate <math>V(X_s, s)</math>. After the particle has decayed, all future cost is zero.

Then <math>u(x, t)</math> is the expected cost-to-go, if the particle starts at <math>(t, X_t = x).</math>

Partial proofEdit

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 formulaEdit

Show that the solution <math>u(x,t)</math> from the Feynman-Kac formula satisfies the PDE:

<math>

\frac{\partial u}{\partial t} + \mu \frac{\partial u}{\partial x} + \frac{1}{2} \sigma^2 \frac{\partial^2 u}{\partial x^2} - V u + f = 0. </math>

Let <math>g(t,s) = e^{-\int_t^s V(X_r, r) dr}</math>. Its differential satisfies:

<math>

dg(t,s) = -V(X_s, s) g(t,s) \, ds. </math>

Define the process:

<math>

Y_s = g(t,s) u(X_s, s) + \int_t^s g(t,\tau) f(X_\tau, \tau) \, d\tau. </math>

At boundary times:

<math>

Y_t = u(X_t, t), \quad Y_T = g(t,T) \psi(X_T) + \int_t^T g(t,\tau) f(X_\tau, \tau) \, d\tau. </math>

If <math>Y_s</math> is a martingale, then we have

<math>

u(X_{t}, t) = Y_{t} = \mathbb{E}[Y_{T} \mid X_{t}=x] </math>

So we just need to prove <math>Y_s</math> is a martingale. Assume <math>X_s</math> follows the SDE

<math>

dX_s = \mu(X_s, s) \, ds + \sigma(X_s, s) \, dW_s. </math>

By Itô's lemma:

<math>

du(X_s, s) = \left( \frac{\partial u}{\partial s} + \mu \frac{\partial u}{\partial x} + \frac{1}{2} \sigma^2 \frac{\partial^2 u}{\partial x^2} \right) ds + \sigma \frac{\partial u}{\partial x} dW_s. </math>

Differentiate <math>Y_s</math>:

<math>

dY_s = d\left[g(t,s) u(X_s, s)\right] + g(t,s) f(X_s, s) \, ds. </math>

Expand <math>d[g u]</math>:

<math>

d[g u] = g \, du + u \, dg + \underbrace{d[g, u]}_{=0}. </math>

Substitute <math>dg = -V g \, ds</math> and <math>du</math>:

<math>

d[g u] = g \left( \frac{\partial u}{\partial s} + \mu \frac{\partial u}{\partial x} + \frac{1}{2} \sigma^2 \frac{\partial^2 u}{\partial x^2} \right) ds </math>

<math>

\qquad\quad +\; g \sigma \frac{\partial u}{\partial x} \, dW_s \;-\; V g u \, ds. </math>

Add the integral term:

<math>

dY_s = \left[ g \left( \frac{\partial u}{\partial s} + \mu \frac{\partial u}{\partial x} + \frac{1}{2} \sigma^2 \frac{\partial^2 u}{\partial x^2} \right) - V g u + g f \right] ds + g \sigma \frac{\partial u}{\partial x} dW_s. </math>

For <math>Y_s</math> to be a martingale, the drift term must vanish:

<math>

\frac{\partial u}{\partial s} + \mu \frac{\partial u}{\partial x} + \frac{1}{2} \sigma^2 \frac{\partial^2 u}{\partial x^2} - V u + f = 0. </math>

Remarks about the derivationEdit

  • The proof above that a solution must have the given form is essentially that of <ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref> with modifications to account for <math>f(x,t)</math>.

  • The expectation formula above is also valid for N-dimensional Itô diffusions. The corresponding partial differential equation for <math> u:\mathbb{R}^N\times [0,T] \to\mathbb{R}</math> becomes:<ref>See Template:Cite book</ref> <math display="block">\frac{\partial u}{\partial t} + \sum_{i=1}^N \mu_i(x,t)\frac{\partial u}{\partial x_i} + \frac{1}{2} \sum_{i=1}^N \sum_{j=1}^N\gamma_{ij}(x,t) \frac{\partial^2 u}{\partial x_i \partial x_j} -r(x,t)\,u = f(x,t), </math> where, <math display="block"> \gamma_{ij}(x,t) = \sum_{k=1}^N \sigma_{ik}(x,t)\sigma_{jk}(x,t),</math> i.e. <math>\gamma = \sigma \sigma^{\mathrm{T}}</math>, where <math>\sigma^{\mathrm{T}}</math> denotes the transpose of <math>\sigma</math>.
  • More succinctly, letting <math>A</math> be the infinitesimal generator of the diffusion process,<math display="block">\frac{\partial u}{\partial t} + A u -r(x,t)\,u = f(x,t), </math>
  • This expectation can then be approximated using Monte Carlo or quasi-Monte Carlo methods.
  • When originally published by Kac in 1949,<ref>Template:Cite journal This paper is reprinted in Template:Cite book</ref> 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 <math display="block">

\exp\left(-\int_0^t V(x(\tau))\, d\tau\right) </math> in the case where x(τ) is some realization of a diffusion process starting at Template:Math. 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 <math>u V(x) \geq 0</math>, <math display="block"> \operatorname{E}\left[\exp\left(- u \int_0^t V(x(\tau))\, d\tau\right) \right] = \int_{-\infty}^{\infty} w(x,t)\, dx </math> where Template:Math and <math display="block">\frac{\partial w}{\partial t} = \frac{1}{2} \frac{\partial^2 w}{\partial x^2} - u V(x) w. </math> The Feynman–Kac formula can also be interpreted as a method for evaluating functional integrals of a certain form. If <math display="block"> I = \int f(x(0)) \exp\left(-u\int_0^t V(x(t))\, dt\right) g(x(t))\, Dx </math> where the integral is taken over all random walks, then <math display="block"> I = \int w(x,t) g(x)\, dx </math> where Template:Math is a solution to the parabolic partial differential equation <math display="block"> \frac{\partial w}{\partial t} = \frac{1}{2} \frac{\partial^2 w}{\partial x^2} - u V(x) w </math> with initial condition Template:Math.

Example ApplicationEdit

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):

<math>\frac{\partial}{\partial t} u(x, t) + b \frac{\partial}{\partial x} u(x, t) = -\sigma^2 \frac{\partial^2}{\partial x^2} u(x, t)</math>

Consider the convection–diffusion PDE with parameters <math>b = 1</math>, <math>\sigma = 1</math> and terminal condition is <math>u(x,T) = e^{-x^2}</math> with <math>T = 1</math>. Then the PDE has analytic solution:

<math>u(x, t) = \frac{1}{5 - 4t} \exp \left(\frac{(1 - t + x)^2}{4t - 5} \right)</math>

Applying the Feynman-Kac formula, the solution can also be written as the conditional expectation:

<math>u(x, t) = \mathbb{E}[\psi(X_T)|X_{t} = x_{0}] = \mathbb{E}[e^{-X_{T}^2} | X_0 = x_0]</math>

where <math>X</math> is an Itô process governed by the SDE <math>dX_t = dt + \sqrt{2} dW_t</math> and <math>W_t</math> is a Wiener process. Then using the Euler-Maruyama method, the SDE can be numerically integrated forwards in time from the initial conditions <math>(x_0, t_0)</math> till the terminal time <math>T</math>, yielding simulated values of <math>X_T</math>. To approximate the expectation in the Feynman-Kac method, the simulation is repeated <math>N</math> times. These are often called realizations. The solution is then estimated by the Monte Carlo average

<math>u(x_0, t_0) \approx \frac{1}{N} \sum_{i=1}^{N} \exp\left( - \left( X_T^{(i)} \right)^2 \right)</math>

The figure below compares the analytical solution with the numerical approximation obtained using the Euler–Maruyama method with <math>N = 1000</math>. 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 <math>N</math> or decreasing the Euler–Maruyama time step improves the accuracy and reduces the variance of the approximation.

File:Combined analytic and Euler Murayama simulations on Convcection Diffusion PDE.png
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.

ApplicationsEdit

FinanceEdit

In quantitative finance, the Feynman–Kac formula is used to efficiently calculate solutions to the Black–Scholes equation to price options on stocks<ref name="Brandimarte2013">Template:Cite book</ref> and zero-coupon bond prices in affine term structure models.

For example, consider a stock price <math>S_t</math> undergoing geometric Brownian motion <math display="block">dS_t = \left(r_t dt + \sigma_t dW_t\right) S_t </math> where <math>r_t</math> is the risk-free interest rate and <math>\sigma_t</math> is the volatility. Equivalently, by Itô's lemma, <math display="block"> d\ln S_t = \left(r_t - \tfrac 1 2 \sigma_t^2\right)dt + \sigma_t \, dW_t. </math> Now consider a European call option on an <math>S_t</math> expiring at time <math>T</math> with strike <math>K</math>. At expiry, it is worth <math>(X_T - K)^+.</math> Then, the risk-neutral price of the option, at time <math>t</math> and stock price <math>x</math>, is <math display="block"> u(x, t) = \operatorname{E}\left[e^{-\int_t^T r_s ds} (S_T - K)^+ | \ln S_t = \ln x \right]. </math> Plugging into the Feynman–Kac formula, we obtain the Black–Scholes equation: <math display="block">\begin{cases} \partial_t u + Au - r_t u = 0 \\ u(x, T) = (x-K)^+ \end{cases}</math> where <math display="inline"> A = (r_t -\sigma_t^2/2)\partial_{\ln x} + \frac 12 \sigma_t^2 \partial_{\ln x}^2 = r_t x\partial_x + \frac 1 2 \sigma_t^2 x^2 \partial_{x}^2. </math> More generally, consider an option expiring at time <math>T</math> with payoff <math>g(S_T)</math>. The same calculation shows that its price <math>u(x,t)</math> satisfies <math display="block">\begin{cases} \partial_t u + Au - r_t u = 0 \\ u(x, T) = g(x). \end{cases}</math> 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.

Quantum mechanicsEdit

In quantum chemistry, it is used to solve the Schrödinger equation with the pure diffusion Monte Carlo method.<ref name="caffarel1988">Template:Cite journal</ref>

See alsoEdit

ReferencesEdit

Template:Reflist

Further readingEdit

Template:Richard Feynman