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 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 tu(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 condition u(x,T)=ψ(x), where μ,σ,ψ,V,f are known functions, T is a parameter, and u:×[0,T] is the unknown. Then the Feynman–Kac formula expresses u(x,t) as a conditional expectation under the probability measure Q Template:Equation box 1 where X is an Itô process satisfying dXt=μ(Xt,t)dt+σ(Xt,t)dWtQ, gτ and gs are functions defined as gκ(a,b)=exp(abV(Xκ,κ)dκ) where κ can be substituted for τ or s as appropriate, and WtQ a Wiener process (also called Brownian motion) under Q.

Intuitive interpretation

Suppose that the position Xt of a particle evolves according to the diffusion process dXt=μ(Xt,t)dt+σ(Xt,t)dWtQ. 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 ψ(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, 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 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 u(x,t) from the Feynman-Kac formula satisfies the PDE:

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

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

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

Define the process:

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

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(Xt,t)=Yt=𝔼[YTXt=x]

So we just need to prove Ys is a martingale. 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.
  • 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 exp(0tV(x(τ))dτ) 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 uV(x)0, E[exp(u0tV(x(τ))dτ)]=w(x,t)dx where Template:Math and wt=122wx2uV(x)w.

The Feynman–Kac formula can also be interpreted as a method for evaluating functional integrals of a certain form. If I=f(x(0))exp(u0tV(x(t))dt)g(x(t))Dx where the integral is taken over all random walks, then I=w(x,t)g(x)dx where Template:Math is a solution to the parabolic partial differential equation wt=122wx2uV(x)w with initial condition Template:Math.

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

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

Consider the convection–diffusion PDE with parameters b=1, σ=1 and terminal condition is u(x,T)=ex2 with T=1. Then the PDE has analytic solution:

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)=𝔼[ψ(XT)|Xt=x0]=𝔼[eXT2|X0=x0]

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 conditions (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

Template:Reflist

Further reading

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

Template:Richard Feynman

  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".