Пример #1
0
    def pi(self, value):
        """The stationary distribution on the MSM states"""
        if value is None and self.P is not None:
            from msmtools.analysis import stationary_distribution as _statdist
            value = _statdist(self.P)
        elif self.P is not None:
            # check input
            # this only holds for a unique measure...
            try:
                test_unique = self.P.dot(value)
                _np.testing.assert_allclose(
                    test_unique,
                    value,
                    atol=1e-14,
                    rtol=0.01,
                    err_msg='given stationary distribution '
                    'is not a valid unique measure.')

            except AssertionError:
                pass
                # import logging
                # logger = logging.getLogger('pyemma.msm')
                # logger.exception("pi not valid/unique")
            # check sum is one
            _np.testing.assert_allclose(_np.sum(value), 1, atol=1e-14)
        self._pi = value
Пример #2
0
 def pi(self, value):
     if value is None and self.P is not None:
         from msmtools.analysis import stationary_distribution as _statdist
         value = _statdist(self.P)
     elif value is not None:
         # check sum is one
         _np.testing.assert_allclose(_np.sum(value), 1, atol=1e-14)
     self._pi = value
Пример #3
0
 def stationary_distribution(self):
     """The stationary distribution on the MSM states"""
     if self.pi is not None:
         return self.pi
     else:
         from msmtools.analysis import stationary_distribution as _statdist
         self.pi = _statdist(self.transition_matrix)
         return self.pi