Skip to content

Commit 11d616b

Browse files
authored
Merge pull request #150 from markovmodel/revision-beh
First draft of a theory section
2 parents 12455c0 + e0ae567 commit 11d616b

File tree

2 files changed

+114
-16
lines changed

2 files changed

+114
-16
lines changed

manuscript/literature.bib

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
@article{husic2017note,
2+
title={Note: {MSM} lag time cannot be used for variational model selection},
3+
author={Husic, Brooke E and Pande, Vijay S},
4+
journal={J. Chem. Phys.},
5+
volume={147},
6+
number={17},
7+
pages={176101},
8+
year={2017},
9+
publisher={AIP Publishing}
10+
}
11+
112
@book{msm-book,
213
Title = {An Introduction to Markov State Models and Their Application to Long Timescale Molecular Simulation},
314
Publisher = {Springer Netherlands},

manuscript/manuscript.tex

Lines changed: 103 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,102 @@ \subsection{Scope}
7979

8080
\section{Prerequisites}
8181

82-
In the following, we summarize the recommended theoretical background knowledge of Markov state modeling for this tutorial.
82+
In the following, we summarize the recommended theory and background knowledge of Markov state modeling for this tutorial.
8383
Then, we address the software required to work through the lessons.
8484

85-
\subsection{Background knowledge}
85+
\subsection{Essential theory}
86+
\label{sec:theory}
87+
88+
Markov state modeling is a mathematical framework for the analysis of time-series data, often but not limited to high-dimensional MD simulation datasets.
89+
In its standard formulation, the creation of a Markov state model involves decomposing the phase or configuration space occupied by a system into a set of disjoint, discrete states that adhere to the Markov property.
90+
The Markov property asserts that the dynamics in the state space is ``memoryless'':~in other words, the probability of transitioning from any state $i$ to any other state $j$ after a time $\tau$ is independent of the history of the system before it was in $i$.
91+
%This lag time must be sufficiently short to resolve the dynamics of interest, but long enough such that the Markovian approximation is appropriate.
92+
93+
In order to create a Markov state model for a dynamical system, each data point in the time series is assigned to a state.
94+
Given an appropriate lag time, every pairwise transition at that lag time is counted and stored in a count matrix.
95+
Then, the count matrix is converted to a row-stochastic transition probability matrix, which is defined for the specified lag time.
96+
To ensure that the transition probability matrix has desirable mathematical properties, detailed balance is enforced when converting the count matrix to the transition probability matrix, which requires that,
97+
98+
\begin{equation}
99+
\label{eq:balance}
100+
p_t(i) p(i \rightarrow j) = p_t(j)p(j \rightarrow i),
101+
\end{equation}
102+
103+
\noindent{}where $p_t(i)$ represents the probability of being in state $i$ at time $t$, and $p(i \rightarrow j)$ is the probability of transitioning from state $i$ to $j$ at the next time step.
104+
% Detailed balance requires that the probability of transitioning from state $i$ to state $j$, conditioned upon the system being in state $i$, is the same as the probability of transitioning from state $j$ to state $i$ conditioned upon the system being in state $j$.
105+
The requirement of detailed balance indicates that we assume our system is reversible.
106+
We additionally require that the system is ergodic, which means that every state is accessible from every other state.
107+
108+
When estimating an MSM it is critical to choose a lag time, $\tau$, which is long enough to ensure Markovian dynamics in our state space, but short enough to resolve the dynamics in which we are interested.
109+
Plotting the implied timescales (ITS) as a function of $\tau$ can be a helpful diagnostic when selecting the MSM lag time~\cite{swope-its}.
110+
The ITS $t_i$ approximates the decorrelation time of the $i^\textrm{th}$ process and is computed from the eigenvalues $\lambda_i$ of the MSM transition matrix via,
111+
\begin{equation}
112+
\label{eq:its}
113+
t_i = \frac{-\tau}{\ln\left|\lambda_i(\tau)\right|}.
114+
\end{equation}
115+
116+
\noindent{}When the ITS become approximately constant with the lag time, we say that our timescales have converged and choose the smallest lag time with the converged timescales in order to maximize the model's temporal resolution.
117+
118+
Once we have used the ITS to choose the lag time, we can check whether a given transition probability matrix $T(\tau)$ is approximately Markovian using the Chapman-Kolmogorov (CK) test~\cite{msm-jhp}.
119+
The CK property for a Markovian matrix is,
120+
121+
\begin{equation}
122+
T(k \tau) = T^k(\tau),
123+
\end{equation}
124+
125+
\noindent{}where the left-hand side of the equation corresponds to an MSM estimated at lag time $k\tau$, where $k$ is an integer larger than 1, whereas the right-hand side of the equation is our estimated MSM transition probability matrix to the $k^\textrm{th}$ power.
126+
By assessing how well the approximated transition probability matrix adheres to the CK property, we can validate the appropriateness of the Markovian assumption for the model.
127+
128+
Once validated, the transition matrix can be decomposed into eigenvectors and eigenvalues,
129+
130+
\begin{equation}
131+
\label{eq:transmat}
132+
T(\tau) \circ \phi_i = \lambda_i \phi_i,
133+
\end{equation}
134+
135+
\noindent{}where the eigenvalues are indexed in decreasing order. The highest eigenvalue, $\lambda_1$, is unique and is equal to $1$, and its corresponding left eigenvector $\phi_1$ corresponds to the stationary distribution of the system.
136+
The right eigenvector $\psi_1$ is a vector consisting of $1$'s.
137+
The subsequent eigenvalues $\lambda_{i>1}$ are real with absolute values less than $1$ and correspond to dynamical processes within the system.
138+
The right eigenvectors $\psi_i$ each represent a dynamical process (for $i>1$), and the coefficients of the eigenvectors represent the flux into and out of the MSM states that characterizes that process.
139+
The corresponding left eigenvectors $\phi_i$ contain the same information weighted by the stationary distribution.
140+
141+
The timescale of a given dynamical process is a function of the relevant eigenvalue and the lag time at which the model was defined,
142+
143+
\begin{equation}
144+
\label{eq:timescales}
145+
t_i \equiv -\frac{\tau}{\log(|\lambda_i|)}.
146+
\end{equation}
147+
148+
\subsection{MSM construction the variational approach}
149+
\label{sec:construction}
150+
151+
The theory described in the previous section required the decomposition of the phase or configuration space occupied by a dynamical system into discrete, disjoint states.
152+
Starting from the output of an MD simulation of a protein, there are several steps that can be taken to obtain an MSM from the original configuration space:
153+
154+
\begin{itemize}
155+
\item Featurization -- The Cartesian coordinates characterizing each frame of the MD trajectory are transformed into an intuitive basis such as the protein's dihedral angles or contact distance pairs.
156+
\item Dimensionality reduction -- Optionally, a basis set transformation can be performed that produces a linear (or nonlinear) combination of the features in the previous step.
157+
Frequently, time-lagged independent component analysis (TICA)~\cite{tica,tica3,tica2,kinetic-maps} is used to transform the features into a set of slow coordinates.
158+
\item Clustering -- This is the step at which the state decomposition occurs.
159+
The features or TICs are grouped into a set of states using a clustering algorithm such as $k$-means.
160+
\item Transition matrix approximation -- At this stage, transitions are counted at a pre-specified lag time, and the estimation and validation described in the previous section are performed.
161+
\end{itemize}
162+
163+
It is apparent that there are many choices involved in MSM construction such as what features should be used and how many states should be chosen.
164+
In 2013, the variational approach to conformational dynamics (VAC) was derived, which enabled an objective comparison among different state decomposition choices for models built with the same Markovian lag time~\cite{noe-vac}.
165+
More recently, the more general variational approach to Markov processes (VAMP) has been developed in order to facilitate the approximation and comparison of reversible models for basis sets that are continuous, as opposed to discrete states~\cite{vamp-preprint}.
166+
The VAMP can thus be used to perform model selection.
167+
Specifically, we use the VAMP-2 score, which captures the kinetic variance explained by the model.
168+
However, the MSM lag time cannot be optimized using VAMP, and must be chosen using a separate validation as described above~\cite{husic2017note}.
169+
170+
\subsection{Background knowledge and resources}
86171
\label{sec:background}
87172

88-
For those unfamiliar with Markov state modeling, ``\emph{Markov State Models: From an Art to a Science}''~\cite{msm-brooke} provides a recent overview, while ``\emph{Markov models of molecular kinetics: Generation and validation}''~\cite{msm-jhp} describes the basic MSM theory and methodology in detail. Additionally, two textbooks exist that focus on computational methods and applications~\cite{msm-book} and mathematical theory~\cite{schuette-sarich-book}.
173+
For those seeking further resources, ``\emph{Markov State Models: From an Art to a Science}''~\cite{msm-brooke} provides a recent overview, while ``\emph{Markov models of molecular kinetics: Generation and validation}''~\cite{msm-jhp} describes the basic MSM theory and methodology in detail.
174+
Additionally, two textbooks exist that focus on computational methods and applications~\cite{msm-book} and mathematical theory~\cite{schuette-sarich-book}.
89175

90176
In addition to publications on theory and application of Markov state modeling~\cite{schuette-msm,buchete-msm-2008,noe-tmat-sampling,bowman-msm-2009,noe-folding-pathways,sarich-msm-quality,noe-fingerprints,noe-dy-neut-scatt,Chodera2014,ben-rev-msm,simon-mech-mod-nmr,oom-feliks,simon-amm},
91-
we also recommend the literature on time-lagged independent component analysis (TICA)~\cite{tica,tica3,tica2,kinetic-maps}, transition path theory (TPT)~\cite{weinan-tpt,metzner-msm-tpt},
177+
we also recommend the literature on TICA~\cite{tica,tica3,tica2,kinetic-maps}, transition path theory (TPT)~\cite{weinan-tpt,metzner-msm-tpt},
92178
hidden Markov state models (HMMs)~\cite{noe-proj-hid-msm,hmm-baum-welch-alg,hmm-tutorial}, and variational techniques~\cite{noe-vac,vamp-preprint,gmrq}, as these topics play important roles within the standard MSM workflow.
93179

94180
\subsection{Software/system requirements}
@@ -189,21 +275,22 @@ \subsection{Discretization}
189275
TICA yields a representation of our molecular simulation data with a reduced dimensionality, which can greatly facilitate the decomposition of our system into the discrete Markovian states necessary for MSM estimation. Here, we use the $k$-means algorithm to segment the four dimensional TICA space into $k=75$ cluster centers. The number of cluster centers has been chosen to optimize the VAMP-2 score in a manner identical to how the feature selection was carried out above, which is shown in the showcase notebook (00).
190276

191277
\subsection{MSM estimation and validation}
192-
When estimating an MSM it is critical to choose a lag time, $\tau$, which is long enough to ensure Markovian dynamics in our reduced space, but short enough to resolve the dynamics in which we are interested.
193-
Plotting the implied timescales (ITS) as a function of $\tau$ can be a helpful diagnostic when selecting the MSM lag time~\cite{swope-its}. The ITS $t_i$ approximates the decorrelation time of the $i^\textrm{th}$ process and is computed from the eigenvalues $\lambda_i$ of the MSM transition matrix via
194-
\begin{equation}
195-
\label{eq:its}
196-
t_i = \frac{-\tau}{\ln\left|\lambda_i(\tau)\right|}.
197-
\end{equation}
278+
% When estimating an MSM it is critical to choose a lag time, $\tau$, which is long enough to ensure Markovian dynamics in our reduced space, but short enough to resolve the dynamics in which we are interested.
279+
% Plotting the implied timescales (ITS) as a function of $\tau$ can be a helpful diagnostic when selecting the MSM lag time~\cite{swope-its}. The ITS $t_i$ approximates the decorrelation time of the $i^\textrm{th}$ process and is computed from the eigenvalues $\lambda_i$ of the MSM transition matrix via
280+
% \begin{equation}
281+
% \label{eq:its}
282+
% t_i = \frac{-\tau}{\ln\left|\lambda_i(\tau)\right|}.
283+
% \end{equation}
198284
A necessary condition for Markovian dynamics in our reduced space is that the ITS are approximately constant as a function of $\tau$; accordingly, we chose the smallest possible $\tau$ which fulfills this condition within the model uncertainty. The uncertainty bounds are computed using a Bayesian scheme~\cite{ben-rev-msm,noe-tmat-sampling} with $100$ samples.
199285
In our example, we find that the four slowest ITS converge quickly and are constant within a $95\%$ confidence interval for lag times above $0.5$~ns (Fig.~\ref{fig:io-to-ck}e). Using this lag time we can now estimate a (Bayesian) MSM with $\tau=0.5$~ns.
200286

201-
To test the validity of our MSM we perform a Chapman-Kolmogorov (CK) test. The CK test compares the right and the left side of the Chapman-Kolmogorov equation
202-
\begin{equation}
203-
\label{eq:ck}
204-
T(k \tau) = T^k(\tau)
205-
\end{equation}
206-
where $T$ is the MSM transition matrix. The left-hand side of the equation corresponds to an MSM estimated at lag time $k\tau$, where $k$ is an integer larger than 1, whereas the right-hand side of the equation is our estimated MSM to the $k^\textrm{th}$ power.
287+
To test the validity of our MSM we perform a Chapman-Kolmogorov (CK) test.
288+
% The CK test compares the right and the left side of the Chapman-Kolmogorov equation
289+
% \begin{equation}
290+
% \label{eq:ck}
291+
% T(k \tau) = T^k(\tau)
292+
% \end{equation}
293+
% where $T$ is the MSM transition matrix. The left-hand side of the equation corresponds to an MSM estimated at lag time $k\tau$, where $k$ is an integer larger than 1, whereas the right-hand side of the equation is our estimated MSM to the $k^\textrm{th}$ power.
207294
Visualizing the full transition probability matrix $T$ is difficult; we therefore coarse-grain $T$ into a smaller number of metastable states before performing the test.
208295
An appropriate number of metastable states can be chosen by identifying a relatively large gap in the ITS plot.
209296
For this analysis, we chose 5 metastable states.

0 commit comments

Comments
 (0)