Implied TimescalesΒΆ

implied-timescales_evaluated
In [1]:
import numpy as np
import matplotlib.pyplot as pp
from msmbuilder.example_datasets import fetch_alanine_dipeptide
from msmbuilder.cluster import KCenters
from msmbuilder.msm import ContinuousTimeMSM, MarkovStateModel
from msmbuilder.msm import implied_timescales
In [2]:
trajectories = fetch_alanine_dipeptide()['trajectories']
heavy_inds = trajectories[0].topology.select_atom_indices('heavy')
trajectories = [t.atom_slice(heavy_inds) for t in trajectories]
In [3]:
cluster = KCenters(metric='rmsd', n_clusters=25)
sequences = cluster.fit_transform(trajectories)
print(cluster.summarize())
KCenters clustering
--------------------
n_clusters : 25
metric     : rmsd

Inertia       : 2765.506017502143
Mean distance : 0.027655336728388717
Max  distance : 0.04516218787804592


In [4]:
lag_times = [1, 4, 8, 12]
n_timescales = 10
In [5]:
msm_timescales = implied_timescales(sequences, lag_times, n_timescales=n_timescales, msm=MarkovStateModel(verbose=False))
for i in range(n_timescales):
   pp.plot(lag_times, msm_timescales[:, i], 'o-')

pp.title('Discrete-time MSM Relaxation Timescales')
pp.semilogy()
pp.show()
In [6]:
ctmsm_timescales = implied_timescales(sequences, lag_times, n_timescales=n_timescales, msm=ContinuousTimeMSM(verbose=True))
for i in range(n_timescales):
   pp.plot(lag_times, ctmsm_timescales[:, i], 'o-')

pp.title('Continuous-Time MSM Relaxation Timescales')
pp.semilogy()
pp.show()
/Users/rmcgibbo/miniconda/envs/3.4.2/lib/python3.4/site-packages/msmbuilder-3.1.0-py3.4-macosx-10.5-x86_64.egg/msmbuilder/utils/param_sweep.py:55: ExperimentalWarning: 
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Warning: 'ContinuousTimeMSM' is in an experimental state.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  model.fit(sequences)
/Users/rmcgibbo/miniconda/envs/3.4.2/lib/python3.4/site-packages/msmbuilder-3.1.0-py3.4-macosx-10.5-x86_64.egg/msmbuilder/utils/param_sweep.py:55: ExperimentalWarning: 
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Warning: 'ContinuousTimeMSM' is in an experimental state.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  model.fit(sequences)

MSM contains 1 strongly connected component above weight=1.00. Component 0 selected, with population 100.000000%
MSM contains 1 strongly connected component above weight=1.00. Component 0 selected, with population 100.000000%
MSM contains 1 strongly connected component above weight=1.00. Component 0 selected, with population 100.000000%
/Users/rmcgibbo/miniconda/envs/3.4.2/lib/python3.4/site-packages/msmbuilder-3.1.0-py3.4-macosx-10.5-x86_64.egg/msmbuilder/utils/param_sweep.py:55: ExperimentalWarning: 
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Warning: 'ContinuousTimeMSM' is in an experimental state.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  model.fit(sequences)
/Users/rmcgibbo/miniconda/envs/3.4.2/lib/python3.4/site-packages/msmbuilder-3.1.0-py3.4-macosx-10.5-x86_64.egg/msmbuilder/utils/param_sweep.py:55: ExperimentalWarning: 
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Warning: 'ContinuousTimeMSM' is in an experimental state.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  model.fit(sequences)


MSM contains 1 strongly connected component above weight=1.00. Component 0 selected, with population 100.000000%

(implied-timescales.ipynb; implied-timescales_evaluated.ipynb; implied-timescales.py)

Versions