scipy.special.erfinv#
- scipy.special.erfinv(y, out=None) = <ufunc 'erfinv'>#
Inverse der Fehlerfunktion.
Berechnet die Inverse der Fehlerfunktion.
Im komplexen Bereich gibt es keine eindeutige komplexe Zahl w, die erf(w)=z erfüllt. Dies deutet darauf hin, dass eine echte Umkehrfunktion mehrdeutig wäre. Wenn der Bereich auf reelle Zahlen eingeschränkt ist, -1 < x < 1, gibt es eine eindeutige reelle Zahl, die erf(erfinv(x)) = x erfüllt.
- Parameter:
- yndarray
Argument, an dem ausgewertet werden soll. Bereich: [-1, 1]
- outndarray, optional
Optionales Ausgabe-Array für die Funktionswerte
- Rückgabe:
- erfinvSkalar oder ndarray
Die Inverse von erf von y, elementweise
Siehe auch
Hinweise
Diese Funktion wrappt die
erf_invRoutine aus der Boost Math C++ Bibliothek [1].Referenzen
[1]The Boost Developers. “Boost C++ Libraries”. https://www.boost.org/.
Beispiele
>>> import numpy as np >>> import matplotlib.pyplot as plt >>> from scipy.special import erfinv, erf
>>> erfinv(0.5) 0.4769362762044699
>>> y = np.linspace(-1.0, 1.0, num=9) >>> x = erfinv(y) >>> x array([ -inf, -0.81341985, -0.47693628, -0.22531206, 0. , 0.22531206, 0.47693628, 0.81341985, inf])
Überprüfen Sie, ob
erf(erfinv(y))gleichyist.>>> erf(x) array([-1. , -0.75, -0.5 , -0.25, 0. , 0.25, 0.5 , 0.75, 1. ])
Plotten Sie die Funktion
>>> 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()