Fehlerfunktion

Dieser Artikel behandelt die Gaußsche Fehlerfunktion, zur Fehlerfunktion in der Approximationstheorie, welche die Differenz zwischen einer Funktion und ihrer besten Approximation beschreibt, siehe Approximationstheorie und Verlustfunktion (Statistik).
Graph der Fehlerfunktion

Als Fehlerfunktion oder Gaußsche Fehlerfunktion bezeichnet man in der Theorie der speziellen Funktionen die durch das Integral

erf ( x ) = 2 π 0 x e t 2 d t {\displaystyle \operatorname {erf} (x)={\frac {2}{\sqrt {\pi }}}\int _{0}^{x}e^{-t^{2}}\,\mathrm {d} t}

definierte Funktion.[1] Damit ist die Fehlerfunktion eine Stammfunktion von 2 π e t 2 {\displaystyle {\tfrac {2}{\sqrt {\pi }}}e^{-t^{2}}} , und zwar die einzige ungerade (gerade Funktionen mit Stammfunktion besitzen genau eine ungerade solche).

Für ein reelles Argument x {\displaystyle x} ist erf {\displaystyle \operatorname {erf} } eine reellwertige Funktion; zur Verallgemeinerung auf komplexe Argumente siehe unten.

Die Fehlerfunktion ist eine Sigmoidfunktion, findet Anwendung in der Statistik und in der Theorie der partiellen Differentialgleichungen und hängt eng mit dem Fehlerintegral zusammen.

Bezeichnungen

Die Bezeichnung erf ( x ) {\displaystyle {\textrm {erf}}(x)} kommt von error function.

Komplementäre Fehlerfunktion

Die komplementäre (bzw. konjugierte) Fehlerfunktion erfc ( x ) {\displaystyle \operatorname {erfc} (x)} ist gegeben durch:

erfc ( x ) = 1 erf ( x ) = 2 π x e t 2 d t {\displaystyle \operatorname {erfc} (x)=1-\operatorname {erf} (x)={\frac {2}{\sqrt {\pi }}}\int _{x}^{\infty }e^{-t^{2}}\,\mathrm {d} t}

Verallgemeinerte Fehlerfunktion

Die verallgemeinerte Fehlerfunktion erf ( a , b ) {\displaystyle \operatorname {erf} (a,b)} wird durch das Integral

erf ( a , b ) = 2 π a b e t 2 d t {\displaystyle \operatorname {erf} (a,b)={\frac {2}{\sqrt {\pi }}}\int _{a}^{b}e^{-t^{2}}\,\mathrm {d} t}

definiert.

Eigenschaften

Es gilt:

erf ( a , b ) = erf ( b ) erf ( a ) {\displaystyle \operatorname {erf} (a,b)=\operatorname {erf} (b)-\operatorname {erf} (a)}

Die Fehlerfunktion ist ungerade:

erf ( x ) = erf ( x ) {\displaystyle \operatorname {erf} (-x)=-\operatorname {erf} (x)}

Das uneigentliche Integral von {\displaystyle -\infty } bis + {\displaystyle +\infty } ist

2 π + e t 2 d t = 2 {\displaystyle {\frac {2}{\sqrt {\pi }}}\int _{-\infty }^{+\infty }e^{-t^{2}}\,\mathrm {d} t=2}

Außerdem gilt:

erf ( x ) 2 = 4 π 0 1 1 exp [ x 2 ( y 2 + 1 ) ] y 2 + 1 d y {\displaystyle \operatorname {erf} (x)^{2}={\frac {4}{\pi }}\int _{0}^{1}{\frac {1-\exp[-x^{2}(y^{2}+1)]}{y^{2}+1}}\mathrm {d} y}

Verwendung

Verwandtschaft mit der Normalverteilung

Die Fehlerfunktion hat eine gewisse Ähnlichkeit mit der Verteilungsfunktion der Normalverteilung. Sie hat jedoch eine Zielmenge von ( 1 , 1 ) {\displaystyle (-1,1)} , während eine Verteilungsfunktion zwingend Werte aus dem Bereich [ 0 , 1 ] {\displaystyle [0,1]} annehmen muss.

Es gilt für die Standardnormalverteilung

Φ ( x ) = 1 2 ( 1 + erf ( x 2 ) ) {\displaystyle \Phi (x)={\frac {1}{2}}\left(1+\operatorname {erf} \left({\frac {x}{\sqrt {2}}}\right)\right)}

