scipy.special.erf — SciPy v1.15.2 Manual (original) (raw)
scipy.special.erf(z, out=None) = <ufunc 'erf'>#
Returns the error function of complex argument.
It is defined as 2/sqrt(pi)*integral(exp(-t**2), t=0..z)
.
Parameters:
xndarray
Input array.
outndarray, optional
Optional output array for the function values
Returns:
resscalar or ndarray
The values of the error function at the given points x.
Notes
The cumulative of the unit normal distribution is given byPhi(z) = 1/2[1 + erf(z/sqrt(2))]
.
References
Examples
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()