当前位置: 首页>>代码示例>>Python>>正文


Python MBAR.computeEffectiveSampleNumber方法代码示例

本文整理汇总了Python中pymbar.MBAR.computeEffectiveSampleNumber方法的典型用法代码示例。如果您正苦于以下问题:Python MBAR.computeEffectiveSampleNumber方法的具体用法?Python MBAR.computeEffectiveSampleNumber怎么用?Python MBAR.computeEffectiveSampleNumber使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pymbar.MBAR的用法示例。


在下文中一共展示了MBAR.computeEffectiveSampleNumber方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_mbar_computeEffectiveSampleNumber

# 需要导入模块: from pymbar import MBAR [as 别名]
# 或者: from pymbar.MBAR import computeEffectiveSampleNumber [as 别名]
def test_mbar_computeEffectiveSampleNumber():
    """ testing computeEffectiveSampleNumber """

    for system_generator in system_generators:
        name, test = system_generator()
        x_n, u_kn, N_k_output, s_n = test.sample(N_k, mode='u_kn')
        eq(N_k, N_k_output)
        mbar = MBAR(u_kn, N_k)

        # one mathematical effective sample numbers should be between N_k and sum_k N_k
        N_eff = mbar.computeEffectiveSampleNumber()
        sumN = np.sum(N_k)
        assert all(N_eff > N_k)
        assert all(N_eff < sumN)
开发者ID:jpthompson17,项目名称:pymbar,代码行数:16,代码来源:test_mbar.py

示例2: sqrt

# 需要导入模块: from pymbar import MBAR [as 别名]
# 或者: from pymbar.MBAR import computeEffectiveSampleNumber [as 别名]
    print "looks like it is."
  else:
    print "but it's not."

print "Overlap eigenvalue output"
print O_i


print "Overlap scalar output"
print O

print "============================================"
print "    Testing computeEffectiveSampleNumber    "
print "============================================"

N_eff = mbar.computeEffectiveSampleNumber(verbose = True)
print "Effective Sample number"
print N_eff
print "Compare stanadrd estimate of <x> with the MBAR estimate of <x>"
print "We should have that with MBAR, err_MBAR = sqrt(N_k/N_eff)*err_standard,"
print "so standard (scaled) results should be very close to MBAR results."
print "No standard estimate exists for states that are not sampled."
A_kn = x_kn
(val_mbar, err_mbar) = mbar.computeExpectations(A_kn)
err_standard = numpy.zeros([K],dtype = numpy.float64)
err_scaled = numpy.zeros([K],dtype = numpy.float64)

for k in range(K):
  if N_k[k] != 0:
    # use position
    err_standard[k] = numpy.std(A_kn[k,0:N_k[k]])/numpy.sqrt(N_k[k]-1)
开发者ID:BioinformaticsArchive,项目名称:pymbar,代码行数:33,代码来源:harmonic-oscillators.py


注:本文中的pymbar.MBAR.computeEffectiveSampleNumber方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。