WorksPhysics and Astronomy
Correcting systematic errors in the likelihood optimization of underdamped Langevin models of molecular dynamics trajectories
Abstract
Since Kramers' pioneering work in 1940, significant efforts have been devoted to studying Langevin equations applied to physical and chemical reactions projected onto few collective variables, with particular focus on the inference of their parameters. While the inference for overdamped Langevin equations is well-established and widely applied, a notable gap remains in the literature for underdamped Langevin equation. This gap arises from the challenge of accessing velocities solely through finite differences of positions, resulting in spurious correlations. In this letter, we propose an analytical correction for these correlations, specifically designed for a likelihood-maximization algorithm that exploits short, non-ergodic trajectories that can be obtained at reasonable numerical cost. The accuracy and robustness of our approach are tested on a benchmark case and a realistic system. This work paves the way for applying generalized Langevin equation inference to activated phenomena, such as chemical reactions, in several scientific domains.
In addition to providing ergodic canonical sampling for atomistic simulations of condensed phase systems, Langevin equations are used by a broad scientific community to describe the time evolution of generic observables. The flexibility of the equations’ structure, accommodating both deterministic and Markovian or non-Markovian random forces, enables them to model successfully phenomena as diverse as phase transitions[1], climate-change effects on ocean currents[2], and clocks[3].
In particular, many complex, high-dimensional physical and chemical processes can be effectively studied through the lens of Langevin dynamics when projected onto one (or a few) collective variable (CV), that tracks their progress4. Depending on the problem, different types of Langevin equations should be adopted. In this work, we focus on the underdamped, Markovian regime. In this case, the evolution equations are
where is the effective CV mass, the free energy landscape (or potential of mean force), is the friction, is the amplitude of the random force, and a time-uncorrelated Gaussian white noise. If
fluctuation dissipation is enforced. In general, and are not available analytically and must be determined starting from observational time series of the CV and (in principle of) its velocity, based, e.g., on experiments or molecular dynamics trajectories.
Furthermore, the stochastic equation is typically not employed in the differential form above, but via a numerical integrator with a finite time step5 , that establishes the time resolution adopted to analyze the data. Such resolution is a key parameter: depending on the degree of temporal coarse-graining, different types of Langevin equations act as suitable approximations6. In the case of overdamped models, statistical inference approaches based on likelihood maximization currently allow to reconstruct the potential of mean force, the diffusion coefficient (related to the friction) and the kinetic rate in a range of overdamped processes7–15. We remark that long, ergodic trajectories that accurately sample the probability landscape of the CV are often unavailable, so it is important to develop numerical schemes able to exploit also short, unbiased, non-ergodic trajectories15.
The parametrization of underdamped models is presently considerably less developed and understood. These models are, however, needed to describe important phenomena, such as migrating cells dynamics16 and biomolecular processes17, that display inertial effects at fine-grained time resolution, so progress in this direction is highly desirable. Unfortunately, model inference for the underdamped case is significantly more complex than for the overdamped. CV positions and velocities appear on equal footings in Eq. (1). However, often in observational time-series only coordinates are directly accessible, while velocities need to be estimated via finite differences schemes18. This introduces spurious correlations even at infinitely-small time resolution, spoiling the accuracy of current inference methods. In Ref.19 it was shown that serious inaccuracies on friction estimation (subsequently affecting free energy estimation in non ergodic calculations), arise when the propagator deployed in the likelihood scheme is of order lower than . Unfortunately, no general solution for this problem was proposed.
The spurious velocity correlations hinder also use of alternative approaches. For example, in Refs.17,20,21 only positions are employed in the parametrization of the potential of mean force and the friction (and diffusion) is obtained via local averages. This procedure, however, is based on an ad hoc choice of an integrator of first order in time and therefore open to the problems highlighted in Ref. 19. A solution to the problems arising from finite-difference velocities was proposed in Ref. 16, where unbiased estimators for the drift and noise amplitude in Eq. (1) were derived. Even though this method represents a significant advance in the inference of realistic data, converging these estimators requires simulations lengths that might be unattainable in the presence of free-energy barriers. The approaches mentioned above are not based on likelihood maximization. More recently, we introduced a likelihood-based scheme in which the velocity issue was circumvented by inferring the friction beforehand through correlation functions within a free-energy well6. This approach has the advantage of simplicity but it does not account for the position-dependence of the friction and relies on approximately harmonic dynamics.
In this letter, we propose a novel likelihood-maximization approach that overcomes the limitations of current inference schemes for underdamped Langevin models: requiring as only input short, non ergodic trajectories, it eliminates the aforementioned systematic errors via an original analytical correction scheme. We provide both a priori and a posteriori evaluations of the quality of the inference that do not require prior knowledge on the system. We demonstrate the accuracy and robustness of the approach with respect to varying the time resolution of the Langevin model for benchmark and realistic systems. In principle, the approach can be extended to non-Markovian generalized Langevin equations.
The projection of high-dimensional Hamiltonian dynamics onto one (or a few) CV(s) results in a generalized Langevin equation4,22, that simplifies to the Markovian Eq. (1) for sufficiently coarse temporal subsampling6. Starting from a given set of trajectories discretized as samples, an efficient strategy to parametrize Langevin models exploits the maximization of a likelihood function written as the product of short-time propagators:
where is the set of model parameter, which in our case include friction and free-energy landscapes. The mass is directly estimated using the equipartition theorem or via a coordinate transformation6,23.
Following Refs. 6,24 we approximate the propagator in
Gaussian form
where averages , and (co)variances (elements of the matrix ) are defined in SI section A.
As proved in SI section B, the specific form of the matrix and averages adopted in this work corresponds, to order , to the evolution determined by the second order Vanden-Eijnden and Ciccotti (VEC) integrator for underdamped Langevin dynamics (eq. 21 in Ref. 5):
with , . and are two independent Gaussian random numbers with zero mean and unit variance. This correspondence can also be verified numerically. If exact positions and velocities of a VEC trajectory with integration time step are supplied to Eqs. (2),(3), the maximum likelihood value is obtained for the correct parameters of the underlying underdamped Langevin equation. This is illustrated in Figure 1, that shows, for a double-well landscape, different curves showing as a function of the friction. Let us focus, for the moment, on the dashed black curve in the figure, computed by feeding to the likelihood positions and velocities coming from a VEC trajectory: it yields an optimal , which is, indeed, the friction used to integrate the trajectory.

