首页 | 主题 | 图库 | 问答 | 文摘 | 原创 | 百科

历史 | 地理 | 人物 | 艺术 | 体育 | 科学 | 音乐 | 电影 | 信息技术 | 世界遗产

 开放、中立,源自维基百科

Personal tools

Error function

From Wikipedia, the free encyclopedia

Jump to: navigation, search
Image:Error Function.svg
Plot of the error function

In mathematics, the error function (also called the Gauss error function) is a non-elementary function which occurs in probability, statistics and partial differential equations. It is defined as:

Failed to parse (Missing texvc executable; please see math/README to configure.): \operatorname{erf}(x) = \frac{2}{\sqrt{\pi}}\int_0^x e^{-t^2} dt.


The complementary error function, denoted erfc, is defined in terms of the error function:

Failed to parse (Missing texvc executable; please see math/README to configure.): \mbox{erfc}(x) = 1-\mbox{erf}(x) = \frac{2}{\sqrt{\pi}} \int_x^{\infty} e^{-t^2}\,dt.


The complex error function, denoted w(x), (also known as the Faddeeva function) is also defined in terms of the error function:

Failed to parse (Missing texvc executable; please see math/README to configure.): w(x) = e^{-x^2}{\textrm{erfc}}(-ix).\,\!


Contents

Properties

The error function is odd:

Failed to parse (Missing texvc executable; please see math/README to configure.): \operatorname{erf} (-x) = -\operatorname{erf} (x).


Also, for any complex number x one has

Failed to parse (Missing texvc executable; please see math/README to configure.): \operatorname{erf} (x^{*}) = \operatorname{erf}(x)^{*}


where Failed to parse (Missing texvc executable; please see math/README to configure.): x^*

is the complex conjugate of x.

The integral cannot be evaluated in closed form in terms of elementary functions, but by expanding the integrand in a Taylor series, one obtains the Taylor series for the error function as follows:

Failed to parse (Missing texvc executable; please see math/README to configure.): \operatorname{erf}(x)= \frac{2}{\sqrt{\pi}}\sum_{n=0}^\infin\frac{(-1)^n 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}-\ \cdots\right)


which holds for every real number x, and also throughout the complex plane. (This result arises from the Taylor series expansion of Failed to parse (Missing texvc executable; please see math/README to configure.): e^{-x^2} , which is Failed to parse (Missing texvc executable; please see math/README to configure.): \sum_{n=0}^\infin\frac{(-1)^n x^{2n}}{n!} , which we then integrate term by term. The denominator terms are sequence A007680 in the OEIS.)

For iterative calculation of the above series, the following alternate formulation may be useful:

Failed to parse (Missing texvc executable; please see math/README to configure.): \operatorname{erf}(x)= \frac{2}{\sqrt{\pi}}\sum_{n=0}^\infin\left(x \prod_{i=1}^n{\frac{-(2i-1) x^2}{i (2i+1)}}\right) = \frac{2}{\sqrt{\pi}} \sum_{n=0}^\infin \frac{x}{2n+1} \prod_{i=1}^n \frac{-x^2}{i}


because Failed to parse (Missing texvc executable; please see math/README to configure.): \frac{-(2i-1) x^2}{i (2i+1)}

expresses the multiplier to turn the ith term into the (i+1)th term (assuming we number the "x" as the first term).

The error function at infinity is exactly 1 (see Gaussian integral).

The derivative of the error function follows immediately from its definition:

Failed to parse (Missing texvc executable; please see math/README to configure.): \frac{d}{dx}\,\mathrm{erf}(x)=\frac{2}{\sqrt{\pi}}\,e^{-x^2}.


The inverse error function has series

Failed to parse (Missing texvc executable; please see math/README to configure.): \operatorname{erf}^{-1}(x)=\sum_{k=0}^\infin\frac{c_k}{2k+1}\left (\frac{\sqrt{\pi}}{2}x\right )^{2k+1}, \,\!

where c0 = 1 and

Failed to parse (Missing texvc executable; please see math/README to configure.): c_k=\sum_{m=0}^{k-1}\frac{c_m c_{k-1-m}}{(m+1)(2m+1)} = \left\{1,1,\frac{7}{6},\frac{127}{90},\ldots\right\}.


