Consider a diffusion process:


$ \text{d}X\_t = f(X\_t)\text{d}t + \text{d}W\_t$


I've seen it given that the log-likelihood of the path is proportional to the Onsager-Machlup functional


$ \int\_0^T \left(\frac{1}{2} \left|\dot{x}-f(x)\right|^2+\frac{1}{2}\nabla\_x\cdot f(x)\right)\text{d}t$.


Where does the second term with the divergence come from? I think I once knew this ... is it something to do with the interpretation of $\dot{x}$ or the commutator $[x,\dot{x}]$?


The expression can be found, for example, in p. 5 section 3.1 of Hairer et al, "A Bayesian approach to Data Assimilation" <http://www.hairer.org/papers/bayesian.pdf>.



log-likelihood of ito diffusion
This is a very old but interesting question. When deriving the Onsager--Machlup functional, the drift divergence term comes from 
$$
\lim\_{\epsilon\to 0} 
E\left[\exp\left(\int\_0^1 f(x(t)+W\_t)\,dW\_t\right) \,\middle\vert\, 
\lVert W\rVert<\epsilon\right] =
\exp\left(-\frac12\int\_0^1 \nabla\cdot f(x(t))\,dt\right).
$$
This limit is proved with the help of Itō's formula (cf. Capitaine, [1995](http://dx.doi.org/10.1007/BF01213388), p. 197) and comes from the Girsanov transformation of measures.


I interpret this term as accounting for the amplification of the noise by the system.
The first term of the OM functional corresponds to the fictitious density of the associated Wiener process, at the path point associated with $x$.
The second term quantifies how much the drift suck in larger tubes of noise or pushes out smaller tubes (Dutra [2014](http://arxiv.org/abs/1403.5194)).
This is analogous to the Jacobian term in the [transformation of densities](http://en.wikipedia.org/wiki/Probability_density_function#Dependent_variables_and_change_of_variables) on $\mathbb R^n$.
Consider a linear system, the more negative its eigenvalues (which makes them "more stable") more probable are the $\epsilon$-tubes around the zero path, or around a path which satisfies the associated ODE without noise.


