moran_augmented.py 文件源码

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

项目:ldpop 作者: popgenmethods 项目源码 文件源码
def getUnlinkedStationary(self, popSize, theta):
        one_loc_probs = one_locus_probs(popSize=popSize, theta=theta, n=self.n)
        assertValidProbs(one_loc_probs)

        n = self.n
        leftOnes, rightOnes, bothOnes = self.numOnes(0), self.numOnes(1), self.hapCount((1,1))
        joint = one_loc_probs[leftOnes] * one_loc_probs[rightOnes]
        if self.exact:
            joint[self.numC > 0] = 0
        else:
            joint = joint * scipy.misc.comb(rightOnes, bothOnes) * scipy.misc.comb(n-rightOnes, leftOnes-bothOnes)  / scipy.misc.comb(n, leftOnes)

        joint = joint * self.n_unfolded_versions

        assertValidProbs(joint)  
        return joint
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号