我需要计算问题的互补误差函数(erfc^(1))的逆。
我正在研究它的Python工具,许多线程都说Enthought拥有所需的大多数数学工具,所以我将其下载并安装在我的本地用户帐户中。但是我不太确定如何使用它?
有什么想法吗?
发布于 2009-07-29 21:05:18
包含在Enthought Python发行版中的SciPy包含该special function。
In [1]: from scipy.special import erfcinv
In [2]: from numpy import linspace
In [3]: x = linspace(0, 1, 10)
In [4]: y = erfcinv(x)
In [5]: y
Out[5]:
array([ 1.27116101e+308, 1.12657583e+000, 8.63123068e-001,
6.84070350e-001, 5.40731396e-001, 4.16808192e-001,
3.04570194e-001, 1.99556951e-001, 9.87900997e-002,
0.00000000e+000])发布于 2009-07-29 21:16:12
下面是一个使用互补误差函数(erfcinv)的逆的计算的快速示例,该函数包含在EPD附带的SciPy软件包中:
C:\>c:\Python25\python
EPD Py25 (4.1.30101) -- http://www.enthought.com/epd
Python 2.5.2 |EPD Py25 4.1.30101| (r252:60911, Dec 19 2008, 13:49:12) [MSC v.131
0 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from scipy.special import erfcinv
>>> erfcinv(0.)
1.271161006153646e+308
>>> erfcinv(1.)
0.0
>>> erfcinv(2.)
-1.271161006153646e+308
>>> exit()
C:\>https://stackoverflow.com/questions/1202967
复制相似问题