Feynman–Kac formula

From HandWiki
Short description: 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 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 equation∂∂tu(x,t)+μ(x,t)∂∂xu(x,t)+12σ2(x,t)∂2∂x2u(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 μ,σ,f:ℝ×[0,T]→ℝ, ψ:ℝ→ℝ, and V:ℝ×[0,T]→[0,∞) are known functions, T>0 is a parameter, and u:ℝ×[0,T]→ℝ is the unknown function. If a solution to the above equation exists, then the Feynman–Kac formula expresses u(x,t) as a conditional expectation of a certain random variable:

u(x,t)=𝔼[e−∫tTV(Xs,s)dsψ(XT)+∫tTe−∫tτV(Xs,s)dsf(Xτ,τ)dτ|Xt=x]

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

The result only holds, if the functions μ,σ,f,V,ψ fulfill certain technical requirements. First of all, the functions μ and σ must be such that the above stochastic differential equation has a unique (strong or weak) solution. This is for example the case, when μ and σ are Lipschitz-continuous in space, i.e., there exists a constant L>0 such that

|μ(t,x)−μ(t,y)|≤L|x−y|,|σ(t,x)−σ(t,y)|≤L|x−y|,

for all t∈[0,T] and x,y∈ℝ. Moreover, the functions f,V,ψ must be continuous and f,ψ must be additionally either non-negative or of polynomial growth, which means

|ψ(x)|≤K(1+|x|p),maxt∈[0,T]|f(t,x)|≤K(1+|x|p),

for some K>0, p≥2 and for all x∈ℝ. And finally, the solution u itself must be of polynomial growth as well (however with different constant and exponent).[3]

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

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

∂u∂t+μ∂u∂x+12σ2∂2u∂x2−Vu+f=0

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

Let g(t,s)=e−∫tsV(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)=𝔼[YT∣Yt=u(x,t)]=𝔼[YT∣Xt=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)=(∂u∂s+μ∂u∂x+12σ2∂2u∂x2)ds+σ∂u∂xdWs.

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(∂u∂s+μ∂u∂x+12σ2∂2u∂x2)ds
+gσ∂u∂xdWs−Vguds.

Add the integral term:

dYs=[g(∂u∂s+μ∂u∂x+12σ2∂2u∂x2)−Vgu+gf]ds+gσ∂u∂xdWs.

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

∂u∂s+μ∂u∂x+12σ2∂2u∂x2−Vu+f=0.

Remarks

  • The proof above that a solution must have the given form is essentially that of [4] 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:[5] ∂u∂t+∑i=1Nμi(x,t)∂u∂xi+12∑i=1N∑j=1Nγij(x,t)∂2u∂xi∂xj−r(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,∂u∂t+Au−r(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,[6] 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) = 0. 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) is the solution to the parabolic partial differential equation ∂w∂t=12∂2w∂x2−V(x)wwith initial condition w(x, 0) = δ(x).

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) is the solution to ∂w∂t=12∂2w∂x2−V(x)w with initial condition w(x, 0) = f(x).

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)+b∂∂xu(x,t)=−σ2∂2∂x2u(x,t)

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

u(x,t)=15−4texp⁡(−(1−t+x)25−4t)

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

u(x,t)=𝔼[e−XT2|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)≈1N∑i=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.

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.

Generalizations

Higher dimensions

The Feynman–Kac formula extends straighforwardly to the d-dimensional case. Let

  • μ:ℝd×[0,T]→ℝd,
  • σ:ℝd×[0,T]→ℝd×m,
  • f:ℝd×[0,T]→ℝ,
  • ψ:ℝd→ℝ,
  • V:ℝd×[0,T]→[0,∞),

be known functions and T>0. Moreover, let u:ℝd×[0,T]→ℝ be the solution to the partial differential equation

∂∂tu(x,t)+μ(x,t)⋅∇u(x,t)+12∑i,j=1d(σσT)ij(x,t)∂2∂xixju(x,t)−V(x,t)u(x,t)+f(x,t)=0,

defined for all x∈ℝd and t∈[0,T], subject to the terminal condition

u(x,T)=ψ(x),x∈ℝd.

Then, under the same technical assumptions as in the one-dimensional case, the Feynman–Kac formula for u reads as[3]

u(x,t)=𝔼[e−∫tTV(Xs,s)dsψ(XT)+∫tTe−∫tτV(Xs,s)dsf(Xτ,τ)dτ|Xt=x],

where X=(X1,…,Xd) is the solution to the stochastic differential equation

dXti=μi(Xt,t)dt+∑j=1mσij(Xt,t)dWtj,i∈{1,…,d},

and W1,…,Wm are m independent Wiener processes.

Elliptic equations

The equation for u in the classical setting from above is a parabolic equation, since it involves a first order derivative in time. The Feynman–Kac can also be extended to elliptic equations, where there is no time derivative and there exists a constant c>0 such that

∑i,j=1d(σσT)ij(x)ξiξj≥c‖ξ‖2,∀ξ∈ℝd,x∈D,

for some bounded domain D⊂ℝd. The stochastic process X needed for the formula is now the solution to the time-homogeneous equation

dXti=μi(Xt)dt+∑j=1mσij(Xt)dWtj,i∈{1,…,d},

with Lipschitz continuous functions μ:D→ℝd and σ:D→ℝd×m.

Now, given continuous functions

  • f:D¯→ℝ,
  • ψ:∂D→ℝ,
  • V:D¯→[0,∞),

if there exists a solution u to the equation (sometimes called the Dirichlet problem[3])