So we have the series expansion (note that common factors have been canceled from numerators and denominators):

Failed to parse (Missing texvc executable; please see math/README to configure.): \operatorname{erf}^{-1}(x)=\frac{1}{2}\sqrt{\pi}\left (x+\frac{\pi x^3}{12}+\frac{7\pi^2 x^5}{480}+\frac{127\pi^3 x^7}{40320}+\frac{4369\pi^4 x^9}{5806080}+\frac{34807\pi^5 x^{11}}{182476800}+\cdots\right ). \,\!

[1] (After cancellation the numerator/denominator fractions are entries A092676/A132467 in the OEIS; without cancellation the numerator terms are given in entry A002067.)

Image:Error Function Complementary.svg
Plot of the complementary error function

Note that error function's value at plus/minus infinity is equal to plus/minus 1.

Applications

When the results of a series of measurements are described by a normal distribution with standard deviation Failed to parse (Missing texvc executable; please see math/README to configure.): \sigma

and expected value 0, then Failed to parse (Missing texvc executable; please see math/README to configure.):  \operatorname{erf}\,\left(\,\frac{a}{\sigma \sqrt{2}}\,\right)
 is  the probability that the error of a single measurement lies between −a and +a.

The error and complementary error functions occur, for example, in solutions of the heat equation when boundary conditions are given by the Heaviside step function.

In digital optical communication system, BER is expressed by:

Failed to parse (Missing texvc executable; please see math/README to configure.): \mathrm{BER} = 0.5\,\operatorname{erfc}\left( \frac{\mu_1 - \mu_2}{\sqrt{2}\left(\sigma_1 + \sigma_2\right)} \right).


Asymptotic expansion

A useful asymptotic expansion of the complementary error function (and therefore also of the error function) for large x is

Failed to parse (Missing texvc executable; please see math/README to configure.): \mathrm{erfc}(x) = \frac{e^{-x^2}}{x\sqrt{\pi}}\left [1+\sum_{n=1}^\infty (-1)^n \frac{1\cdot3\cdot5\cdots(2n-1)}{(2x^2)^n}\right ]=\frac{e^{-x^2}}{x\sqrt{\pi}}\sum_{n=0}^\infty (-1)^n \frac{(2n)!}{n!(2x)^{2n}}.\,


This series diverges for every finite x. However, in practice only the first few terms of this expansion are needed to obtain a good approximation of erfc(x), whereas the Taylor series given above converges very slowly.

Another approximation is given by

Failed to parse (Missing texvc executable; please see math/README to configure.): (\operatorname{erf}(x))^2\approx 1-\exp\left(-x^2\frac{4/\pi+ax^2}{1+ax^2}\right)


where

Failed to parse (Missing texvc executable; please see math/README to configure.): a = \frac{-8}{3\pi}\frac{\pi-3}{\pi-4}.


Related functions

The error function is essentially identical to the standard normal cumulative distribution function, denoted Φ, as they differ only by scaling and translation. Indeed,

Failed to parse (Missing texvc executable; please see math/README to configure.): \Phi(x) = \frac{1}{2}\left[1+\mbox{erf}\left(\frac{x}{\sqrt{2}}\right)\right]\,.


The inverse of Failed to parse (Missing texvc executable; please see math/README to configure.): \Phi\,

is known as the normal quantile function, or probit function and may be expressed in terms of the inverse error function as
Failed to parse (Missing texvc executable; please see math/README to configure.): \operatorname{probit}(p) = \Phi^{-1}(p) = \sqrt{2}\,\operatorname{erf}^{-1}(2p-1).


The standard normal cdf is used more often in probability and statistics, and the error function is used more often in other branches of mathematics.

