scipy.special.erfcinv#
- scipy.special.erfcinv(y, out=None) = <ufunc 'erfcinv'>#
互补误差函数的逆函数。
计算互补误差函数的逆函数。
在复数域中,不存在满足 erfc(w)=z 的唯一复数 w。这意味着真正的逆函数将是多值的。当域限制为实数,0 < x < 2 时,存在满足 erfc(erfcinv(x)) = erfcinv(erfc(x)) 的唯一实数。
它通过 erfcinv(1-x) = erfinv(x) 与误差函数的逆函数相关。
- 参数:
- yndarray
要评估的参数。 范围:[0, 2]
- outndarray, 可选
函数值的可选输出数组
- 返回:
- erfcinv标量或 ndarray
y 的 erfc 的逆,按元素方式
示例
>>> import numpy as np >>> import matplotlib.pyplot as plt >>> from scipy.special import erfcinv
>>> erfcinv(0.5) 0.4769362762044699
>>> y = np.linspace(0.0, 2.0, num=11) >>> erfcinv(y) array([ inf, 0.9061938 , 0.59511608, 0.37080716, 0.17914345, -0. , -0.17914345, -0.37080716, -0.59511608, -0.9061938 , -inf])
绘制函数
>>> y = np.linspace(0, 2, 200) >>> fig, ax = plt.subplots() >>> ax.plot(y, erfcinv(y)) >>> ax.grid(True) >>> ax.set_xlabel('y') >>> ax.set_title('erfcinv(y)') >>> plt.show()