Figure 1. Corrected log-likelihood estimated from the finite-difference velocity using the first two equations in the set of Eq. (6), as a function of the friction , for non-ergodic trajectories of a double-well system (with free energy and mass fixed to their optimal values), for different numbers of iterations of the correcting scheme. The non-corrected curve is displayed for comparison. The dashed line represents the log-likelihood computed from the integration velocities.
In typical applications, we need to estimate velocities starting from the observed positions at a given time resolution , resulting in a bias in the likelihood. This is illustrated via the purple curve in Figure 1, obtained using finite-difference velocities. We now describe how this problem can be efficiently and accurately corrected. Let us consider the time-reversible central finite difference estimator of the velocity , combined with the VEC integrator. In SI section C, it is shown that, up to order , the difference between and the integration velocity is given by:
Using this result, the properties of Gaussian white noises and their correlations with positions or velocities (SI section D), we can correct the averages appearing in the likelihood:
This enables to remove from the log-likelihood the spurious correlations that lead to substantial systematic errors for inferred free-energy and friction landscapes (SI section E for details). The corrections depend implicitly on the friction , one of the parameters that must be inferred, via . To circumvent this problem, we adopt an expectation-maximization scheme:
likelihood optimization without correction
correction of the likelihood with the previously obtained friction and new optimization
iterate until convergence
The efficiency of the scheme is demonstrated in Figure 1, where, after 5 iterations, the correction added to finite-difference velocity likelihood (dark-red curve) recovers the likelihood computed using the integration velocity (dashed curve).
As a first full illustration of the validity and efficiency of the new algorithm, we infer the parameters of the underdamped Langevin equation from one-dimensional underdamped Langevin trajectories in a double-well landscape with a barrier, and unit mass, using an Euler-Maruyama integrator with a time step of . Time resolutions are employed for analyses, to ensure that the choice of integrator does not affect the inference results. Importantly, we consider relatively-short non-ergodic trajectories to train the model (Figure 2a), since in realistic barrier-crossing processes it is unfeasible to perform ergodic MD simulations.

