statis.py 文件源码

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

项目:Py-Utils 作者: LonamiWebs 项目源码 文件源码
def dpois(lmbda):
  """Poisson Distribution
     lmbda = average number of successes per unit interval

     Used to determine the probability of an amount of
     successes occuring in a fixed interval (time, area…)

     This doesn't return a value, but rather the specified Poisson function
  """
  def p(k):
    if 0 <= k:
      return (exp(-lmbda) * lmbda**k) / factorial(k)
    else:
      return 0

  # Allow accessing the used 'lmbda' value from the function
  p.__dict__['lmbda'] = lmbda
  p.__dict__['expected'] = lmbda
  p.__dict__['variance'] = lmbda
  return p
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号