User:ICanSeeYourPixels/sandbox

The Leimkuhler-Matthews method (or LM method in its original paper ) is an algorithm for finding discretized solutions to the Brownian_dynamics


 * $$\mathrm{d} X_t = -\nabla V(X_t) \, \mathrm{d} t + \sigma \, \mathrm{d} W_t,$$

where $$ \sigma>0$$ is a constant and $$ V(X) $$ can be thought of as a potential energy function commonly found in classical molecular dynamics, with $$X_t \in \mathbb{R}^N $$ the $$N$$ dimensional state vector along with $$N$$ dimensional Wiener process denoted $$W_t$$. Given a timestep $$\Delta t$$, the update scheme is compactly written as


 * $$Y_{t+\Delta t} = Y_t -\nabla V(Y_t) \Delta t + \sigma\frac{\sqrt{\Delta t}}2 \, (R_t+R_{t+\Delta t}),$$

with initial condition $$ Y_0 := X_0 $$, and where $$R_k$$ is a vector of independent normal random numbers redrawn at each step so $$\text{E}[ R_k \cdot R_{k+s}]=N\delta_{ts}$$ (where $$\text{E}[\bullet]$$ denotes expectation). Despite being of equal cost to the Euler-Maruyama scheme (in terms of the number of evaluations of the function $$ \nabla V(X_t) $$ per update), given some assumptions on $$ \Delta t,\, V(X)$$ and $$f(X)$$ solutions have been shown to have a superconvergence property


 * $$ \text{E}[|f(Y_{t}) - f(X_t)|] \leq C_1 e^{-\lambda t} \Delta t + C_2 \Delta t^2 $$

for constants $$C_k\geq0,\, \lambda>0 $$ not depending on $$t$$. This means that as $$t$$ gets large we obtain an effective second order with $$\Delta t^2$$ error in computed expectations. For small timestep $$ \Delta t$$ this can give significant improvements over the Euler-Maruyama scheme, at no extra cost.

Comparison to other schemes
The obvious method for comparison is the Euler-Maruyama scheme as it has the same cost, requiring one evaluation of $$\nabla V(X)$$ per step. Its update is of the form


 * $$\hat{Y}_{t+\Delta t} = \hat{Y}_t -\nabla V(\hat{Y}_t) \Delta t + \sigma{\sqrt{\Delta t}} \, R_t,$$

with error (given some assumptions ) as $$ \text{E}[|f(\hat{Y}_{t}) - f(X_t)|] \leq C \Delta t $$ with constant $$C>0$$ independent of $$t$$. Compared to the above definition, the only difference between the schemes is the one-step averaged noise term, making it simple to implement.

For sufficiently small timestep $$\Delta t$$ and large enough time $$t$$ it is clear that the LM scheme gives a smaller error than Euler-Maruyama. While there are many algorithms that can give reduced error compared to the Euler scheme (see e.g. Milstein, Runge-Kutta or Heun's method) these almost always come at an efficiency cost, requiring more computation in exchange for reducing the error. However the Leimkuhler-Matthews scheme can give significantly reduced error with minimal change to the standard Euler scheme. The trade-off comes from the (relatively) limited scope of the stochastic differential equation it solves: $$\sigma$$ must be a scalar constant and the drift function must be of the form $$\nabla V(X)$$. The LM scheme also is not Markovian, as updates require more than just the state at time $$t$$. However, we can recast the scheme as a Markov process by extending the space.

Markovian Form
We can rewrite the algorithm in a Markovian form by extending the state space with a momentum vector  $$P_t\in\mathbb{R}^N$$ so that the overall state is $$(X_t,P_t)$$ at time $$t$$. Initializing the momentum to be a vector of $$N$$ standard normal random numbers, we have


 * $$Y'_{t+\Delta t} = Y_t -\nabla V(Y_t) \Delta t + \sigma\frac{\sqrt{\Delta t}}2 \, P_t,$$
 * $$P_{t+\Delta t} \sim \text{Normal}(0,I),$$
 * $$Y_{t+\Delta t} = Y'_{t+\Delta t} + \sigma\frac{\sqrt{\Delta t}}2 \, P_{t+\Delta t},$$

where the middle step completely redraws the momentum so that each component is an independent normal random number. This scheme is Markovian, and has the same properties as the original LM scheme.

Applications
The algorithm has application in any area where the weak (i.e. average) properties of solutions to Brownian dynamics are required. This applies to any molecular simulation problem (such as classical molecular dynamics), but also can apply to statistical sampling problems due to the properties of solutions at large times. In the limit of $$t\to\infty$$, solutions will become distributed according to the Probability distribution $$\pi(X) \propto \exp(-V(X))$$. Thus we can generate independent samples according to a required distribution by using $$V(X) = -\log(\pi(X))$$ and running the LM algorithm until large $$t$$. Such strategies can be efficient in (for instance) Bayesian inference problems.