Figure 2. Benchmarks for the new inference approach. Top panels: double well landscape; Bottom panels: fullerenes in water. (a) Underdamped Langevin trajectories relaxing from the top of the barrier. (b) Free-energy profiles for underdamped models inferred at different time resolutions with the likelihood correction (except the purple dashed curve, for comparison). (c) Velocity autocorrelation function of the original trajectories and of synthetic ones generated from the models using the Euler–Maruyama integrator. (d) Correlation analysis of the noise time series deduced from the trajectories in panel (a) by inverting the positional part of Vanden-Eijnden Ciccotti integrator. The inset shows the noise distribution. (e) Aimless shooting trajectories of a fullerene dimer in water (see inset) projected onto the distance between the C centers of mass. (f) Free-energy profiles at different time resolutions using the likelihood correction (inset: result without correction, with a barrier). (g) Comparison between the velocity autocorrelation function of the original trajectories and of synthetic ones generated from the models using the Euler–Maruyama integrator (inset: memory kernel computed for the associated state of the dimer). (h) Correlation analysis of the noise time series deduced from the trajectories in (e) by inverting the positional part of the VEC integrator. The inset shows the noise distribution.
In general, in order to determine whether the initial data can be accurately reproduced with an underdamped Langevin model, there are two characteristic timescales that define the acceptable bounds for inference. The lower bound is set by the correlation time of the noise for projected (non-Markovian) dynamics, and the upper bound is determined by the velocity decorrelation time. The time-resolution adopted in the underdamped inference, , has to be coarse-enough to lose non-Markovian effects, while providing sufficient resolution to capture the original velocity autocorrelation function (VACF). In our benchmark case, with Markovian dynamics, the lower limit is of no concern. Figure 2c shows that, for our double well system, a time resolution should be adequate.
Our iterative correction scheme is then applied to CV trajectories, for which the velocity is accessed through finite differences. We then systematically compare the statistical properties of original trajectories with those of the underdamped models generated at different values. Results are shown in Figure 2, panels a-d. The sampling trajectories and results for the inferred free energy are presented in panel a and b of Figure 2. The free-energy landscape is accurately reproduced up to consistently with the VACF diagnostics in Figure 2c. As a further test, Figure 2d reports the distribution and time-correlation of the noise reconstructed from the trajectory via the Langevin model, compared to the expected ideal behavior (derived in SI, Section F). Results for the friction are reported in SI section G where we show that it is accurately reproduced (error within ) only up to .
In summary, consistently with the diagnostics, the most accurate models are obtained for in the range –, even though the error remains moderate for higher , highlighting the stability of our inference scheme with respect to the increase of time resolution. Note that, without applying the correction scheme, the model is inaccurate even for an optimal choice . As shown by the purple dashed curve in Figure 2b, in this case, the barrier is underestimated by about and the friction by about , to be compared with the relative error on the latter predicted in Ref. 19.
We now focus on a realistic system, formed by two fullerene nanoparticles immersed in liquid water, modeled as a periodically-repeated cubic simulation box including 2398 water molecules (Figure 2e inset). We perform MD simulations at 300 K in the ensemble25, with the SPC water force field26 and OPLS-AA27 for carbon using the GROMACS 2019.4 code28, with a timestep of 1 fs. For computational details we refer to Ref.6. We modified the masses of oxygen and carbon to 1 and 120 a.u., respectively to ensure, without affecting the free-energy landscape, a wider range of time resolutions for the accurate reconstruction of underdamped models (see SI section H for comparisons with unmodified masses).
We analyze the dissociation/association process of the fullerene dimer, employing 500 short (40 ps) unbiased MD trajectories relaxing from the transition state ensemble, generated with the aimless shooting algorithm15,29. The high-dimensional trajectories are projected onto one CV, defined as the distance between the centers of mass of the two fullerenes (Figure 2e). Albeit sub-optimal, this CV captures the main features of the transition process. In particular, explicitly including water degrees of freedom does not improve the kinetic description30.
As for the benchmark case, as a first step we determine a time resolution that avoids memory effects while maintaining smoothness in the VACF. The memory kernel in Figure 2g, computed using the Volterra method of Ref.31 on a locally-equilibrated 10 ns trajectory of the dimer, indicates that ps is required to eliminate most non-Markovian effects, notwithstanding a surviving tail in the memory kernel. We make here the customary approximation of a position-independent kernel.
To ensure a good representation of the VACF (Figure 2g, black dashed line), the upper bound is set as ps. Thus, we conclude that the inference of underdamped Langevin models can be attempted for ps. We apply our inference scheme in this range, obtaining
and by likelihood maximization, while estimating the mass via equipartition of kinetic energy at the finest time resolution ps, yielding ps nm.
As a first observation, we note that the inferred free-energy profile is in good agreement with the brute-force reference, particularly in the dimer region, except for the largest ps. For ps, the barrier height is consistent within 1 across models, even though the transition-state region is best captured by the ps model. The importance of the likelihood correction can be appreciated from the inset in Figure 2f: the uncorrected model at the optimal yields a grossly inaccurate free-energy barrier (), consistent with the bad diagnostics in Figure 2g,Figure 2h. Even for other values of , the barrier is always overestimated. Comparison of the VACF for the different models with the one from the original MD simulation (Figure 2g) confirms that the time resolution ps is the most suitable for accurately modeling the projected dynamics. The same resolution appears optimal also by testing the time-correlation of the noise inferred by interpreting the original MD trajectories as if they were generated by the Langevin models, compared with the expected analytical result (Figure 2h). We note that in the case of MD simulation data the interpretation of the noise correlation could be more subtle than for the benchmark one-dimensional system of Figure 2d, due to the long, non-exponential tail of the memory kernel. The probability density of the noise, well described by a Gaussian of zero mean and 2/3 variance for different values, points again to reliable models.
An important motivation for the inference of stochastic models from limited, non-ergodic MD data is the attempt to predict kinetic properties without passing through cumbersome free-energy calculation techniques, often based on biased simulations32,33. We test the quantitative predictive power of the data-driven models of the fullerene dimer in water by comparing their dissociation rates with the brute-force one: as shown in Table 1, the model with the best performance from the viewpoint of diagnostics ( ps) overestimates the MD rate by only 20%, whereas models with different have less accurate rates, but always in the same order of magnitude. Note that without our correction scheme, the errors in the estimation of the barrier (and friction) lead to very severe errors in the rates, that sometimes cannot even be computed.
| [ps] | MFPT [ns] |
| 0.1 | |
| 0.2 | |
| 0.3 | |
| 0.4 | |
| 0.5 | |
| 1 | |
| MD |
Table 1. Mean first passage time (MFPT) for fullerene dissociation predicted by the Langevin models, inferred using the likelihood correction, computed using Euler-Maruyama integrator, compared to the brute-force MFPT from all-atom MD simulations. Statistical uncertainties are standard deviations of the mean.
In summary, the results presented in this paper demonstrate that the proposed correction to likelihood inference eliminates systematic errors originating from finite-difference CV velocity estimation. The new scheme is able to parametrize accurate underdamped Langevin models of real complex systems projected on a CV, even for barrier-crossing processes, despite of the use of short, non-ergodic trajectories. We underline the importance of the diagnostic tests we put forward to assess the pertinence and expected accuracy of the model in realistic scenarios, where the brute-force free-energy landscape or kinetic rate are not known beforehand. The main limitation to the applicability of this method, based on the Markovian Langevin equation, arises from the existence of long-time memory kernels in several realistic systems. To go beyond this hurdle, two possible strategies could be explored: i) increasing the dimensionality of the model to mitigate non-Markovian effects, or ii) adapting our approach to the inference of generalized Langevin models, where memory effects are reproduced by the addition of hidden variables, based on expectation-maximization likelihood schemes34.
Acknowledgements
This work was performed with the support of the Institut des Sciences du Calcul et des Données (ISCD) of Sorbonne University (IDEX SUPER 11-IDEX-0004). Calculations were performed on the GENCI-IDRIS French national supercomputing facility, under grant numbers A0110811069, A0130811069. We gratefully acknowledge Line Mouaffac and Jeremy Diharce for suggestions related to code development and simulations.
Supporting Information:
Cumulants entering the propagator expression
We list here the cumulants obtained with the procedure from Ref.[1]
with and is the positional derivative of the force at . The covariance matrix can then be written as
Correspondence between the propagator and the integrator
In order to demonstrate the correspondence (up to order ) between the propagator derived from Ref.[1] and the VEC integrator[2], we start by rewriting the integrator in vector form:
We need to estimate the average of the variables and of the Gaussian in Eq. (3) of the main text, therefore we evaluate the average of the right hand side of Eq. (13), keeping and as constant (since the relevant dynamical variables are the increments and ). The resulting moments , are manifestly equivalent to the ones from the previous section, as long as we approximate . The covariance matrix is where is the matrix multiplying the noises in Eq. (13). Explicitly,
Clearly, and only differ from and (see previous section) at the order .
Finite-difference definition of velocities
Starting from the following definition of finite-difference velocities:
we can express the velocity for the VEC integrator as
Using the update equation for the velocity, this leads to
with
The Taylor expansion up to order gives
Therefore, the difference is minimized for .
Even though the derivation of this correction does not explicitly account for position-dependent friction. If we consider a case, where is small and do not vary drastically, it seems reasonable to allow the friction to be position dependent in the likelihood maximization.
Correlations of position, velocity and noise for the VEC integrator
In order to express the differences in Eq. (6), we will need the following properties for the noises times velocity
and noises times position
All of these properties can be obtained by multiplying Eq. (4) by a certain noise or and taking the averages.
Likelihood correction
We show here how to isolate the correlations introduced in Eq. (6) starting from the likelihood function. For the sake of simplicity we use the following notations and . Let us consider
We can take variances (Eq. S3, S4, S5) out of the sums in Eq. S17 to express it as
with
Now that the correlations of Eq. (6) appear in the previous expressions it is then possible to account for the use of finite difference velocities.
Noise Analysis
To further validate the accuracy of the inference, it is useful to analyze the noise that would have been required to reproduce the initial trajectories using the optimal Langevin model. In the absence of the issues arising from finite-difference velocities, the recovered noise should be centered around zero, exhibit unit variance, and be delta-correlated in time. We focus on the positional part of the numerical integrator (Eq. (4)), combining the two noise terms and isolating them as:
Using properties of Gaussian white noises and Eq. (6), it is possible to obtain the following properties of :
while the time correlation vanishes for time delays larger than .
Accuracy of inferred friction coefficients
Table G displays friction coefficient for the different time resolution in the underdamped Langevin benchmark case. We can observe that without using the correcting scheme the value obtained is (coherent with Ref.[3]). In this case, due to the non-ergodicity of the trajectories the error on the friction also impacts the inference of the free energy.
We also show the friction profiles for the fullerenes dimer in water (with modified mass) on Figure S1.