{μ⋅∇u+12∑i,j=1d(σσT)ij∂2∂xixju−Vu+f=0,in Du=ψ,on ∂D

and if the first exit time of X from D is bounded in expectation,

τD:=inf⁡{t≥0:Xt∉D},𝔼[τD∣X0=x]<∞,∀x∈D,

then u admits the representation[3]

u(x)=𝔼[e−∫0τV(Xr)drψ(Xτ)+∫0τe−∫0sV(Xr)drf(Xs)ds∣X0=x],∀x∈D¯.

Under additional assumptions on the smoothness of the domain D and of the coefficient functions μ,σ,f,ψ,V, one can show that the Dirichlet problem has indeed a unique solution, which is then given by the Feynman–Kac formula.[7]

Space-time domains

The Feynman–Kac formula can also be generalized to a setting, where the spacial domain of the above partial differential equation is bounded (in contrast to ℝd) and where the space- and time domains are not independent (not a cartesian product).

Let D⊂ℝd×(0,T] be a bounded space-time domain and Dt={x∈ℝd:(x,t)∈D} a time section of D. Define as X the solution of the stochastic differential equation

dXti=μi(Xt,t)ds+∑j=1mσij(Xt,t)dWtj,i∈{1,…,d},

with Lipschitz continuous functions μ:D→ℝd and σ:D→ℝd×m, and the first exit time of X from D as

τ=inf⁡{s>0:Xs∈Ds}.

Given functions

  • f:D→ℝ,
  • ψ:∂D∖({0}×D0)→ℝ,
  • V:D→[0,∞),

and if certain technical assumptions are fulfilled, then the equation

{∂∂tu+μ⋅∇u+12∑i,j=1d(σσT)ij∂2∂xixju−Vu+f=0,in Du=ψ,on ∂D∖({0}×D0)

has a unique solution u, which is given by[7]

u(x,t)=𝔼[e−∫tτV(Xr,r)drψ(Xτ,τ)+∫tτe−∫tsV(Xr,r)drf(Xs,s)ds∣Xt=x].

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[8] 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, dln⁡St=(rt−12σt2)dt+σtdWt. Now consider a European call option on an St expiring at time T with strike K. At expiry, it is worth (XT−K)+. Then, the risk-neutral price of the option, at time t and stock price x, is u(x,t)=E⁡[e−∫tTrsds(ST−K)+|ln⁡St=ln⁡x]. Plugging into the Feynman–Kac formula, we obtain the Black–Scholes equation: {∂tu+Au−rtu=0u(x,T)=(x−K)+ where A=(rt−σt2/2)∂ln⁡x+12σt2∂ln⁡x2=rtx∂x+12σt2x2∂x2. 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+Au−rtu=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.[9]

See also

References

  1. ↑ Kac, Mark (1987). Enigmas of Chance: An Autobiography. University of California Press. pp. 115–16. ISBN 0-520-05986-7. https://books.google.com/books?id=1ZWl39UJWycC&pg=PA115. 
  2. ↑ Glimm, James; Jaffe, Arthur (1987). Quantum Physics: A Functional Integral Point of View (2 ed.). New York, NY: Springer. pp. 43–44. doi:10.1007/978-1-4612-4728-9. ISBN 978-0-387-96476-8. https://doi.org/10.1007/978-1-4612-4728-9. Retrieved 13 April 2021. 
  3. ↑ 3.0 3.1 3.2 3.3 Karatzas, Ioannis; Shreve, Steven E. (1991). Brownian Motion and Stochastic Calculus (2nd ed.). Berlin: Springer. pp. 364-366. ISBN 3-540-97655-8. 
  4. ↑ "PDE for Finance". http://www.math.nyu.edu/faculty/kohn/pde_finance.html. 
  5. ↑ See Pham, Huyên (2009). Continuous-time stochastic control and optimisation with financial applications. Springer-Verlag. ISBN 978-3-642-10044-4. 
  6. ↑ Kac, Mark (1949). "On Distributions of Certain Wiener Functionals". Transactions of the American Mathematical Society 65 (1): 1–13. doi:10.2307/1990512.  This paper is reprinted in Baclawski, K.; Donsker, M. D., eds (1979). Mark Kac: Probability, Number Theory, and Statistical Physics, Selected Papers. Cambridge, Massachusetts: The MIT Press. pp. 268–280. ISBN 0-262-11067-9. 
  7. ↑ 7.0 7.1 Costantini, Cristina; Gobet, Emmanuel; El Karoui, Nicole (2006). "Boundary Sensitivities for Diffusion Processes in Time Dependent Domains". Applied Mathematics and Optimization 54: 159-187. https://doi.org/10.1007/s00245-006-0863-4. 
  8. ↑ Paolo Brandimarte (6 June 2013). "Chapter 1. Motivation". Numerical Methods in Finance and Economics: A MATLAB-Based Introduction. John Wiley & Sons. ISBN 978-1-118-62557-6. https://books.google.com/books?id=iH9ltZtOsM4C. 
  9. ↑ Caffarel, Michel; Claverie, Pierre (15 January 1988). "Development of a pure diffusion quantum Monte Carlo method using a full generalized Feynman–Kac formula. I. Formalism". The Journal of Chemical Physics 88 (2): 1088–1099. doi:10.1063/1.454227. Bibcode: 1988JChPh..88.1088C. https://aip.scitation.org/doi/10.1063/1.454227. 

Further reading

  • Simon, Barry (1979). Functional Integration and Quantum Physics. Academic Press. ISBN 0126442509. 
  • Hall, B. C. (2013). Quantum Theory for Mathematicians. Springer. ISBN 9781461471158.