coverage.py 文件源码

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

项目:ngsphy 作者: merlyescalona 项目源码 文件源码
def nbinom(self,samples):
        """
        Sampling from a Negative binomial distribution

        Parameters:
        mu= poissonon mean
        r controls the deviation from the poisson

        This makes the negative binomial distribution suitable as a robust
        alternative to the Poisson, which approaches the Poisson for large r,
        but which has larger variance than the Poisson for small r.
        ------------------------------------------------------------------------
        - samples: number of values that will be returned.
        """
        mu=float(self.__params[0])
        r=float(self.__params[1])
        p=(r*1.0)/(r+mu)
        distro=nbinom(r,p)
        f=distro.rvs(size=samples)
        return f
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号