logit_rules.py 文件源码

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

项目:mitre 作者: gerberlab 项目源码 文件源码
def prior_contribution_coefficients(self, state):
        """ Calculate prior contribution from regression coefficients.

        Log scale.

        """
        # This will need to be revised if we allow different 
        # variances for different classes of coefficients, eg 
        # microbiome related and host-covariate related
        dimensions = len(state.beta)
        normalization = -0.5*dimensions*(
            np.log(2.0*np.pi*self.prior_coefficient_variance) 
        )
        exponent = (-0.5*np.dot(state.beta, state.beta) / 
                     (self.prior_coefficient_variance))

        return normalization + exponent
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号