Source-linked AI summary
Variational cross-validation of slow dynamical modes in molecular kinetics
Robert T. McGibbon, Vijay S. Pande
TL;DR
The paper addresses the lack of a unified way to choose among alternative low-dimensional models of molecular kinetics. It develops cross-validation around the generalized matrix Rayleigh quotient (GMRQ), proving a variational bound in the infinite-data limit and showing why held-out evaluation is needed when finite-data noise causes overfitting.
Problem
Alternative methods for constructing low-dimensional molecular-kinetics models lack a unified theoretical framework for model selection, especially for applications to novel biological systems.
Method
The paper combines the GMRQ, which scores a rank-m approximation of the slow propagator subspace, with separate training and testing data for cross-validation.
Results
In the infinite-data limit, the variational bound ranks the true slow eigenspace above differing ansatz functions, whereas finite-data noise can inflate training GMRQ and make models less accurate on independent test data.
Takeaways & Limitations
Cross-validation provides a theoretically grounded way to quantify and avoid statistical overfitting when comparing molecular-kinetics models.
Abstract
from arXiv · showhide
Markov state models (MSMs) are a widely used method for approximating the eigenspectrum of the molecular dynamics propagator, yielding insight into the long-timescale statistical kinetics and slow dynamical modes of biomolecular systems. However, the lack of a unified theoretical framework for choosing between alternative models has hampered progress, especially for non-experts applying these methods to novel biological systems. Here, we consider cross-validation with a new objective function for estimators of these slow dynamical modes, a generalized matrix Rayleigh quotient (GMRQ), which measures the ability of a rank-$m$ projection operator to capture the slow subspace of the system. It is shown that a variational theorem bounds the GMRQ from above by the sum of the first $m$ eigenvalues of the system's propagator, but that this bound can be violated when the requisite matrix elements are estimated subject to statistical uncertainty. This overfitting can be detected and avoided through cross-validation. These result make it possible to construct Markov state models for protein dynamics in a way that appropriately captures the tradeoff between systematic and statistical errors.
I. INTRODUCTION
Molecular dynamics simulations produce high-dimensional trajectories whose quantitative analysis requires selecting simplified models of slow molecular kinetics. The paper combines variational eigenproblem methods with cross-validation to compare such models while managing bias–variance tradeoffs and statistical overfitting.
- Motivation: The paper targets quantitative analysis of molecular dynamics simulations as a remaining challenge after advances in force fields, sampling hardware, and distributed computing.The stated focus is the analysis of simulation results rather than potential-energy accuracy or sampling improvements.
- Motivation: MD trajectories are extremely high-dimensional, motivating methods that reduce complexity while retaining long-lived states, dynamical modes, and transition pathways.Routine simulations may contain tens or hundreds of thousands of atoms, with trajectory dimensions scaling as 3N or 6N when momenta are retained.
- Contribution: The proposed framework combines hyperparameter selection by cross-validation with variational approaches for linear-operator eigenproblems to discriminate between simplified molecular-kinetics models.The method concerns simultaneous approximation of the first m propagator eigenfunctions, which represent slow collective dynamical motions.
- Statistical challenge: Slow-mode estimators are affected by a bias–variance tradeoff: larger basis sets reduce approximation bias but can increase model variance and instability with fixed data.The first m propagator eigenfunctions are functions on the molecular configuration space and are only approximately represented in finite bases.
- Cross-validation: The cross-validation protocol trains estimators on disjoint trajectory subsets and evaluates them on held-out subsets, with hyperparameters selected by maximizing mean validation performance.The framework permits k-fold splitting, in which each fold serves once as a test set and the remaining trajectories form the training set.
III. THEORY BACKGROUND
The theory models reversible molecular dynamics with a compact, self-adjoint propagator whose leading eigenfunctions describe slow relaxation. Its first m eigenfunctions provide an optimal rank-m description of long-timescale dynamics, although the corresponding rank-constrained propagator need not preserve positivity.
- Propagator: The framework assumes a time-homogeneous, ergodic, continuous-time Markov process that is reversible with respect to a stationary distribution.The molecular phase space is taken concretely as R^3N when needed.
- Propagator: The propagator P(τ) maps an ensemble distribution forward by lag time τ and admits an eigenfunction–eigenvalue decomposition.Reversibility makes the propagator compact and self-adjoint under a µ^-1-weighted inner product.
- Slow modes: The leading propagator eigenfunctions represent dynamical modes with characteristic relaxation times, and the slowest modes often correspond to biologically important collective degrees of freedom.Slow eigenvalues lie near one and may be separated from faster processes by a spectral gap.
- Optimal reduction: The first m propagator eigenfunctions give the closest rank-m approximation in spectral norm and preserve the greatest amount of long-timescale dynamical information among m-dimensional reductions.This result extends the Eckart–Young theorem to self-adjoint linear operators.
- Caveat: The rank-constrained propagator is spectrally optimal but is not generally positivity-preserving, a property required for its probabilistic interpretation.Thus, spectral optimality does not by itself guarantee that the reduced operator remains a valid probabilistic propagator.
IV. OBJECTIVE FUNCTION AND SUBSPACE VARIATIONAL PRINCIPLE
The paper introduces a scalar variational objective for collectively estimating the slow propagator eigenspace and using it in cross-validation. The objective is bounded in the infinite-data limit, but finite-data noise can reverse this ordering and make held-out evaluation necessary.
- Objective function: tICA and MSM methods can be interpreted as optimizing the same variational criterion over different restricted families of basis functions.The criterion therefore provides a common objective for comparing alternative molecular-kinetics estimators.
- Variational bound: In the infinite-data limit, ansatz eigenfunctions differing from the true first m propagator eigenfunctions receive a lower score than the true eigenfunctions.The variational bound makes the objective suitable for cross-validation of slow-mode estimators.
- Overfitting: Finite-data noise can violate the variational bound: increasing basis-set size may raise training scores while reducing accuracy on independent test sets.The noise in estimated matrix elements depends on both available simulation data and basis-set size and flexibility.
- Subspace principle: The objective depends only on the subspace spanned by the ansatz functions, and its maximum identifies the slow eigenspace up to rotation.The matrices entering the objective include a time-lagged covariance-like matrix describing transitions between regions associated with the ansatz functions.
- Interpretation: The generalized objective measures the slowness of the reduced dynamics and supports cross-validation because its ideal value is bounded by the leading propagator eigenvalues.Maximizing it searches for coordinates along which the system decorrelates as slowly as possible.
A. Basis Function Expansion
The method represents slow propagator eigenfunctions as linear combinations of basis functions and optimizes their generalized matrix Rayleigh quotient. With fixed bases, optimization becomes a generalized eigenvalue problem over m-dimensional subspaces.
- A. Basis Function Expansion: The dominant eigenspace is approximated by linearly mixing a finite set of physically motivated basis functions.Possible bases include structural coordinates and indicator functions defining MSM states.
- A. Basis Function Expansion: The expansion coefficients define time-lagged correlation and overlap matrices from the corresponding basis-function matrices.These matrices encode lagged correlations and overlaps under the equilibrium measure.
- A. Basis Function Expansion: For ansatz functions built from the basis, the Rayleigh quotient becomes the generalized matrix Rayleigh quotient, GMRQ.The GMRQ is computed from the expansion coefficients and the basis-derived matrices.
- A. Basis Function Expansion: The objective depends only on the column span of the coefficient matrix, so optimization ranges over m-dimensional linear subspaces rather than individual parameterizations.Rescaling or any invertible transformation of the coefficient columns leaves the quotient unchanged.
- A. Basis Function Expansion: For fixed basis functions, the maximizing coefficient matrix consists of the m leading generalized eigenvectors of the correlation and overlap matrices.This eigenproblem is identical to the one used in tICA and the Ritz method.
B. Estimation of matrix elements from MD
The required correlation and overlap matrices can be estimated from equilibrium MD trajectories using time-lagged and unlagged basis-function correlations. These estimates support scoring trained eigenfunctions on independent data with the GMRQ.
- B. Estimation of matrix elements from MD: Matrix elements are estimated from equilibrium MD trajectories by applying the ergodic theorem to basis-function correlations with and without a time lag.The resulting statistics provide estimates of the time-lagged correlation and overlap matrices.
- B. Estimation of matrix elements from MD: Because the direct correlation estimator may violate symmetry, the practical implementation averages it with its transpose.This transpose symmetrization is equivalent to including each trajectory in both forward and reversed directions.
- B. Estimation of matrix elements from MD: MSM basis functions are indicator functions for non-overlapping conformation-space subsets.For this basis, correlation estimates come from observed transitions between states, while the overlap matrix is diagonal and estimates stationary state probabilities.
- B. Estimation of matrix elements from MD: The GMRQ becomes a cross-validation objective by evaluating trained expansion coefficients with correlation and overlap matrices estimated from a test dataset.The test-set score is R(Â; C(X′), S(X′)).
V. ALGORITHMIC REALIZATION
GMRQ-based cross-validation selects MSM basis-set hyperparameters by training on disjoint folds and scoring the resulting eigenvectors on held-out data. This procedure exposes overfitting that can make training scores rise while predictive performance worsens.
- V. ALGORITHMIC REALIZATION: The practical goal is to select basis functions for MSMs while leaving the phase-space partitioning flexible.The basis-set definition can vary through clustering, distance metrics, and dimensionality-reduction choices.
- V. ALGORITHMIC REALIZATION: The protocol splits trajectories into disjoint folds, constructs states and an MSM from each training subset, and computes its leading generalized eigenvectors.Training correlation and overlap matrices are estimated before solving the generalized eigenproblem.
- V. ALGORITHMIC REALIZATION: Trained eigenvectors are scored on held-out trajectories using test-set correlation and overlap matrices, with the mean test GMRQ serving as the model-selection metric.A corresponding mean training-set GMRQ is also calculated as an overfitting diagnostic.
- V. ALGORITHMIC REALIZATION: The selected hyperparameters are those maximizing the mean cross-validation score across candidate settings.This choice can compare alternatives such as state counts, clustering algorithms, and basis-set parameters.
- V. ALGORITHMIC REALIZATION: The protocol leaves the cross-validation degree k, rank m, and lag time τ unspecified, requiring choices based on the data regime and dynamical system.The authors use k = 5 experimentally and suggest selecting m from the number of slow processes or heuristically between 2 and approximately 10.
A. Double Well Potential
Experiments on a double-well system and peptide trajectories show that held-out GMRQ identifies useful MSM complexity, whereas training GMRQ can reward overfitted models. The framework compares state discretizations, clustering methods, and featurizations under cross-validation.
- A. Double Well Potential: The double-well experiment simulates one-dimensional Brownian dynamics and provides an exact propagator spectrum for evaluating MSM approximations.The slowest relaxation timescale is approximately 7115.3 steps, and the dataset contains about 94 transition events.
- A. Double Well Potential: The MSM state count balances low-state discretization error against overfitting because the number of estimated parameters scales as n^2.Five-fold GMRQ cross-validation is used to select the number of states.
- A. Double Well Potential: For m = 2 and τ = 100 steps, training and held-out GMRQ are compared with the exact GMRQ across state counts.The training curve scores models on the fitting trajectories, whereas the test curve scores them on left-out trajectories.
- A. Double Well Potential: Training GMRQ rises monotonically and exceeds the exact value above 200 states, while test GMRQ has an inverted-U shape and peaks at 61 states.The authors interpret the training-bound violation as overfitting and identify 61 states as best for predictive accuracy with the available data.
- A. Double Well Potential: The peptide study analyzes 27 octaalanine MD trajectories using eight state-construction methods and three clustering distance or algorithm choices.The methods vary clustering algorithms and featurizations, including DRID and backbone dihedral angles.
- A. Double Well Potential: The proposed GMRQ formulation provides a quantitative way to score MSM and tICA solutions on new data and choose their hyperparameters.The same framework can be extended to other basis-function families such as Gaussians.
- A. Double Well Potential: The framework compares these methods under five-fold cross-validation using the rank-6 GMRQ.Figure 2 reports mean training and held-out behavior with standard-error bars across folds.
A. Connections to quantum mechanics and machine learning
The paper connects its variational eigenspace objective to quantum-mechanical trace principles and Fisher discriminant analysis, while contrasting it with probabilistic modeling. These connections motivate quantitative model comparison and clarify that variational and likelihood-based views coincide only in restricted cases.
- Connections to quantum mechanics: The eigenspace variational theorem is analogous to the ensemble or trace variational principle used to optimize multiple quantum-mechanical eigenstates.The analogy is especially relevant when applications require simultaneous optimization of many eigenstates.
- Connections to machine learning: The method parallels multi-class Fisher discriminant analysis, whose generalized eigenproblem identifies low-rank projections maximizing between-class variance while controlling within-class variance.The shared structure may support regularized and sparse algorithms for identifying slow molecular eigenfunctions.
- Variational and probabilistic views: MSMs arise from maximizing the variational objective when eigenfunctions are constrained to orthogonal indicator functions, but molecular-kinetics models can also be treated as probabilistic trajectory models.The two perspectives therefore use different objective-function formulations for related modeling tasks.
- Variational and probabilistic views: The variational and probabilistic views need not be equivalent because the GMRQ-optimal slow-eigenspace model need not preserve positivity, which likelihood models require.They remain connected through error bounds: accurately approximating the slow eigenspace yields accurate long-timescale transition probabilities.
- Model comparison: Unlike log-likelihood cross-validation, GMRQ-based comparison does not require a high-dimensional generative model or reference-state decomposition, enabling quantitative comparison of dimensionality-reduction procedures.The approach was applied to eight MSM-construction protocols for octaalanine; k-means with dihedral angles and 50–200 states appeared to outperform alternatives, while k-centers was prone to poor generalization.
Appendix A: Proofs of Theorem 2 and Lemma 3
The appendix proves that the projection objective depends only on the subspace spanned by the ansatz functions, not on the particular basis used to represent that subspace. The proof establishes invariance under invertible linear transformations and identifies the maximizing eigenspace.
- Matrix representation: Each ansatz function is expanded in the propagator eigenfunction basis, producing a coefficient matrix W that represents the candidate subspace.The diagonal matrix D(λ) collects the propagator eigenvalues used in the matrix formulation.
- Variational bound: The proof introduces a positive-definite normalization and transforms the objective into a trace expression suitable for the Ky Fan theorem.The normalization enforces the required orthonormality relation for the transformed coefficient matrix.
- Variational bound: Equality is attained when the ansatz functions are the first m propagator eigenfunctions.Thus the variational optimum identifies the desired slow eigenspace, up to a rotation of its basis.
- Invariance: Replacing the ansatz functions by any invertible linear combination leaves the projection objective unchanged.The matrix proof expands the transformed coefficient matrix and uses cyclic trace invariance to recover the original objective.
- Invariance: The objective is therefore a functional of the spanned m-dimensional subspace, represented geometrically as a point on a Grassmann manifold.This is analogous to the invariance of a Ritz value under trial-vector rescaling.
Appendix B: Tension Between Spectral and Probabilistic Approaches
The appendix demonstrates that spectral optimality and probabilistic validity can diverge. A rank-m truncated propagator built from leading eigenpairs may produce negative propagated densities, so it need not define a valid probability model.
- Analytical example: The appendix constructs propagator eigenfunctions for a Brownian harmonic oscillator to compare variational and probabilistic molecular-dynamics models.The example uses the Ornstein–Uhlenbeck process with a quadratic potential and Hermite-function eigenmodes.
- Rank-m truncation: The propagator shares eigenfunctions with the generator, and its eigenvalues determine the rank-m truncation formed from the leading eigenpairs.The truncated operator is then applied to an initial distribution to test whether it preserves probability-density validity.
- Non-positivity: For m = 2, the explicit propagated expression has a zero and changes sign over part of the domain.The sign change depends on the initial position and identifies where non-positivity occurs.
- Non-positivity: The truncated propagator therefore fails to remain non-negative and does not represent a valid probability distribution.This conclusion is stated directly for the propagated density generated by the rank-2 example.
- Interpretation: A spectrally optimal rank-m model can receive log likelihood −∞ on observed transitions, showing that variational and probabilistic criteria may judge models almost contradictorily.The conflict arises because likelihood methods require positivity while spectral optimization does not guarantee it.
Appendix C: Double-well Potential Integrator and Eigenfunctions
The appendix discretizes reflected Brownian dynamics into MSM states and computes the transition matrix directly from one-step transition probabilities. Its eigenvalues are then equivalent to generalized eigenvalues obtained from correlation and overlap matrices.
- Integrator and boundaries: The stochastic differential equation is discretized with an Euler integrator under reflecting boundaries at −π and π.Out-of-range steps are reflected back into the interval by matching their distance from the boundary.
- Discretization: The interval is divided into n MSM states, and propagator eigenvalues are computed by constructing the transition matrix T directly.The reported calculations use n = 500, for which the eigenvalues of T converge rapidly as n increases.
- Eigenvalue calculation: The transition matrix satisfies T = S^-1C, so its eigenvalues equal the generalized eigenvalues of the correlation-overlap pair (C, S).This provides an equivalent route to the propagator spectrum without calculating C and S directly.
- Transition matrix: For each state pair, T_ij is obtained by summing one-step transition probabilities, including paths that leave the interval and are reflected back.The calculation represents each state by its left endpoint and accounts explicitly for reflected transitions.
Appendix D: Landmark UPGMA Clustering
The appendix applies landmark-based UPGMA clustering to reduce distance-computation costs while assigning both training and test points to clusters. The simulations used 26 trajectories totaling 1.74 µs of aggregate sampling.
- Landmark-based UPGMA subsamples l regularly spaced landmark points before hierarchical clustering into n clusters.The method avoids computing the full pairwise-distance matrix.
- Each remaining training point and each test point is assigned to the cluster whose landmarks have the smallest average distance.Assignments use the distance metric d(x, x′) and the landmark sets associated with each cluster.
- The production trajectories ranged from 20 to 150 ns, yielding 1.74 µs of total aggregate sampling.