scipy.special.erf#

scipy.special.erf(z, out=None) = <ufunc 'erf'>#

傳回複數引數的誤差函數。

其定義為 2/sqrt(pi)*integral(exp(-t**2), t=0..z)

參數:
xndarray

輸入陣列。

outndarray, optional

函數值的選用輸出陣列

傳回值:
res純量或 ndarray

在給定點 x 的誤差函數值。

另請參閱

erfc, erfinv, erfcinv, wofz, erfcx, erfi

註解

單位常態分佈的累積分布函數由 Phi(z) = 1/2[1 + erf(z/sqrt(2))] 給出。

參考文獻

[2]

Milton Abramowitz and Irene A. Stegun, eds. Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables. New York: Dover, 1972. http://www.math.sfu.ca/~cbm/aands/page_297.htm

[3]

Steven G. Johnson, Faddeeva W function implementation. http://ab-initio.mit.edu/Faddeeva

範例

>>> import numpy as np
>>> from scipy import special
>>> import matplotlib.pyplot as plt
>>> x = np.linspace(-3, 3)
>>> plt.plot(x, special.erf(x))
>>> plt.xlabel('$x$')
>>> plt.ylabel('$erf(x)$')
>>> plt.show()
../../_images/scipy-special-erf-1.png