本文整理汇总了Python中component.Component.getSensibleInitSpread方法的典型用法代码示例。如果您正苦于以下问题:Python Component.getSensibleInitSpread方法的具体用法?Python Component.getSensibleInitSpread怎么用?Python Component.getSensibleInitSpread使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类component.Component
的用法示例。
在下文中一共展示了Component.getSensibleInitSpread方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getInitEmceePos
# 需要导入模块: from component import Component [as 别名]
# 或者: from component.Component import getSensibleInitSpread [as 别名]
def getInitEmceePos(self, nwalkers=None, init_pars=None):
if init_pars is None:
rough_mean_now, rough_cov_now = \
self.approxCurrentDayDistribution()
# Exploit the component logic to generate closest set of pars
dummy_comp = Component(mean=rough_mean_now,
covmatrix=rough_cov_now,
form=self.model_form)
init_pars = Component.internalisePars(dummy_comp.getPars())
init_std = Component.getSensibleInitSpread(form='sphere')
# Generate initial positions of all walkers by adding some random
# offset to `init_pars`
if nwalkers is None:
npars = len(init_pars)
nwalkers = 2 * npars
init_pos = emcee.utils.sample_ball(init_pars, init_std,
size=nwalkers)
# force ages to be positive
init_pos[:, -1] = abs(init_pos[:, -1])
return init_pos