mars.tensor.special.erf#

mars.tensor.special.erf(x, out=None, where=None, **kwargs)[来源]#

返回复数参数的误差函数。

它被定义为 2/sqrt(pi)*integral(exp(-t**2), t=0..z).

Parameters

x (Tensor) – 输入张量。

Returns

res – 在给定点 x 的误差函数值。

Return type

张量

另请参阅

erfc, erfinv, erfcinv, wofz, erfcx, erfi

备注

单位正态分布的累积分布函数由以下公式给出 Phi(z) = 1/2[1 + erf(z/sqrt(2))].

参考文献

1

https://en.wikipedia.org/wiki/Error_function

2

Milton Abramowitz 和 Irene A. Stegun, 编者。 数学函数手册,包含公式、 图形和数学表格。纽约: Dover, 1972。 http://www.math.sfu.ca/~cbm/aands/page_297.htm

3

Steven G. Johnson, Faddeeva W函数实现。 http://ab-initio.mit.edu/Faddeeva

示例

>>> import mars.tensor as mt
>>> from mars.tensor import special
>>> import matplotlib.pyplot as plt
>>> x = mt.linspace(-3, 3)
>>> plt.plot(x, special.erf(x))
>>> plt.xlabel('$x$')
>>> plt.ylabel('$erf(x)$')
>>> plt.show()