如何计算累积正态分布? [英] How to calculate cumulative normal distribution?

查看:383
本文介绍了如何计算累积正态分布?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找Numpy或Scipy(或任何严格的Python库)中的函数,该函数将为我提供Python中的累积正态分布函数.

I am looking for a function in Numpy or Scipy (or any rigorous Python library) that will give me the cumulative normal distribution function in Python.

推荐答案

下面是一个示例:

>>> from scipy.stats import norm
>>> norm.cdf(1.96)
0.9750021048517795
>>> norm.cdf(-1.96)
0.024997895148220435

换句话说,大约95%的标准正态区间位于两个标准差之内,以标准均值为零为中心.

In other words, approximately 95% of the standard normal interval lies within two standard deviations, centered on a standard mean of zero.

如果需要逆CDF:

>>> norm.ppf(norm.cdf(1.96))
array(1.9599999999999991)

这篇关于如何计算累积正态分布?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