bzw. für die Verteilungsfunktion F {\displaystyle F} einer beliebigen Normalverteilung mit Standardabweichung σ {\displaystyle \sigma } und Erwartungswert μ {\displaystyle \mu }

F ( x ) = 1 2 ( 1 + erf ( x μ σ 2 ) ) . {\displaystyle F(x)={\frac {1}{2}}\left(1+\operatorname {erf} \left({\frac {x-\mu }{\sigma {\sqrt {2}}}}\right)\right).}

Falls die Abweichungen der einzelnen Ergebnisse einer Messreihe vom gemeinsamen Mittelwert durch eine Normalverteilung mit Standardabweichung σ {\displaystyle \sigma } und Erwartungswert 0 beschrieben werden können, dann ist erf ( a σ 2 ) {\displaystyle \textstyle \operatorname {erf} \left({\frac {a}{\sigma {\sqrt {2}}}}\right)} die Wahrscheinlichkeit, mit der der Messfehler einer einzelnen Messung zwischen a {\displaystyle -a} und + a {\displaystyle +a} liegt (für positives a {\displaystyle a} ).

Die Fehlerfunktion kann verwendet werden, um mit Hilfe der Inversionsmethode normalverteilte Pseudozufallszahlen zu generieren.[2]

Wärmeleitungsgleichung

Die Fehlerfunktion und die komplementäre Fehlerfunktion kommen beispielsweise in Lösungen der Wärmeleitungsgleichung vor, wenn Randwertbedingungen durch die Heaviside-Funktion vorgegeben sind.

Numerische Berechnung

Die Fehlerfunktion ist wie die Verteilungsfunktion der Normalverteilung nicht durch eine geschlossene Funktion darstellbar und muss numerisch bestimmt werden.

Für kleine reelle Werte erfolgt die Berechnung mit der Reihenentwicklung

erf ( x ) = 2 π n = 0 ( 1 ) n x 2 n + 1 ( 2 n + 1 ) n ! = 2 π ( x x 3 3 + x 5 10 x 7 42 + x 9 216 ) , {\displaystyle \operatorname {erf} (x)={\frac {2}{\sqrt {\pi }}}\sum _{n=0}^{\infty }{\frac {(-1)^{n}x^{2n+1}}{(2n+1)n!}}={\frac {2}{\sqrt {\pi }}}\left(x-{\frac {x^{3}}{3}}+{\frac {x^{5}}{10}}-{\frac {x^{7}}{42}}+{\frac {x^{9}}{216}}-\dotsb \right),}

für große reelle Werte mit der Kettenbruchentwicklung

erf ( x ) = 1 1 π e x 2 x + 1 2 x + 2 x + 3 2 x + 4 x + . {\displaystyle \operatorname {erf} (x)=1-{\frac {1}{\sqrt {\pi }}}\cdot {\frac {e^{-x^{2}}}{x+{\frac {1}{2x+{\frac {2}{x+{\frac {3}{2x+{\frac {4}{x+\dotsb }}}}}}}}}}.}

Für den kompletten Wertebereich gibt es folgende Approximation mit einem maximalen Fehler von 1 , 2 10 7 {\displaystyle 1{,}2\cdot 10^{-7}} :[3]

