test_prior.py 文件源码

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

项目:enterprise 作者: nanograv 项目源码 文件源码
def test_truncnorm_prior(self):
        """check truncnorm RV"""
        msg = "truncnorm prior: incorrect test {0}"
        test_vals = [-0.1, 0.0, 0.5, 1.0, 1.1]
        mean, std, low, up = 0.9, 0.1, 0.0, 1.0
        a, b = (low - mean) / std, (up - mean) / std
        correct = truncnorm(loc=mean, scale=std, a=a, b=b)
        for ii, xx in enumerate(test_vals):
            assert self.gPrior.pdf(xx) == correct.pdf(xx), msg.format(ii)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号