scipy.special.erfinv#

scipy.special.erfinv(y, out=None) = <ufunc 'erfinv'>#

Inverse of the error function.

Computes the inverse of the error function.

In the complex domain, there is no unique complex number w satisfying erf(w)=z. This indicates a true inverse function would be multivalued. When the domain restricts to the real, -1 < x < 1, there is a unique real number satisfying erf(erfinv(x)) = x.

Parameters:
yndarray

Argument at which to evaluate. Domain: [-1, 1]

outndarray, optional

Optional output array for the function values

Returns:
erfinvscalar or ndarray

The inverse of erf of y, element-wise)

See also

erf

Error function of a complex argument

erfc

Complementary error function, 1 - erf(x)

erfcinv

Inverse of the complementary error function

Examples

>>> import numpy as np
>>> import matplotlib.pyplot as plt
>>> from scipy.special import erfinv
>>> erfinv(0.5)
0.4769362762044699
>>> y = np.linspace(-1.0, 1.0, num=10)
>>> erfinv(y)
array([       -inf, -0.86312307, -0.5407314 , -0.30457019, -0.0987901 ,
        0.0987901 ,  0.30457019,  0.5407314 ,  0.86312307,         inf])

Plot the function:

>>> y = np.linspace(-1, 1, 200)
>>> fig, ax = plt.subplots()
>>> ax.plot(y, erfinv(y))
>>> ax.grid(True)
>>> ax.set_xlabel('y')
>>> ax.set_title('erfinv(y)')
>>> plt.show()
../../_images/scipy-special-erfinv-1.png