本文整理汇总了Python中msmbuilder.msm.MarkovStateModel.populations_方法的典型用法代码示例。如果您正苦于以下问题:Python MarkovStateModel.populations_方法的具体用法?Python MarkovStateModel.populations_怎么用?Python MarkovStateModel.populations_使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类msmbuilder.msm.MarkovStateModel
的用法示例。
在下文中一共展示了MarkovStateModel.populations_方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_mfpt2
# 需要导入模块: from msmbuilder.msm import MarkovStateModel [as 别名]
# 或者: from msmbuilder.msm.MarkovStateModel import populations_ [as 别名]
def test_mfpt2():
tprob = np.array([[0.90, 0.10],
[0.22, 0.78]])
pi0 = 1
pi1 = pi0 * tprob[0, 1] / tprob[1, 0]
pops = np.array([pi0, pi1]) / (pi0 + pi1)
msm = MarkovStateModel(lag_time=1)
msm.transmat_ = tprob
msm.n_states_ = 2
msm.populations_ = pops
mfpts = np.vstack([tpt.mfpts(msm, i) for i in range(2)]).T
# since it's a 2x2 the mfpt from 0 -> 1 is the
# same as the escape time of 0
npt.assert_almost_equal(1 / (1 - tprob[0, 0]), mfpts[0, 1])
npt.assert_almost_equal(1 / (1 - tprob[1, 1]), mfpts[1, 0])