DiagGaussObsModel.py 文件源码

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

项目:bnpy 作者: bnpy 项目源码 文件源码
def c_Diff(nu1, beta1, m1, kappa1,
           nu2, beta2, m2, kappa2):
    ''' Evaluate difference of cumulant functions c(params1) - c(params2)

    May be more numerically stable than directly using c_Func
    to find the difference.

    Returns
    -------
    diff : scalar real value of the difference in cumulant functions
    '''
    cDiff = - 0.5 * LOGTWO * (nu1 - nu2) \
        - gammaln(0.5 * nu1) + gammaln(0.5 * nu2) \
        + 0.5 * (np.log(kappa1) - np.log(kappa2)) \
        + 0.5 * (nu1 * np.log(beta1) - nu2 * np.log(beta2))
    return np.sum(cDiff)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号