# Onsager–Machlup function

The Onsager–Machlup function is a function that summarizes the dynamics of a continuous stochastic process. It is used to define a probability density for a stochastic process, and it is similar to the Lagrangian of a dynamical system. It is named after Lars Onsager and Stefan Machlup [de] who were the first to consider such probability densities.
The dynamics of a continuous stochastic process X from time t = 0 to t = T in one dimension, satisfying a stochastic differential equation
    $dX_{t}=b(X_{t})\,dt+\sigma (X_{t})\,dW_{t}$
where W is a Wiener process, can in approximation be described by the probability density function of its value x$_i$ at a finite number of points in time t$_i$:
    $p(x_{1},\ldots ,x_{n})=\left(\prod _{i=1}^{n-1}{\frac {1}{\sqrt {2\pi \sigma (x_{i})^{2}\Delta t_{i}}}}\right)\exp \left(-\sum _{i=1}^{n-1}L\left(x_{i},{\frac {x_{i+1}-x_{i}}{\Delta t_{i}}}\right)\,\Delta t_{i}\right)$
where
    $L(x,v)={\frac {1}{2}}\left({\frac {v-b(x)}{\sigma (x)}}\right)^{2}$
and Δt$_i$ = t$_{i+1}$ − t$_i$ > 0, t$_1$ = 0 and t$_n$ = T. A similar approximation is possible for processes in higher dimensions. The approximation is more accurate for smaller time step sizes Δt$_i$, but in the limit Δt$_i$ → 0 the probability density function becomes ill defined, one reason being that the product of terms
    ${\frac {1}{\sqrt {2\pi \sigma (x_{i})^{2}\Delta t_{i}}}}$
diverges to infinity. In order to nevertheless define a density for the continuous stochastic process X, ratios of probabilities of X lying within a small distance ε from smooth curves φ$_1$ and φ$_2$ are considered:
    ${\frac {P\left(\left|X_{t}-\varphi _{1}(t)\right|\leq \varepsilon {\text{ for every }}t\in [0,T]\right)}{P\left(\left|X_{t}-\varphi _{2}(t)\right|\leq \varepsilon {\text{ for every }}t\in [0,T]\right)}}\to \exp \left(-\int _{0}^{T}L\left(\varphi _{1}(t),{\dot {\varphi }}_{1}(t)\right)\,dt+\int _{0}^{T}L\left(\varphi _{2}(t),{\dot {\varphi }}_{2}(t)\right)\,dt\right)$
as ε → 0, where L is the Onsager–Machlup function.

## Definition

Consider a d-dimensional Riemannian manifold M and a diffusion process X = {X$_t$ : 0 ≤ t ≤ T} on M with infinitesimal generator ⁠1/2⁠Δ$_M$ + b, where Δ$_M$ is the Laplace–Beltrami operator and b is a vector field. For any two smooth curves φ$_1$, φ$_2$ : [0, T] → M,
    $\lim _{\varepsilon \downarrow 0}{\frac {P\left(\rho (X_{t},\varphi _{1}(t))\leq \varepsilon {\text{ for every }}t\in [0,T]\right)}{P\left(\rho (X_{t},\varphi _{2}(t))\leq \varepsilon {\text{ for every }}t\in [0,T]\right)}}=\exp \left(-\int _{0}^{T}L\left(\varphi _{1}(t),{\dot {\varphi }}_{1}(t)\right)\,dt+\int _{0}^{T}L\left(\varphi _{2}(t),{\dot {\varphi }}_{2}(t)\right)\,dt\right)$
where ρ is the Riemannian distance, $\scriptstyle {\dot {\varphi }}_{1},{\dot {\varphi }}_{2}$ denote the first derivatives of φ$_1$, φ$_2$, and L is called the Onsager–Machlup function.
The Onsager–Machlup function is given by
    $L(x,v)={\tfrac {1}{2}}\|v-b(x)\|_{x}^{2}+{\tfrac {1}{2}}\operatorname {div} \,b(x)-{\tfrac {1}{12}}R(x),$
where || ⋅ ||$_x$ is the Riemannian norm in the tangent space T$_x$(M) at x, div b(x) is the divergence of b at x, and R(x) is the scalar curvature at x.

## Examples

The following examples give explicit expressions for the Onsager–Machlup function of a continuous stochastic processes.

### Wiener process on the real line