Figure S1. Friction profiles for the different Langevin models, for fullerene dimer dynamics in water, at different time resolutions using the likelihood correction (the dashed orange curve shows the result without correction).
| [ps] | [ps] |
| 0.001 | |
| 0.001 (no corr.) | |
| 0.005 | |
| 0.01 | |
| 0.02 | |
| 0.04 | |
| expected | 5.0 |
Table S1. Friction for the different Langevin models, inferred using the likelihood correction, for the benchmark double-well system: underdamped Langevin trajectories relaxing from the top of a barrier, integrated with a 0.1 fs time step using an Euler-Maruyama integrator with unit mass and ps. The case where the likelihood correction is not applied is reported as well.
Fullerenes dimer in water with unmodified masses
Figure S2 presents the memory kernel and velocity autocorrelation function (VACF) for a fullerene dimer in water, projected onto the distance between the two centers of mass. The masses of the carbon and oxygen atoms remain unmodified. We observe no clear timescale separation, indicating that the system does not exhibit an underdamped regime.

Figure S2. Memory kernel and VAC computed for 10ns in the associative bassin, for unmodified masses system.
This lack of separation explains why none of the free-energy profiles inferred from the underdamped models agree with the expected free energy (see Figure S3).

Figure S3. Free-energy profiles at different time resolutions using the likelihood correction, for unmodified masses system.
References
- [1]A. N. Drozdov, Phys. Rev. E 55, 2496 (1997).
- [2]E. Vanden-Eijnden and G. Ciccotti, Chem. Phys. Lett. 429, 310 (2006).
- [3]F. Ferretti, V. Chardes, T. Mora, A. M. Walczak, and I. Giardina, Phys. Rev. X. 10, 031018 (2020).