The error function is a special case of the Mittag-Leffler function, and can also be expressed as a confluent hypergeometric function (Kummer's function):

Failed to parse (Missing texvc executable; please see math/README to configure.): \mathrm{erf}(x)= \frac{2x}{\sqrt{\pi}}\,_1F_1\left(\frac{1}{2},\frac{3}{2},-x^2\right).


It has a simple expression in terms of the Fresnel integral. In terms of the Regularized Gamma function P and the incomplete gamma function,

Failed to parse (Missing texvc executable; please see math/README to configure.): \operatorname{erf}(x)=\operatorname{sgn}(x) P\left(\frac{1}{2}, x^2\right)={\operatorname{sgn}(x) \over \sqrt{\pi}}\gamma\left(\frac{1}{2}, x^2\right).


Failed to parse (Missing texvc executable; please see math/README to configure.): \operatorname{sgn}(x) \

is the sign function.

Generalised error functions

Image:Error Function Generalised.svg
Graph of generalised error functions En(x):
grey curve: E1(x) = 1 − e −x
red curve: E2(x) = erf(x)
green curve: E3(x)
blue curve: E4(x)
gold curve: E5(x).

Some authors discuss the more general functions

Failed to parse (Missing texvc executable; please see math/README to configure.): E_n(x) = \frac{n!}{\sqrt{\pi}} \int_0^x e^{-t^n}\,dt =\frac{n!}{\sqrt{\pi}}\sum_{p=0}^\infin(-1)^p\frac{x^{np+1}}{(np+1)p!}\,.


Notable cases are:

  • E0(x) is a straight line through the origin: Failed to parse (Missing texvc executable; please see math/README to configure.): E_0(x)=\frac{x}{e \sqrt{\pi}}
  • E2(x) is the error function, erf(x).

After division by n!, all the En for odd n look similar (but not identical) to each other. Similarly, the En for even n look similar (but not identical) to each other after a simple division by n!. All generalised error functions for n>0 look similar on the positive x side of the graph.

These generalised fuctions can equivalently be expressed for x>0 using the Gamma function:

Failed to parse (Missing texvc executable; please see math/README to configure.): E_n(x) = \frac{x\left(x^n\right)^{-1/n}\Gamma(n)\left(\Gamma\left(\frac{1}{n}\right)-\Gamma\left(\frac{1}{n},x^n\right)\right)}{\sqrt\pi}, \quad \quad x>0


Therefore, we can define the error function in terms of the Gamma function:

Failed to parse (Missing texvc executable; please see math/README to configure.): \operatorname{erf}(x) = 1 - \frac{\Gamma\left(\frac{1}{2},x^2\right)}{\sqrt\pi}


Iterated integrals of the complementary error function

The iterated integrals of the complementary error function are defined by

Failed to parse (Missing texvc executable; please see math/README to configure.): \mathrm i^n \operatorname{erfc}\, (z) = \int_z^\infty \mathrm i^{n-1} \operatorname{erfc}\, (\zeta)\;\mathrm d \zeta.\,


They have the power series

Failed to parse (Missing texvc executable; please see math/README to configure.): \mathrm i^n \operatorname{erfc}\, (z) = \sum_{j=0}^\infty \frac{(-z)^j}{2^{n-j}j! \Gamma \left( 1 + \frac{n-j}{2}\right)}\,,

from which follow the symmetry properties

Failed to parse (Missing texvc executable; please see math/README to configure.): \mathrm i^{2m} \operatorname{erfc} (-z) = - \mathrm i^{2m} \operatorname{erfc}\, (z) + \sum_{q=0}^m \frac{z^{2q}}{2^{2(m-q)-1}(2q)! (m-q)!}


and

Failed to parse (Missing texvc executable; please see math/README to configure.): \mathrm i^{2m+1} \operatorname{erfc} (-z) = \mathrm i^{2m+1} \operatorname{erfc}\, (z) + \sum_{q=0}^m \frac{z^{2q+1}}{2^{2(m-q)-1}(2q+1)! (m-q)!}\,.


Implementation

C/C++: It is implemented as the functions double erf(double x) and double erfc(double x) in the header math.h or cmath in the GNU version. This is not part of the standard and depends on individual library implementations. The pairs of functions {erff(),erfcf()} and {erfl(),erfcl()} take and return values of type float and long double respectively.

See also

References

External links

fr:Fonction d'erreur ko:오차 함수 it:Funzione degli errori pl:Funkcja błędu pt:Função erro ru:Функция ошибок fi:Virhefunktio

Languages
AD Links