Feynman–Kac formula

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

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.[1] The Feynman–Kac formula resulted, which proves rigorously a real-valued analogy to Feynman's path integrals. The complex case, needed in quantum mechanics, is still an open question.[2]

The formula offers a method of solving certain partial differential equations by simulating random paths of a stochastic process. Conversely, it can be used to compute an important class of expectations of random processes by deterministic means.

Theorem

Consider the partial differential equationtu(x,t)+μ(x,t)xu(x,t)+12σ2(x,t)2x2u(x,t)V(x,t)u(x,t)+f(x,t)=0,defined for all x and t[0,T], subject to the terminal conditionu(x,T)=ψ(x),where μ,σ,ψ,V,f are known functions, T is a parameter, and u:×[0,T] is the unknown function. Then the Feynman–Kac formula expresses u(x,t) as a conditional expectation of a certain random variable:

Template:Equation box 1

where Xt is an Itô process satisfying the stochastic differential equationdXt=μ(Xt,t)dt+σ(Xt,t)dWt,and Wt is the Wiener process (also called Brownian motion).

Intuitive interpretation

Suppose that Xt describes the position at time t of a particle that evolves according to the diffusion process dXt=μ(Xt,t)dt+σ(Xt,t)dWt.Let the particle incur "cost" at a rate of f(Xs,s) at location Xs at time s. Let it incur a final cost at time T of ψ(XT).

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

Then u(x,t) is the expected cost-to-go, if the particle starts at (t,Xt=x).

Partial proof

A proof that the above expected-value 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

Assume that u(x,t) satisfies the PDE:

ut+μux+12σ22ux2Vu+f=0

with terminal conditionu(x,T)=ψ(x).Further let Xt be a stochastic process as defined above.

Let g(t,s)=etsV(Xr,r)dr. Its differential satisfies:

dg(t,s)=V(Xs,s)g(t,s)ds.

Define the stochastic process:

Ys=g(t,s)u(Xs,s)+tsg(t,τ)f(Xτ,τ)dτ

for s[t,T]. At boundary times:

Yt=u(Xt,t),YT=g(t,T)ψ(XT)+tTg(t,τ)f(Xτ,τ)dτ.

If Ys is a martingale, then we have

u(x,t)=𝔼[YTYt=u(x,t)]=𝔼[YTXt=x]

which is what we want to show. So we just need to prove Ys is a martingale.

We assume Xs follows the SDE

dXs=μ(Xs,s)ds+σ(Xs,s)dWs.

By Itô's lemma:

du(Xs,s)=(us+μux+12σ22ux2)ds+σuxdWs.

Differentiate Ys:

dYs=d[g(t,s)u(Xs,s)]+g(t,s)f(Xs,s)ds.

Expand d[gu]:

d[gu]=gdu+udg+d[g,u]=0.

Substitute dg=Vgds and du:

d[gu]=g(us+μux+12σ22ux2)ds
+gσuxdWsVguds.

Add the integral term:

dYs=[g(us+μux+12σ22ux2)Vgu+gf]ds+gσuxdWs.

For Ys to be a martingale, the drift term must vanish:

us+μux+12σ22ux2Vu+f=0.

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 f(x,t).
  • The expectation formula above is also valid for N-dimensional Itô diffusions. The corresponding partial differential equation for u:N×[0,T] becomes:[4] ut+i=1Nμi(x,t)uxi+12i=1Nj=1Nγij(x,t)2uxixjr(x,t)u=f(x,t), where, γij(x,t)=k=1Nσik(x,t)σjk(x,t), i.e. γ=σσT, where σT denotes the transpose of σ.
  • More succinctly, letting A be the infinitesimal generator of the diffusion process,ut+Aur(x,t)u=f(x,t).
  • This expectation can then be approximated using Monte Carlo or quasi-Monte Carlo methods.

Original formulation about Wiener functionals