erf ( x ) { 1 τ ( x ) , falls  x 0 , τ ( x ) 1 sonst, {\displaystyle \operatorname {erf} (x)\approx {\begin{cases}1-\tau (x){\text{,}}&{\text{falls }}x\geq 0{\text{,}}\\\tau (-x)-1&{\text{sonst,}}\end{cases}}}

mit

τ ( x ) = t exp ( x 2 1,265 51223 + 1,000 02368 t + 0,374 09196 t 2 + 0,096 78418 t 3 0,186 28806 t 4 + 0,278 86807 t 5 1,135 20398 t 6 + 1,488 51587 t 7 0,822 15223 t 8 + 0,170 87277 t 9 ) {\displaystyle {\begin{array}{rcl}\tau (x)&=&t\cdot \exp {\bigl (}-x^{2}-1{,}26551223+1{,}00002368\cdot t+0{,}37409196\cdot t^{2}+0{,}09678418\cdot t^{3}\\&&\qquad -0{,}18628806\cdot t^{4}+0{,}27886807\cdot t^{5}-1{,}13520398\cdot t^{6}+1{,}48851587\cdot t^{7}\\&&\qquad -0{,}82215223\cdot t^{8}+0{,}17087277\cdot t^{9}{\bigr )}\end{array}}}

und

t = 1 1 + 0 , 5 | x | . {\displaystyle t={\frac {1}{1+0{,}5\,|x|}}.}

Eine für alle reellen Werte von x {\displaystyle x} schnell konvergierende Entwicklung[4] erhält man unter Verwendung des Theorems von Heinrich H. Bürmann:[5][6]

erf ( x ) = 2 π sgn ( x ) 1 e x 2 ( 1 1 12 ( 1 e x 2 ) 7 480 ( 1 e x 2 ) 2 5 896 ( 1 e x 2 ) 3 787 276480 ( 1 e x 2 ) 4   ) = 2 π sgn ( x ) 1 e x 2 ( π 2 + k = 1 c k e k x 2 ) {\displaystyle {\begin{aligned}\operatorname {erf} (x)&={\frac {2}{\sqrt {\pi }}}\operatorname {sgn}(x){\sqrt {1-e^{-x^{2}}}}\left(1-{\frac {1}{12}}\left(1-e^{-x^{2}}\right)-{\frac {7}{480}}\left(1-e^{-x^{2}}\right)^{2}-{\frac {5}{896}}\left(1-e^{-x^{2}}\right)^{3}-{\frac {787}{276480}}\left(1-e^{-x^{2}}\right)^{4}-\ \cdots \right)\\&={\frac {2}{\sqrt {\pi }}}\operatorname {sgn}(x){\sqrt {1-e^{-x^{2}}}}\left({\frac {\sqrt {\pi }}{2}}+\sum _{k=1}^{\infty }c_{k}e^{-k\,x^{2}}\right)\end{aligned}}}

Durch geeignete Wahl von c 1 {\displaystyle c_{1}} und c 2 {\displaystyle c_{2}} ergibt sich daraus eine Näherung, deren größter relativer Fehler bei x = ± 1,379 6 {\displaystyle \textstyle x=\pm 1{,}3796} kleiner als 3,612 7 10 3 {\displaystyle \textstyle 3{,}6127\cdot 10^{-3}} ist:

erf ( x ) 2 π sgn ( x ) 1 e x 2 ( π 2 + 31 200 e x 2 341 8000 e 2 x 2 ) {\displaystyle \operatorname {erf} (x)\approx {\frac {2}{\sqrt {\pi }}}\operatorname {sgn}(x){\sqrt {1-e^{-x^{2}}}}\left({\frac {\sqrt {\pi }}{2}}+{\frac {31}{200}}\,e^{-x^{2}}-{\frac {341}{8000}}\,e^{-2\,x^{2}}\right)}

Wertetabelle

x {\displaystyle x} erf ( x ) {\displaystyle \operatorname {erf} (x)} erfc ( x ) {\displaystyle \operatorname {erfc} (x)} x {\displaystyle x} erf ( x ) {\displaystyle \operatorname {erf} (x)} erfc ( x ) {\displaystyle \operatorname {erfc} (x)}
0,00 0,0000000 1,0000000 1,30 0,9340079 0,0659921
0,05 0,0563720 0,9436280 1,40 0,9522851 0,0477149
0,10 0,1124629 0,8875371 1,50 0,9661051 0,0338949
0,15 0,1679960 0,8320040 1,60 0,9763484 0,0236516
0,20 0,2227026 0,7772974 1,70 0,9837905 0,0162095
0,25 0,2763264 0,7236736 1,80 0,9890905 0,0109095
0,30 0,3286268 0,6713732 1,90 0,9927904 0,0072096
0,35 0,3793821 0,6206179 2,00 0,9953223 0,0046777
0,40 0,4283924 0,5716076 2,10 0,9970205 0,0029795
0,45 0,4754817 0,5245183 2,20 0,9981372 0,0018628
0,50 0,5204999 0,4795001 2,30 0,9988568 0,0011432
0,55 0,5633234 0,4366766 2,40 0,9993115 0,0006885
0,60 0,6038561 0,3961439 2,50 0,9995930 0,0004070
0,65 0,6420293 0,3579707 2,60 0,9997640 0,0002360
0,70 0,6778012 0,3221988 2,70 0,9998657 0,0001343
0,75 0,7111556 0,2888444 2,80 0,9999250 0,0000750
0,80 0,7421010 0,2578990 2,90 0,9999589 0,0000411
0,85 0,7706681 0,2293319 3,00 0,9999779 0,0000221
0,90 0,7969082 0,2030918 3,10 0,9999884 0,0000116
0,95 0,8208908 0,1791092 3,20 0,9999940 0,0000060
1,00 0,8427008 0,1572992 3,30 0,9999969 0,0000031
1,10 0,8802051 0,1197949 3,40 0,9999985 0,0000015
1,20 0,9103140 0,0896860 3,50 0,9999993 0,0000007

Komplexe Fehlerfunktion

Die komplexe Fehlerfunktion erf ( z ) {\displaystyle \operatorname {erf} (z)} im Bereich 3 < Im ( z ) < 3 {\displaystyle -3<\operatorname {Im} (z)<3} und 3 < Re ( z ) < 3 {\displaystyle -3<\operatorname {Re} (z)<3} . Der Farbton gibt den Winkel an, die Helligkeit den Betrag der komplexen Zahl.

Die Definitionsgleichung der Fehlerfunktion kann auf komplexe Argumente z {\displaystyle z} ausgeweitet werden:

erf ( z ) = 2 π 0 z e τ 2 d τ {\displaystyle \operatorname {erf} (z)={\frac {2}{\sqrt {\pi }}}\int _{0}^{z}e^{-\tau ^{2}}\,\mathrm {d} \tau }

In diesem Fall ist erf {\displaystyle \operatorname {erf} } eine komplexwertige Funktion. Unter komplexer Konjugation gilt

erf ( z ) = erf ( z ) {\displaystyle \operatorname {erf} (z^{*})=\operatorname {erf} (z)^{*}} .

Imaginäre Fehlerfunktion

Die imaginäre Fehlerfunktion erfi ( x ) {\displaystyle \operatorname {erfi} (x)} ist gegeben durch

erfi ( x ) = erf ( i x ) i {\displaystyle \operatorname {erfi} (x)={\frac {\operatorname {erf} (\mathrm {i} x)}{\mathrm {i} }}}

mit der Reihenentwicklung

erfi ( x ) = 2 π n = 0 x 2 n + 1 n ! ( 2 n + 1 ) = 2 π ( x + x 3 3 + x 5 10 + x 7 42 + x 9 216 + ) {\displaystyle \operatorname {erfi} (x)={\frac {2}{\sqrt {\pi }}}\sum _{n=0}^{\infty }{\frac {x^{2n+1}}{n!(2n+1)}}={\frac {2}{\sqrt {\pi }}}\left(x+{\frac {x^{3}}{3}}+{\frac {x^{5}}{10}}+{\frac {x^{7}}{42}}+{\frac {x^{9}}{216}}+\dotsb \right)} .

Zur Berechnung können e r f , e r f i , e r f c {\displaystyle \operatorname {erf,erfi,erfc} } und weitere verwandte Funktionen auch durch die Faddeeva-Funktion w ( z ) {\displaystyle w(z)} ausgedrückt werden. Die Faddeeva-Funktion ist eine skalierte komplexe komplementäre Fehlerfunktion und auch als relativistische Plasma-Dispersions-Funktion bekannt. Sie ist mit den Dawson-Integralen und dem Voigt-Profil verwandt. Eine numerische Implementierung von Steven G. Johnson steht als C-Bibliothek libcerf zur Verfügung.[7]

Literatur

Einzelnachweise

  1. Bronstein, Semendjajew, Taschenbuch der Mathematik, 6. Auflage, S. 782
  2. Für eine konkrete Implementierung siehe z. B. Peter John Acklam: An algorithm for computing the inverse normal cumulative distribution function. (Memento vom 5. Mai 2007 im Internet Archive)
  3. Numerical Recipes in Fortran 77: The Art of Scientific Computing. Cambridge University Press, 1992, ISBN 0-521-43064-X, S. 214.
  4. H. M. Schöpf, P. H. Supancic: On Bürmann’s Theorem and Its Application to Problems of Linear and Nonlinear Heat Transfer and Diffusion. In: The Mathematica Journal, 2014. doi:10.3888/tmj.16-11.
  5. Moritz Cantor: Bürmann, Heinrich. In: Allgemeine Deutsche Biographie (ADB). Band 47, Duncker & Humblot, Leipzig 1903, S. 392–394.
  6. E. W. Weisstein: Bürmann’s Theorem. mathworld
  7. Steven G. Johnson, Joachim Wuttke: libcerf.