Fokker-Planck Equation

The Fokker-Planck equation (FPE) is a partial differential equation that describes the time evolution of the probability density function of a stochastic process defined by a [[Stochastic Differential Equation (SDE)|stochastic differential equation]]. It provides the deterministic macroscopic description of the stochastic microscopic dynamics, bridging the gap between random particle trajectories and their ensemble distribution.


1. Core Concept

1.1 From Stochastic Trajectories to Deterministic Density

A single particle governed by an [[Stochastic Differential Equation (SDE)|SDE]] follows a random path:

dXt=μ(Xt,t)dt+σ(Xt,t)dWt

While each trajectory is random, the probability density p(x,t) of finding the particle at position x at time t evolves deterministically according to the Fokker-Planck equation:

p(x,t)t=x[μ(x,t)p(x,t)]+122x2[σ2(x,t)p(x,t)]

[!NOTE] Key Insight
The Fokker-Planck equation transforms a stochastic trajectory problem into a deterministic density evolution problem — much like how the [[Schrödinger Equation]] governs quantum probability amplitudes. It is the master equation for continuous-state, continuous-time [[Markov Process|Markov processes]].

1.2 Physical Interpretation

Term Expression Physical Meaning
Drift term x[μp] Probability flows in the direction of deterministic trend
Diffusion term 122x2[σ2p] Probability spreads out due to random noise
  • μ(x,t) = drift coefficient: pushes the distribution’s mean
  • σ(x,t) = diffusion coefficient: broadens the distribution

2. One-Dimensional Fokker-Planck Equation

2.1 Standard Form

For an [[Stochastic Differential Equation (SDE)|SDE]] with drift μ(x,t) and diffusion σ(x,t) :

pt=x[μ(x,t)p]+122x2[σ2(x,t)p]

2.2 Probability Current Form

The FPE can be rewritten as a continuity equation (conservation of probability):

pt+Jx=0

where the probability current (probability flux) J(x,t) is:

J(x,t)=μ(x,t)p(x,t)12x[σ2(x,t)p(x,t)]

[!NOTE] Conservation of Probability
Just like the continuity equation in fluid dynamics ( ρt+(ρv)=0 ), the FPE ensures that total probability is conserved: p(x,t)dx=1 for all t .

2.3 Derivation from SDE

Step 1 — The infinitesimal generator L of the [[Stochastic Differential Equation (SDE)|SDE]] is:

Lf(x)=μ(x,t)fx+12σ2(x,t)2fx2

Step 2 — Its adjoint operator L governs the density evolution:

pt=Lp=x[μp]+122x2[σ2p]

Step 3 — Boundary conditions ensure probability conservation:

  • Natural boundary: J(x,t)0 as |x|
  • Reflecting boundary: J=0 at boundary
  • Absorbing boundary: p=0 at boundary

3. Key Special Cases

3.1 Pure Diffusion ([[Wiener Process|Wiener Process]] / Brownian Motion)

For μ=0 , σ=1 (standard [[Wiener Process|Wiener Process]]):

pt=122px2

This is the heat equation (or diffusion equation). The solution with initial condition p(x,0)=δ(xx0) is:

p(x,t)=12πtexp((xx0)22t)

3.2 Ornstein-Uhlenbeck Process

For μ(x)=θx (mean-reverting), σ constant:

pt=x[θxp]+σ222px2

Stationary solution:

p(x)=θπσ2exp(θx2σ2)N(0,σ22θ)

3.3 Geometric Brownian Motion

For μ(x)=μx , σ(x)=σx (used in finance):

pt=x[μxp]+σ222x2[x2p]

Solution (log-normal distribution):

p(x,t)=1xσ2πtexp((lnxlnx0(μσ2/2)t)22σ2t)

3.4 Summary Table

Process Drift μ(x) Diffusion σ(x) FPE Type
Wiener Process 0 1 Heat equation
OU Process θx σ Mean-reverting
Geometric BM μx σx Log-normal
Constant drift μ σ Convection-diffusion
VP-[[Stochastic Differential Equation (SDE)|SDE]] 12β(t)x β(t) Variance-preserving
VE-[[Stochastic Differential Equation (SDE)|SDE]] 0 dσ2dt Variance-exploding

4. Multidimensional Fokker-Planck Equation

4.1 General d -Dimensional Form

For a multivariate SDE:

dXt=μ(Xt,t)dt+σ(Xt,t)dWt

where WtRm is an m -dimensional [[Wiener Process|Wiener process]], the Fokker-Planck equation becomes:

pt=i=1dxi[μip]+12i=1dj=1d2xixj[Dijp]

where the diffusion matrix is D=σσRd×d .

4.2 Compact Operator Notation

pt=(μp)+12((Dp))

or in terms of the probability current J :

pt+J=0,J=μp12(Dp)

4.3 Isotropic Noise Special Case

When σ=σI (independent noise in each dimension):

pt=(μp)+σ222p

This is the form most commonly encountered in [[Diffusion Model|diffusion models]].


5. Stationary Distribution

5.1 Equilibrium Condition

