scipy.special.erfcinv#
- scipy.special.erfcinv(y, out=None) = <ufunc 'erfcinv'>#
互補誤差函數的反函數。
計算互補誤差函數的反函數。
在複數域中,沒有唯一的複數 w 滿足 erfc(w)=z。這表示真正的反函數將是多值的。當域限制為實數,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()