Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

Commit

Permalink
[msm/ui/msm] minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
marscher committed Jun 15, 2015
1 parent d65fb65 commit bdf98c9
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions pyemma/msm/ui/msm.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Copyright (c) 2015, 2014 Computational Molecular Biology Group, Free University
# Berlin, 14195 Berlin, Germany.
# All rights reserved.
Expand All @@ -22,7 +21,6 @@
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

r"""Implement a MSM class that builds a Markov state models from
microstate trajectories automatically computes important properties
and provides them for later access.
Expand All @@ -31,15 +29,13 @@
.. moduleauthor:: B. Trendelkamp-Schroer <benjamin DOT trendelkamp-schroer AT fu-berlin DOT de>
"""

__docformat__ = "restructuredtext en"

import numpy as np
from math import ceil
from pyemma.util.annotators import shortcut
from pyemma.util.log import getLogger


__docformat__ = "restructuredtext en"
__all__ = ['MSM', 'EstimatedMSM']

# TODO: Explain concept of an active set
Expand Down Expand Up @@ -304,7 +300,7 @@ def timescales(self, k=None, ncv=None):
-------
ts : ndarray(m)
relaxation timescales in units of the input trajectory time step,
defined by :math:`-tau / ln | \lambda_i |, i = 2,...,k+1`.
defined by :math:`-\tau / ln | \lambda_i |, i = 2,...,k+1`.
"""
neig = k
Expand Down Expand Up @@ -419,7 +415,7 @@ def correlation(self, a, b=None, maxtime=None, k=None, ncv=None):
neutron scattering [2]_, ...), first compute the mean values of your experimental observable :math:`a`
by MSM state:
.. :math:
.. math::
a_i = \frac{1}{N_i} \sum_{x_t \in S_i} f(x_t)
where :math:`S_i` is the set of configurations belonging to MSM state :math:`i` and :math:`f()` is a function
Expand Down Expand Up @@ -670,7 +666,8 @@ def fingerprint_relaxation(self, p0, a, k=None, ncv=None):
a : (n,) ndarray
Observable, represented as vector on state space
lag : int or int array
List of lag time or lag times (in units of the transition matrix lag time tau) at which to compute
List of lag time or lag times (in units of the transition matrix
lag time :math:`\tau`) at which to compute
correlation
k : int (optional)
Number of eigenvalues and eigenvectors to use for computation
Expand Down Expand Up @@ -1124,8 +1121,9 @@ def count_matrix_active(self):
"""The count matrix on the active set given the connectivity mode used.
For example, for connectivity='largest', the count matrix is given only on the largest reversibly connected set.
Attention: This count matrix has been obtained by sliding a window of length tau across the data. It contains
a factor of tau more counts than are statistically uncorrelated. It's fine to use this matrix for maximum
Attention: This count matrix has been obtained by sliding a window of
length :math:`\tau` across the data. It contains a factor of :math:`\tau` more
counts than are statistically uncorrelated. It's fine to use this matrix for maximum
likelihood estimated, but it will give far too small errors if you use it for uncertainty calculations. In order
to do uncertainty calculations, use the effective count matrix, see:
:meth:`effective_count_matrix`
Expand All @@ -1148,8 +1146,9 @@ def effective_count_matrix(self):
The effective count matrix is obtained by dividing the sliding-window count matrix by the lag time. This
can be shown to provide a likelihood that is the geometrical average over shifted subsamples of the trajectory,
:math:`(s_1,\:s_{tau+1},\:...),\:(s_2,\:t_{tau+2},\:...),` etc. This geometrical average converges to the
correct likelihood in the statistical limit _[1].
:math:`(s_1,\:s_{\tau+1},\:...),\:(s_2,\:t_{\tau+2},\:...),` etc.
This geometrical average converges to the correct likelihood in the
statistical limit _[1].
[1] Trendelkamp-Schroer B, H Wu, F Paul and F Noe. 2015:
Reversible Markov models of molecular kinetics: Estimation and uncertainty.
Expand Down Expand Up @@ -1396,7 +1395,8 @@ def sample_by_distributions(self, distributions, nsample):
distributions : list or array of ndarray ( (n) )
m distributions over states. Each distribution must be of length n and must sum up to 1.0
nsample : int
Number of samples per distribution. If replace = False, the number of returned samples per state could be smaller
Number of samples per distribution. If replace = False, the number
of returned samples per state could be smaller
if less than nsample indexes are available for a state.
Returns
Expand All @@ -1410,4 +1410,4 @@ def sample_by_distributions(self, distributions, nsample):
# generate connected state indexes
import pyemma.util.discrete_trajectories as dt

return dt.sample_indexes_by_distribution(self.active_state_indexes, distributions, nsample)
return dt.sample_indexes_by_distribution(self.active_state_indexes, distributions, nsample)

0 comments on commit bdf98c9

Please sign in to comment.