For a time-homogeneous [[Stochastic Differential Equation (SDE)|SDE]] ( μ and σ independent of t ), the stationary distribution p(x) satisfies pt=0 :

0=ddx[μ(x)p(x)]+12d2dx2[σ2(x)p(x)]

5.2 Closed-Form Solution (1D)

Integrating once with zero probability current ( J=0 ) gives:

μ(x)p(x)=12ddx[σ2(x)p(x)]

Solution:

p(x)=Cσ2(x)exp(2x0xμ(y)σ2(y)dy)

where C is a normalization constant such that p(x)dx=1 .

5.3 Potential Form

If μ(x)=dU(x)dx (gradient of a potential U ) and σ is constant:

p(x)=Cexp(2U(x)σ2)

This is the Gibbs-Boltzmann distribution with “temperature” σ22 .

[!NOTE] Physical Analogy
The stationary distribution corresponds to thermal equilibrium in statistical mechanics. The drift μ(x)=U(x) drives the system toward lower potential energy, while diffusion ( σ ) adds thermal fluctuations.


6. Forward and Backward Kolmogorov Equations

Aspect Forward (Fokker-Planck) Backward (Kolmogorov)
Variable Future state x (at time t ) Initial state x0 (at time 0 )
Operates on Probability density p(x,tx0) Expectation u(x0,t)=E[f(Xt)X0=x0]
Equation pt=Lp ut=Lu
Boundary condition Given initial distribution Given final payoff u(x,T)=f(x)
Application Density evolution, diffusion models Option pricing (Feynman-Kac), hitting probabilities

6.1 Backward Kolmogorov Equation

The backward equation governs the evolution of expectations:

u(x,t)t=μ(x)ux+12σ2(x)2ux2

with terminal condition u(x,T)=f(x) . Then u(x0,0)=E[f(XT)X0=x0] .

6.2 Feynman-Kac Formula

The backward equation extends to include a potential (discount) term:

ut+μux+σ222ux2r(x)u=0

with solution:

u(x,t)=E[f(XT)exp(tTr(Xs)ds)|Xt=x]

7. Connection to Diffusion Models

7.1 Forward Process as Fokker-Planck Evolution

In [[Diffusion Model|diffusion models]], the forward process follows an [[Stochastic Differential Equation (SDE)|SDE]]:

dxt=f(t)xtdt+g(t)dWt

The Fokker-Planck equation describing pt(x) is:

pt(x)t=x[f(t)xpt(x)]+12g(t)2x2pt(x)

The initial condition is the data distribution p0(x)=pdata(x) , and after sufficient time T , pT(x)N(0,σT2I) .

7.2 VP-SDE and VE-SDE Specific Forms

Variance-Preserving (VP) [[Stochastic Differential Equation (SDE)|SDE]] ( f(t)=12β(t) , g(t)=β(t) ):

ptt=12β(t)x(xpt)+12β(t)x2pt

Variance-Exploding (VE) [[Stochastic Differential Equation (SDE)|SDE]] ( f(t)=0 , g(t)=dσ2(t)dt ):

ptt=12dσ2(t)dtx2pt

7.3 Connection to [[Probability Flow ODE]]

The Fokker-Planck continuity form:

ptt=x[vt(x)pt(x)]

directly defines the [[Probability Flow ODE]] velocity field:

vt(x)=f(t)x12g(t)2xlogpt(x)

This means the [[Probability Flow ODE]] and the forward [[Stochastic Differential Equation (SDE)|SDE]] share the same Fokker-Planck equation — and therefore the same marginal densities pt(x) at all times.

[!NOTE] Key Bridge
The Fokker-Planck equation is the mathematical bridge connecting three equivalent descriptions of diffusion models:

  1. SDE (stochastic trajectories)
  2. Probability Flow ODE (deterministic trajectories)
  3. Score matching (density gradients)

7.4 Score Function Role

In the Fokker-Planck framework, the [[Score Function|score function]] xlogpt(x) appears naturally as the term that shifts the probability current from pure diffusion toward the data distribution in the reverse process.


8. Numerical Methods

8.1 Finite Difference Method

Discretize the spatial domain and approximate derivatives:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# 1D Fokker-Planck solver (finite difference)
def fokker_planck_fd(mu, sigma, x_grid, t_grid, p0):
"""
Solve ∂p/∂t = -∂/∂x[μp] + (1/2)∂²/∂x²[σ²p]
Using Crank-Nicolson (implicit, stable)
"""
dx = x_grid[1] - x_grid[0]
dt = t_grid[1] - t_grid[0]
N = len(x_grid)

p = p0.copy()
p_history = [p0.copy()]

for n in range(1, len(t_grid)):
# Build tridiagonal matrix for Crank-Nicolson
A = build_crank_nicolson_matrix(mu, sigma, dx, dt, N)
B = build_rhs_matrix(mu, sigma, dx, dt, N)

p = solve_linear_system(A, B @ p)
p_history.append(p.copy())

return p_history

8.2 Monte Carlo Approach

