particle.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:bayestsa 作者: thalesians 项目源码 文件源码
def __condjumpprobability(self, expstate, observation):
        # Note that scipy.stats.norm.pdf takes the standard deviation (rather
        # than variance) as one of its arguments
        if self.__params.jumpintensity < np.finfo(float).eps:
            return np.zeros(np.shape(expstate))
        if self.__oneminusjumpintensity < np.finfo(float).eps:
            return np.ones(np.shape(expstate))
        numerator = scipy.stats.norm.pdf(observation, 0., np.sqrt(expstate + self.__jumpvar)) * self.__params.jumpintensity
        denominator = numerator + scipy.stats.norm.pdf(observation, 0., np.sqrt(expstate)) * self.__oneminusjumpintensity
        return numerator / denominator
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号