本文整理汇总了Python中msmbuilder.msm.ContinuousTimeMSM.uncertainty_K方法的典型用法代码示例。如果您正苦于以下问题:Python ContinuousTimeMSM.uncertainty_K方法的具体用法?Python ContinuousTimeMSM.uncertainty_K怎么用?Python ContinuousTimeMSM.uncertainty_K使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类msmbuilder.msm.ContinuousTimeMSM
的用法示例。
在下文中一共展示了ContinuousTimeMSM.uncertainty_K方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_uncertainties_backward
# 需要导入模块: from msmbuilder.msm import ContinuousTimeMSM [as 别名]
# 或者: from msmbuilder.msm.ContinuousTimeMSM import uncertainty_K [as 别名]
def test_uncertainties_backward():
n = 4
grid = NDGrid(n_bins_per_feature=n, min=-np.pi, max=np.pi)
trajs = DoubleWell(random_state=0).get_cached().trajectories
seqs = grid.fit_transform(trajs)
model = ContinuousTimeMSM(verbose=False).fit(seqs)
sigma_ts = model.uncertainty_timescales()
sigma_lambda = model.uncertainty_eigenvalues()
sigma_pi = model.uncertainty_pi()
sigma_K = model.uncertainty_K()
yield lambda: np.testing.assert_array_almost_equal(
sigma_ts, [9.508936, 0.124428, 0.117638])
yield lambda: np.testing.assert_array_almost_equal(
sigma_lambda,
[1.76569687e-19, 7.14216858e-05, 3.31210649e-04, 3.55556718e-04])
yield lambda: np.testing.assert_array_almost_equal(
sigma_pi, [0.007496, 0.006564, 0.006348, 0.007863])
yield lambda: np.testing.assert_array_almost_equal(
sigma_K,
[[0.000339, 0.000339, 0., 0.],
[0.000352, 0.000372, 0.000122, 0.],
[0., 0.000103, 0.000344, 0.000329],
[0., 0., 0.00029, 0.00029]])
yield lambda: np.testing.assert_array_almost_equal(
model.ratemat_,
[[-0.0254, 0.0254, 0., 0.],
[0.02636, -0.029629, 0.003269, 0.],
[0., 0.002764, -0.030085, 0.027321],
[0., 0., 0.024098, -0.024098]])
示例2: test_uncertainties_backward
# 需要导入模块: from msmbuilder.msm import ContinuousTimeMSM [as 别名]
# 或者: from msmbuilder.msm.ContinuousTimeMSM import uncertainty_K [as 别名]
def test_uncertainties_backward():
n = 4
grid = NDGrid(n_bins_per_feature=n, min=-np.pi, max=np.pi)
seqs = grid.fit_transform(load_doublewell(random_state=0)['trajectories'])
model = ContinuousTimeMSM(verbose=False).fit(seqs)
sigma_ts = model.uncertainty_timescales()
sigma_lambda = model.uncertainty_eigenvalues()
sigma_pi = model.uncertainty_pi()
sigma_K = model.uncertainty_K()
yield lambda: np.testing.assert_array_almost_equal(
sigma_ts, [9.13698928, 0.12415533, 0.11713719])
yield lambda: np.testing.assert_array_almost_equal(
sigma_lambda, [1.76569687e-19, 7.14216858e-05, 3.31210649e-04, 3.55556718e-04])
yield lambda: np.testing.assert_array_almost_equal(
sigma_pi, [0.00741467, 0.00647945, 0.00626743, 0.00777847])
yield lambda: np.testing.assert_array_almost_equal(
sigma_K,
[[ 3.39252419e-04, 3.39246173e-04, 0.00000000e+00, 1.62090239e-06],
[ 3.52062861e-04, 3.73305510e-04, 1.24093936e-04, 0.00000000e+00],
[ 0.00000000e+00, 1.04708186e-04, 3.45098923e-04, 3.28820213e-04],
[ 1.25455972e-06, 0.00000000e+00, 2.90118599e-04, 2.90122944e-04]])
yield lambda: np.testing.assert_array_almost_equal(
model.ratemat_,
[[ -2.54439564e-02, 2.54431791e-02, 0.00000000e+00, 7.77248586e-07],
[ 2.64044208e-02,-2.97630373e-02, 3.35861646e-03, 0.00000000e+00],
[ 0.00000000e+00, 2.83988103e-03, -3.01998380e-02, 2.73599570e-02],
[ 6.01581838e-07, 0.00000000e+00, 2.41326592e-02, -2.41332608e-02]])
示例3: test_hessian
# 需要导入模块: from msmbuilder.msm import ContinuousTimeMSM [as 别名]
# 或者: from msmbuilder.msm.ContinuousTimeMSM import uncertainty_K [as 别名]
def test_hessian():
grid = NDGrid(n_bins_per_feature=10, min=-np.pi, max=np.pi)
seqs = grid.fit_transform(load_doublewell(random_state=0)['trajectories'])
seqs = [seqs[i] for i in range(10)]
lag_time = 10
model = ContinuousTimeMSM(verbose=True, lag_time=lag_time)
model.fit(seqs)
msm = MarkovStateModel(verbose=False, lag_time=lag_time)
print(model.summarize())
print('MSM timescales\n', msm.fit(seqs).timescales_)
print('Uncertainty K\n', model.uncertainty_K())
print('Uncertainty pi\n', model.uncertainty_pi())
示例4: test_hessian_3
# 需要导入模块: from msmbuilder.msm import ContinuousTimeMSM [as 别名]
# 或者: from msmbuilder.msm.ContinuousTimeMSM import uncertainty_K [as 别名]
def test_hessian_3():
grid = NDGrid(n_bins_per_feature=4, min=-np.pi, max=np.pi)
trajs = DoubleWell(random_state=0).get_cached().trajectories
seqs = grid.fit_transform(trajs)
seqs = [seqs[i] for i in range(10)]
lag_time = 10
model = ContinuousTimeMSM(verbose=False, lag_time=lag_time)
model.fit(seqs)
msm = MarkovStateModel(verbose=False, lag_time=lag_time)
print(model.summarize())
# print('MSM timescales\n', msm.fit(seqs).timescales_)
print('Uncertainty K\n', model.uncertainty_K())
print('Uncertainty eigs\n', model.uncertainty_eigenvalues())