pyclone.py 文件源码

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

项目:pgsm 作者: aroth85 项目源码 文件源码
def compute_log_p_sample(data, f, t):
    C = len(data.cn)

    population_prior = np.zeros(3)
    population_prior[0] = (1 - t)
    population_prior[1] = t * (1 - f)
    population_prior[2] = t * f

    ll = np.ones(C, dtype=np.float64) * np.inf * -1

    for c in range(C):
        e_vaf = 0

        norm_const = 0

        for i in range(3):
            e_cn = population_prior[i] * data.cn[c, i]

            e_vaf += e_cn * data.mu[c, i]

            norm_const += e_cn

        e_vaf /= norm_const

        ll[c] = data.log_pi[c] + binomial_log_pdf(data.a + data.b, data.b, e_vaf)

    return log_sum_exp(ll)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号