When originally published by Kac in 1949,[5] the formula was presented as a means for determining the distribution of certain Wiener functionals. Suppose we wish to find the expected value of the function exp(0tV(x(τ))dτ)in the case where x(t) is some realization of a diffusion process starting at x(0) = 0Script error: No such module "Check for unknown parameters".. The Feynman–Kac formula says that this expectation is equivalent to the integral of a solution to a corresponding diffusion equation. Specifically, under the conditions that V(x)0, 𝔼[exp(0tV(x(τ))dτ)]=w(x,t)dx where w(x, t)Script error: No such module "Check for unknown parameters". is the solution to the parabolic partial differential equation wt=122wx2V(x)wwith initial condition w(x, 0) = δ(x)Script error: No such module "Check for unknown parameters"..

The Feynman–Kac formula can also be used to evaluate functional integrals of a certain form. If, for example,I=f(x(0))exp(0tV(x(τ))dτ)g(x(t))Dxwhere the notation Dx refers to integration taken over all random walks x:[0,t], then I=w(x,t)g(x)dx where w(x, t)Script error: No such module "Check for unknown parameters". is the solution to wt=122wx2V(x)w with initial condition w(x, 0) = f(x)Script error: No such module "Check for unknown parameters"..

Example

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

tu(x,t)+bxu(x,t)=σ22x2u(x,t)

Consider the convection–diffusion PDE with parameters b=1, σ=1 and terminal condition u(x,T)=ex2 with T=1. Then the PDE can be solved analytically:

u(x,t)=154texp((1t+x)24t5)

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

u(x,t)=𝔼[eXT2|Xt=x]

where X is an Itô process governed by the SDE dXt=dt+2dWt and Wt is a Wiener process. Then using the Euler-Maruyama method, the SDE can be numerically integrated forwards in time from the initial condition (x0,t0) till the terminal time T, yielding simulated values of XT. To approximate the expectation in the Feynman-Kac method, the simulation is repeated N times. These are often called realizations. The solution is then estimated by the Monte Carlo average

u(x0,t0)1Ni=1Nexp((XT(i))2)

The figure below compares the analytical solution with the numerical approximation obtained using the Euler–Maruyama method with N=1000. 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 N 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.

Applications

Finance

In quantitative finance, the Feynman–Kac formula is used to efficiently calculate solutions to the Black–Scholes equation to price options on stocks[6] and zero-coupon bond prices in affine term structure models.

For example, consider a stock price St undergoing geometric Brownian motion dSt=(rtdt+σtdWt)St where rt is the risk-free interest rate and σt is the volatility. Equivalently, by Itô's lemma, dlnSt=(rt12σt2)dt+σtdWt. Now consider a European call option on an St expiring at time T with strike K. At expiry, it is worth (XTK)+. Then, the risk-neutral price of the option, at time t and stock price x, is u(x,t)=E[etTrsds(STK)+|lnSt=lnx]. Plugging into the Feynman–Kac formula, we obtain the Black–Scholes equation: {tu+Aurtu=0u(x,T)=(xK)+ where A=(rtσt2/2)lnx+12σt2lnx2=rtxx+12σt2x2x2. More generally, consider an option expiring at time T with payoff g(ST). The same calculation shows that its price u(x,t) satisfies {tu+Aurtu=0u(x,T)=g(x). 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 mechanics

In quantum chemistry, it is used to solve the Schrödinger equation with the pure diffusion Monte Carlo method.[7]

See also

References

<templatestyles src="Reflist/styles.css" />

  1. Script error: No such module "citation/CS1".
  2. Script error: No such module "citation/CS1".
  3. Script error: No such module "citation/CS1".
  4. See Script error: No such module "citation/CS1".
  5. Script error: No such module "Citation/CS1". This paper is reprinted in Script error: No such module "citation/CS1".
  6. Script error: No such module "citation/CS1".
  7. Script error: No such module "Citation/CS1".

Script error: No such module "Check for unknown parameters".

Further reading

  • Script error: No such module "citation/CS1".
  • Script error: No such module "citation/CS1".

Template:Richard Feynman