The Onsager–Machlup function of a Wiener process on the real line R is given by
    $L(x,v)={\tfrac {1}{2}}|v|^{2}.$
Proof: Let X = {X$_t$ : 0 ≤ t ≤ T} be a Wiener process on R and let φ : [0, T] → R be a twice differentiable curve such that φ(0) = X$_0$. Define another process X$^φ$ = {X$_t$$^φ$ : 0 ≤ t ≤ T} by X$_t$$^φ$ = X$_t$ − φ(t) and a measure P$^φ$ by
    $P^{\varphi }=\exp \left(\int _{0}^{T}{\dot {\varphi }}(t)\,dX_{t}^{\varphi }+\int _{0}^{T}{\tfrac {1}{2}}\left|{\dot {\varphi }}(t)\right|^{2}\,dt\right)\,dP.$
For every ε > 0, the probability that |X$_t$ − φ(t)| ≤ ε for every t ∈ [0, T] satisfies
    ${\begin{aligned}P\left(\left|X_{t}-\varphi (t)\right|\leq \varepsilon {\text{ for every }}t\in [0,T]\right)&=P\left(\left|X_{t}^{\varphi }\right|\leq \varepsilon {\text{ for every }}t\in [0,T]\right)\\&=\int _{\left\{\left|X_{t}^{\varphi }\right|\leq \varepsilon {\text{ for every }}t\in [0,T]\right\}}\exp \left(-\int _{0}^{T}{\dot {\varphi }}(t)\,dX_{t}^{\varphi }-\int _{0}^{T}{\tfrac {1}{2}}|{\dot {\varphi }}(t)|^{2}\,dt\right)\,dP^{\varphi }.\end{aligned}}$
By Girsanov's theorem, the distribution of X$^φ$ under P$^φ$ equals the distribution of X under P, hence the latter can be substituted by the former:
    $P(|X_{t}-\varphi (t)|\leq \varepsilon {\text{ for every }}t\in [0,T])=\int _{\left\{\left|X_{t}^{\varphi }\right|\leq \varepsilon {\text{ for every }}t\in [0,T]\right\}}\exp \left(-\int _{0}^{T}{\dot {\varphi }}(t)\,dX_{t}-\int _{0}^{T}{\tfrac {1}{2}}|{\dot {\varphi }}(t)|^{2}\,dt\right)\,dP.$
By Itō's lemma it holds that
    $\int _{0}^{T}{\dot {\varphi }}(t)\,dX_{t}={\dot {\varphi }}(T)X_{T}-\int _{0}^{T}{\ddot {\varphi }}(t)X_{t}\,dt,$
where $\scriptstyle {\ddot {\varphi }}$ is the second derivative of φ, and so this term is of order ε on the event where |X$_t$| ≤ ε for every t ∈ [0, T] and will disappear in the limit ε → 0, hence
    $\lim _{\varepsilon \downarrow 0}{\frac {P(|X_{t}-\varphi (t)|\leq \varepsilon {\text{ for every }}t\in [0,T])}{P(|X_{t}|\leq \varepsilon {\text{ for every }}t\in [0,T])}}=\exp \left(-\int _{0}^{T}{\tfrac {1}{2}}|{\dot {\varphi }}(t)|^{2}\,dt\right).$

### Diffusion processes with constant diffusion coefficient on Euclidean space

The Onsager–Machlup function in the one-dimensional case with constant diffusion coefficient σ is given by
    $L(x,v)={\frac {1}{2}}\left|{\frac {v-b(x)}{\sigma }}\right|^{2}+{\frac {1}{2}}{\frac {db}{dx}}(x).$
In the d-dimensional case, with σ equal to the unit matrix, it is given by
    $L(x,v)={\frac {1}{2}}\|v-b(x)\|^{2}+{\frac {1}{2}}(\operatorname {div} \,b)(x),$
where || ⋅ || is the Euclidean norm and
    $(\operatorname {div} \,b)(x)=\sum _{i=1}^{d}{\frac {\partial }{\partial x_{i}}}b_{i}(x).$

## Generalizations

Generalizations have been obtained by weakening the differentiability condition on the curve φ. Rather than taking the maximum distance between the stochastic process and the curve over a time interval, other conditions have been considered such as distances based on completely convex norms and Hölder, Besov and Sobolev type norms.

## Applications

The Onsager–Machlup function can be used for purposes of reweighting and sampling trajectories, as well as for determining the most probable trajectory of a diffusion process.