Best way to write a Python function that integrates a gaussian?

前端 未结 5 1186
小鲜肉
小鲜肉 2021-02-04 18:48

In attempting to use scipy\'s quad method to integrate a gaussian (lets say there\'s a gaussian method named gauss), I was having problems passing needed parameters to gauss and

5条回答
  •  南笙
    南笙 (楼主)
    2021-02-04 19:21

    The gaussian distribution is also called a normal distribution. The cdf function in the scipy norm module does what you want.

    from scipy.stats import norm
    print norm.cdf(0.0)
    >>>0.5
    

    http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.norm.html#scipy.stats.norm

提交回复
热议问题