Instead of solving the PDE, simulate many SDE trajectories and estimate the density:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
def fokker_planck_mc(mu, sigma, x0, T, n_paths=10000):
"""Estimate density at time T via Monte Carlo simulation."""
X_T = np.zeros(n_paths)

for i in range(n_paths):
X = x0
t = 0
dt = 0.001
while t < T:
dW = np.sqrt(dt) * np.random.randn()
X += mu(X, t) * dt + sigma(X, t) * dW
t += dt
X_T[i] = X

# Estimate density from samples
density, bins = np.histogram(X_T, bins=100, density=True)
return bins, density

8.3 Method Comparison

Method Accuracy Speed Dimension Best For
Finite Difference High Slow d3 Low-dim, high precision
Finite Element High Medium d3 Complex geometries
Monte Carlo Low-Medium Fast Any d High dimensions
Spectral Methods Very High Fast d2 Smooth, periodic problems
Deep Learning Medium Medium Any d High-dim, irregular domains

9. Mathematical Properties

9.1 Conservation and Positivity

  1. Probability conservation: ddtp(x,t)dx=0
  2. Positivity preservation: If p(x,0)0 , then p(x,t)0 for all t>0
  3. Smoothing property: FPE instantly smooths any initial distribution ( t>0p(x,t)C under ellipticity)

9.2 Connection to [[Itô’s Lemma]]

The Fokker-Planck equation can be derived from [[Itô’s Lemma]] by considering the expected time evolution of a test function φ(x) :

ddtE[φ(Xt)]=E[Lφ(Xt)]

where L is the infinitesimal generator. Integration by parts yields the FPE.

9.3 Ergodic Behavior

For an ergodic [[Markov Process|Markov process]]:

  • Unique stationary distribution p exists
  • p(x,t)p(x) as t
  • Convergence rate determined by spectral gap of L

9.4 Entropy Production

The Fokker-Planck equation satisfies an H -theorem: the relative entropy (KL divergence) to the stationary distribution decreases monotonically:

ddtDKL(ptp)0

This implies the system irreversibly approaches equilibrium — a manifestation of the Second Law of Thermodynamics for stochastic systems.


10. Core Formula Cards

[!QUOTE] 1D Fokker-Planck Equation

pt=x[μ(x,t)p]+122x2[σ2(x,t)p]

[!QUOTE] Probability Current Form

pt+Jx=0,J=μp12x[σ2p]

[!QUOTE] Multidimensional FPE

pt=ixi[μip]+12i,j2xixj[Dijp]

[!QUOTE] Stationary Distribution (1D, zero flux)

p(x)=Cσ2(x)exp(2x0xμ(y)σ2(y)dy)

[!QUOTE] Heat Equation ([[Wiener Process|Wiener Process]] / μ=0,σ=1 )

pt=122px2

[!QUOTE] Infinitesimal Generator

Lf(x)=μ(x)fx+12σ2(x)2fx2 pt=Lp

[!QUOTE] Backward Kolmogorov Equation

ut=μ(x)ux+12σ2(x)2ux2

[!QUOTE] FPE in [[Diffusion Model|Diffusion Models]]

ptt=[f(t)xpt]+12g(t)22pt

11. Summary

Aspect Description
What it describes Time evolution of probability density under an SDE
Type Second-order parabolic PDE
Input Drift μ(x,t) , diffusion σ(x,t) , initial density p(x,0)
Output Density p(x,t) at all future times
Key property Conservation of total probability
Role in diffusion models Bridges SDE description to Probability Flow ODE
Physical analog Continuity equation, heat equation, Fick’s law of diffusion
Named after Adriaan Fokker (1914) and Max Planck (1917)

  • [[Stochastic Differential Equation (SDE)]]
  • [[Wiener Process|Wiener Process]]
  • [[Probability Flow ODE]]
  • [[Diffusion Model]]
  • [[Itô’s Lemma]]
  • [[Itô Integral]]
  • [[Markov Process]]
  • [[Martingale]]
  • [[Score Function]]
  • [[Kolmogorov Equations]]
  • [[Neural ODE]]
  • [[Langevin Dynamics]]
  • [[Feynman-Kac Formula]]

Dataview Query

1
2
3
LIST
FROM #fokker_planck OR #pde OR #stochastic_process
SORT file.ctime DESC

References

  • Paper: On the Theory of Brownian Motion (Fokker, 1914)
  • Paper: Über einen Satz der statistischen Dynamik (Planck, 1917)
  • Book: The Fokker-Planck Equation: Methods of Solution and Applications — Hannes Risken
  • Book: Stochastic Processes in Physics and Chemistry — Van Kampen
  • Book: Stochastic Differential Equations: An Introduction with Applications — Bernt Øksendal
  • Paper: Score-Based Generative Modeling through SDEs (Song et al., 2021)
  • Paper: Maximum Likelihood Training of Score-Based Diffusion Models (Song et al., 2021)
  • Blog: Fokker-Planck Equation and Diffusion Models — AI papers summary
  • Course: MIT 18.S096 Topics in Mathematics with Applications in Finance
  • Course: CS236 Deep Generative Models (Stanford)