Error function
   HOME

TheInfoList



OR:

In mathematics, the error function (also called the Gauss error function), often denoted by , is a complex function of a complex variable defined as: :\operatorname z = \frac\int_0^z e^\,\mathrm dt. This integral is a special (non- elementary) sigmoid function that occurs often in
probability Probability is the branch of mathematics concerning numerical descriptions of how likely an event is to occur, or how likely it is that a proposition is true. The probability of an event is a number between 0 and 1, where, roughly speaking, ...
,
statistics Statistics (from German: '' Statistik'', "description of a state, a country") is the discipline that concerns the collection, organization, analysis, interpretation, and presentation of data. In applying statistics to a scientific, indust ...
, and partial differential equations. In many of these applications, the function argument is a real number. If the function argument is real, then the function value is also real. In statistics, for non-negative values of , the error function has the following interpretation: for a random variable that is normally distributed with
mean There are several kinds of mean in mathematics, especially in statistics. Each mean serves to summarize a given group of data, often to better understand the overall value ( magnitude and sign) of a given data set. For a data set, the '' ar ...
0 and standard deviation , is the probability that falls in the range . Two closely related functions are the complementary error function () defined as :\operatorname z = 1 - \operatorname z, and the imaginary error function () defined as :\operatorname z = -i\operatorname iz, where is the
imaginary unit The imaginary unit or unit imaginary number () is a solution to the quadratic equation x^2+1=0. Although there is no real number with this property, can be used to extend the real numbers to what are called complex numbers, using addition an ...


Name

The name "error function" and its abbreviation were proposed by J. W. L. Glaisher in 1871 on account of its connection with "the theory of Probability, and notably the theory of
Errors An error (from the Latin ''error'', meaning "wandering") is an action which is inaccurate or incorrect. In some usages, an error is synonymous with a mistake. The etymology derives from the Latin term 'errare', meaning 'to stray'. In statistics ...
." The error function complement was also discussed by Glaisher in a separate publication in the same year. For the "law of facility" of errors whose
density Density (volumetric mass density or specific mass) is the substance's mass per unit of volume. The symbol most often used for density is ''ρ'' (the lower case Greek letter rho), although the Latin letter ''D'' can also be used. Mathematicall ...
is given by :f(x)=\left(\frac\right)^\frac12 e^ (the
normal distribution In statistics, a normal distribution or Gaussian distribution is a type of continuous probability distribution for a real-valued random variable. The general form of its probability density function is : f(x) = \frac e^ The parameter \mu ...
), Glaisher calculates the probability of an error lying between and as: :\left(\frac\right)^\frac12 \int_p^qe^\,\mathrm dx = \tfrac12\left(\operatorname \left(q\sqrt\right) -\operatorname \left(p\sqrt\right)\right).


Applications

When the results of a series of measurements are described by a
normal distribution In statistics, a normal distribution or Gaussian distribution is a type of continuous probability distribution for a real-valued random variable. The general form of its probability density function is : f(x) = \frac e^ The parameter \mu ...
with standard deviation and
expected value In probability theory, the expected value (also called expectation, expectancy, mathematical expectation, mean, average, or first moment) is a generalization of the weighted average. Informally, the expected value is the arithmetic mean of a ...
0, then is the probability that the error of a single measurement lies between and , for positive . This is useful, for example, in determining the bit error rate of a digital communication system. 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 The Heaviside step function, or the unit step function, usually denoted by or (but sometimes , or ), is a step function, named after Oliver Heaviside (1850–1925), the value of which is zero for negative arguments and one for positive argum ...
. The error function and its approximations can be used to estimate results that hold
with high probability In mathematics, an event that occurs with high probability (often shortened to w.h.p. or WHP) is one whose probability depends on a certain number ''n'' and goes to 1 as ''n'' goes to infinity, i.e. the probability of the event occurring can be ma ...
or with low probability. Given a random variable (a normal distribution with mean and standard deviation ) and a constant : :\begin \Pr \leq L&= \frac12 + \frac12\operatorname\frac \\ &\approx A \exp \left(-B \left(\frac\right)^2\right) \end where and are certain numeric constants. If is sufficiently far from the mean, specifically , then: :\Pr \leq L\leq A \exp (-B \ln) = \frac so the probability goes to 0 as . The probability for being in the interval can be derived as :\begin \Pr _a\leq X \leq L_b&= \int_^ \frac \exp\left(-\frac\right) \,\mathrm dx \\ &= \frac12\left(\operatorname\frac - \operatorname\frac\right).\end


Properties

The property means that the error function is an
odd function In mathematics, even functions and odd functions are functions which satisfy particular symmetry relations, with respect to taking additive inverses. They are important in many areas of mathematical analysis, especially the theory of power se ...
. This directly results from the fact that the integrand is an
even function In mathematics, even functions and odd functions are functions which satisfy particular symmetry relations, with respect to taking additive inverses. They are important in many areas of mathematical analysis, especially the theory of power se ...
(the antiderivative of an even function which is zero at the origin is an odd function and vice versa). Since the error function is an entire function which takes real numbers to real numbers, for any
complex number In mathematics, a complex number is an element of a number system that extends the real numbers with a specific element denoted , called the imaginary unit and satisfying the equation i^= -1; every complex number can be expressed in the fo ...
: :\operatorname \overline = \overline where is the complex conjugate of ''z''. The integrand and are shown in the complex -plane in the figures at right with domain coloring. The error function at is exactly 1 (see Gaussian integral). At the real axis, approaches unity at and −1 at . At the imaginary axis, it tends to .


Taylor series

The error function is an entire function; it has no singularities (except that at infinity) and its Taylor expansion always converges, but is famously known " ..for its bad convergence if ." The defining integral cannot be evaluated in closed form in terms of elementary functions, but by expanding the integrand into its
Maclaurin series Maclaurin or MacLaurin is a surname. Notable people with the surname include: * Colin Maclaurin (1698–1746), Scottish mathematician * Normand MacLaurin (1835–1914), Australian politician and university administrator * Henry Normand MacLaurin ...
and integrating term by term, one obtains the error function's Maclaurin series as: :\begin \operatorname z &= \frac\sum_^\infty\frac \\ pt&=\frac \left(z-\frac+\frac-\frac+\frac-\cdots\right) \end which holds for every
complex number In mathematics, a complex number is an element of a number system that extends the real numbers with a specific element denoted , called the imaginary unit and satisfying the equation i^= -1; every complex number can be expressed in the fo ...
 . The denominator terms are sequence A007680 in the OEIS. For iterative calculation of the above series, the following alternative formulation may be useful: :\begin \operatorname z &= \frac\sum_^\infty\left(z \prod_^n \right) \\ pt&= \frac \sum_^\infty \frac \prod_^n \frac \end because expresses the multiplier to turn the th term into the th term (considering as the first term). The imaginary error function has a very similar Maclaurin series, which is: :\begin \operatorname z &= \frac\sum_^\infty\frac \\ pt&=\frac \left(z+\frac+\frac+\frac+\frac+\cdots\right) \end which holds for every
complex number In mathematics, a complex number is an element of a number system that extends the real numbers with a specific element denoted , called the imaginary unit and satisfying the equation i^= -1; every complex number can be expressed in the fo ...
 .


Derivative and integral

The derivative of the error function follows immediately from its definition: :\frac\operatorname z =\frac e^. From this, the derivative of the imaginary error function is also immediate: :\frac\operatorname z =\frac e^. An
antiderivative In calculus, an antiderivative, inverse derivative, primitive function, primitive integral or indefinite integral of a function is a differentiable function whose derivative is equal to the original function . This can be stated symbolica ...
of the error function, obtainable by
integration by parts In calculus, and more generally in mathematical analysis, integration by parts or partial integration is a process that finds the integral of a product of functions in terms of the integral of the product of their derivative and antiderivat ...
, is :z\operatornamez + \frac. An antiderivative of the imaginary error function, also obtainable by integration by parts, is :z\operatornamez - \frac. Higher order derivatives are given by :\operatorname^z = \frac \mathit_(z) e^ = \frac \frac \left(e^\right),\qquad k=1, 2, \dots where are the physicists' Hermite polynomials.


Bürmann series

An expansion, which converges more rapidly for all real values of than a Taylor expansion, is obtained by using Hans Heinrich Bürmann's theorem: : \begin \operatorname x &= \frac 2 \sgn x \cdot \sqrt \left( 1-\frac \left (1-e^ \right ) -\frac \left (1-e^ \right )^2 -\frac \left (1-e^ \right )^3-\frac \left (1-e^ \right )^4 - \cdots \right) \\
0pt PT, Pt, or pt may refer to: Arts and entertainment * ''P.T.'' (video game), acronym for ''Playable Teaser'', a short video game released to promote the cancelled video game ''Silent Hills'' * Porcupine Tree, a British progressive rock group ...
&= \frac \sgn x \cdot \sqrt \left(\frac + \sum_^\infty c_k e^ \right). \end where is the sign function. By keeping only the first two coefficients and choosing and , the resulting approximation shows its largest relative error at , where it is less than 0.0036127: : \operatorname x \approx \frac\sgn x \cdot \sqrt \left(\frac + \frace^-\frac e^\right).


Inverse functions

Given a complex number , there is not a ''unique'' complex number satisfying , so a true inverse function would be multivalued. However, for , there is a unique ''real'' number denoted satisfying :\operatorname\left(\operatorname^ x\right) = x. The inverse error function is usually defined with domain , and it is restricted to this domain in many computer algebra systems. However, it can be extended to the disk of the complex plane, using the Maclaurin series :\operatorname^ z=\sum_^\infty\frac\left (\fracz\right )^, where and :\begin c_k&=\sum_^\frac \\ &= \left\. \end So we have the series expansion (common factors have been canceled from numerators and denominators): :\operatorname^ z=\frac \left (z+\fracz^3+\fracz^5+\fracz^7+\fracz^9+\fracz^+\cdots\right ). (After cancellation the numerator/denominator fractions are entries / in the OEIS; without cancellation the numerator terms are given in entry .) The error function's value at  is equal to . For , we have . The inverse complementary error function is defined as :\operatorname^(1-z) = \operatorname^ z. For real , there is a unique ''real'' number satisfying . The inverse imaginary error function is defined as . For any real ''x'', Newton's method can be used to compute , and for , the following Maclaurin series converges: :\operatorname^ z =\sum_^\infty\frac\left (\fracz\right )^, where is defined as above.


Asymptotic expansion

A useful asymptotic expansion of the complementary error function (and therefore also of the error function) for large real is :\begin \operatorname x &= \frac\left(1 + \sum_^\infty (-1)^n \frac\right) \\ pt &= \frac\sum_^\infty (-1)^n \frac, \end where is the double factorial of , which is the product of all odd numbers up to . This series diverges for every finite , and its meaning as asymptotic expansion is that for any integer one has :\operatorname x = \frac\sum_^ (-1)^n \frac + R_N(x) where the remainder, in Landau notation, is :R_N(x) = O\left(x^ e^\right) as . Indeed, the exact value of the remainder is :R_N(x) := \frac 2^\frac\int_x^\infty t^e^\,\mathrm dt, which follows easily by induction, writing :e^ = -(2t)^\left(e^\right)' and integrating by parts. For large enough values of , only the first few terms of this asymptotic expansion are needed to obtain a good approximation of (while for not too large values of , the above Taylor expansion at 0 provides a very fast convergence).


Continued fraction expansion

A continued fraction expansion of the complementary error function is: :\operatorname z = \frace^ \cfrac,\qquad a_m = \frac.


Integral of error function with Gaussian density function

:\int_^ \operatorname \left(ax+b \right) \frac\exp\left(-\frac \right)\,\mathrm dx= \operatorname \frac , \qquad a,b,\mu,\sigma \in \R which appears related to Ng and Geller, formula 13 in section 4.3 with a change of variables.


Factorial series

The inverse
factorial series In mathematics, the factorial of a non-negative denoted is the product of all positive integers less than or equal The factorial also equals the product of n with the next smaller factorial: \begin n! &= n \times (n-1) \times (n-2) \ ...
: :\begin \operatorname z &= \frac \sum_^\infty \frac\\ &= \frac\left(1 -\frac12\frac + \frac\frac - \cdots \right) \end converges for . Here :\begin Q_n &\overset \frac \int_0^\infty \tau(\tau-1)\cdots(\tau-n+1)\tau^ e^ \,d\tau \\ &= \sum_^n \left(\tfrac12\right)^ s(n,k), \end denotes the rising factorial, and denotes a signed
Stirling number of the first kind In mathematics, especially in combinatorics, Stirling numbers of the first kind arise in the study of permutations. In particular, the Stirling numbers of the first kind count permutations according to their number of cycles (counting fixed po ...
. There also exists a representation by an infinite sum containing the double factorial: :\operatorname z = \frac \sum_^\infty \fracz^


Numerical approximations


Approximation with elementary functions


Table of values


Related functions


Complementary error function

The complementary error function, denoted , is defined as :\begin \operatorname x & = 1-\operatorname x \\ pt& = \frac \int_x^\infty e^\,\mathrm dt \\ pt& = e^ \operatorname x, \end which also defines , the scaled complementary error function (which can be used instead of to avoid arithmetic underflow). Another form of for is known as Craig's formula, after its discoverer: :\operatorname (x \mid x\ge 0) = \frac 2 \pi \int_0^\frac \exp \left( - \frac \right) \, \mathrm d\theta. This expression is valid only for positive values of , but it can be used in conjunction with to obtain for negative values. This form is advantageous in that the range of integration is fixed and finite. An extension of this expression for the of the sum of two non-negative variables is as follows: :\operatorname (x+y \mid x,y\ge 0) = \frac 2 \pi \int_0^\frac \exp \left( - \frac - \frac \right) \,\mathrm d\theta.


Imaginary error function

The imaginary error function, denoted , is defined as :\begin \operatorname x & = -i\operatorname ix \\ pt& = \frac \int_0^x e^\,\mathrm dt \\ pt& = \frac e^ D(x), \end where is the Dawson function (which can be used instead of to avoid arithmetic overflow). Despite the name "imaginary error function", is real when is real. When the error function is evaluated for arbitrary complex arguments , the resulting complex error function is usually discussed in scaled form as the
Faddeeva function The Faddeeva function or Kramp function is a scaled complex complementary error function, :w(z):=e^\operatorname(-iz) = \operatorname(-iz) =e^\left(1+\frac\int_0^z e^\textt\right). It is related to the Fresnel integral, to Dawson's integral, an ...
: :w(z) = e^\operatorname(-iz) = \operatorname(-iz).


Cumulative distribution function

The error function is essentially identical to the standard normal cumulative distribution function, denoted , also named by some software languages, as they differ only by scaling and translation. Indeed, : \begin\Phi(x) &=\frac\int_^x e^\tfrac\,\mathrm dt\\ pt &= \frac12 \left(1+\operatorname\frac\right)\\ pt&=\frac12\operatorname\left(-\frac\right) \end or rearranged for and : :\begin \operatorname(x) &= 2 \Phi \left ( x \sqrt \right ) - 1 \\ pt \operatorname(x) &= 2 \Phi \left ( - x \sqrt \right ) \\ &=2\left(1-\Phi \left ( x \sqrt \right)\right). \end Consequently, the error function is also closely related to the
Q-function In statistics, the Q-function is the tail distribution function of the standard normal distribution. y) = P(X > x) = Q(x) where x = \frac. Other definitions of the ''Q''-function, all of which are simple transformations of the normal cumulati ...
, which is the tail probability of the standard normal distribution. The Q-function can be expressed in terms of the error function as :\begin Q(x) &=\frac12 - \frac12 \operatorname \frac\\ &=\frac12\operatorname\frac. \end The
inverse Inverse or invert may refer to: Science and mathematics * Inverse (logic), a type of conditional sentence which is an immediate inference made from another conditional sentence * Additive inverse (negation), the inverse of a number that, when a ...
of is known as the normal quantile function, or probit function and may be expressed in terms of the inverse error function as :\operatorname(p) = \Phi^(p) = \sqrt\operatorname^(2p-1) = -\sqrt\operatorname^(2p). 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 In mathematics, a confluent hypergeometric function is a solution of a confluent hypergeometric equation, which is a degenerate form of a hypergeometric differential equation where two of the three regular singularities merge into an irregula ...
(Kummer's function): :\operatorname x = \frac M\left(\tfrac12,\tfrac32,-x^2\right). It has a simple expression in terms of the Fresnel integral. In terms of the regularized gamma function and the incomplete gamma function, :\operatorname x = \sgn x \cdot P\left(\tfrac12, x^2\right) = \frac\gamma\left(\tfrac12, x^2\right). is the sign function.


Generalized error functions

Some authors discuss the more general functions: :E_n(x) = \frac \int_0^x e^\,\mathrm dt =\frac\sum_^\infty(-1)^p\frac. Notable cases are: * is a straight line through the origin: * is the error function, . After division by , all the for odd look similar (but not identical) to each other. Similarly, the for even look similar (but not identical) to each other after a simple division by . All generalised error functions for look similar on the positive side of the graph. These generalised functions can equivalently be expressed for using the
gamma function In mathematics, the gamma function (represented by , the capital letter gamma from the Greek alphabet) is one commonly used extension of the factorial function to complex numbers. The gamma function is defined for all complex numbers excep ...
and incomplete gamma function: :E_n(x) = \frac\Gamma(n)\left(\Gamma\left(\frac\right) - \Gamma\left(\frac, x^n\right)\right), \qquad x>0. Therefore, we can define the error function in terms of the incomplete gamma function: :\operatorname x = 1 - \frac\Gamma\left(\tfrac12, x^2\right).


Iterated integrals of the complementary error function

The iterated integrals of the complementary error function are defined by :\begin \operatorname^n\!\operatorname z &= \int_z^\infty \operatorname^\!\operatorname \zeta\,\mathrm d\zeta \\ pt\operatorname^0\!\operatorname z &= \operatorname z \\ \operatorname^1\!\operatorname z &= \operatorname z = \frac e^ - z \operatorname z \\ \operatorname^2\!\operatorname z &= \tfrac14 \left( \operatorname z -2 z \operatorname z \right) \\ \end The general recurrence formula is :2 n \cdot \operatorname^n\!\operatorname z = \operatorname^\!\operatorname z -2 z \cdot \operatorname^\!\operatorname z They have the power series :\operatorname^n\!\operatorname z =\sum_^\infty \frac, from which follow the symmetry properties :\operatorname^\!\operatorname (-z) =-\operatorname^\!\operatorname z +\sum_^m \frac and :\operatorname^\!\operatorname(-z) =\operatorname^\!\operatorname z +\sum_^m \frac.


Implementations


As real function of a real argument

* In
Posix The Portable Operating System Interface (POSIX) is a family of standards specified by the IEEE Computer Society for maintaining compatibility between operating systems. POSIX defines both the system- and user-level application programming in ...
-compliant operating systems, the header
math.h C mathematical operations are a group of functions in the C standard library, standard library of the C programming language implementing basic mathematical functions. All functions use floating-point numbers in one manner or another. Different C ...
shall declare and the mathematical library libm shall provide the functions erf and erfc ( double precision) as well as their
single precision Single-precision floating-point format (sometimes called FP32 or float32) is a computer number format, usually occupying 32 bits in computer memory; it represents a wide dynamic range of numeric values by using a floating radix point. A floatin ...
and extended precision counterparts erff, erfl and erfcf, erfcl. * The
GNU Scientific Library The GNU Scientific Library (or GSL) is a software library for numerical computations in applied mathematics and science. The GSL is written in C; wrappers are available for other programming languages. The GSL is part of the GNU Project and is ...
provides erf, erfc, log(erf), and scaled error functions.


As complex function of a complex argument

* libcerf
/code>, numeric C library for complex error functions, provides the complex functions cerf, cerfc, cerfcx and the real functions erfi, erfcx with approximately 13–14 digits precision, based on the
Faddeeva function The Faddeeva function or Kramp function is a scaled complex complementary error function, :w(z):=e^\operatorname(-iz) = \operatorname(-iz) =e^\left(1+\frac\int_0^z e^\textt\right). It is related to the Fresnel integral, to Dawson's integral, an ...
as implemented in th
MIT Faddeeva Package


See also


Related functions

* Gaussian integral, over the whole real line * Gaussian function, derivative * Dawson function, renormalized imaginary error function *
Goodwin–Staton integral In mathematics the Goodwin–Staton integral is defined as :Frank William John Olver (ed.), N. M. Temme (Chapter contr.), NIST Handbook of Mathematical Functions, Chapter 7, p160, Cambridge University Press 2010 : G(z)=\int_0^\infty \frac \, dt ...


In probability

*
Normal distribution In statistics, a normal distribution or Gaussian distribution is a type of continuous probability distribution for a real-valued random variable. The general form of its probability density function is : f(x) = \frac e^ The parameter \mu ...
* Normal cumulative distribution function, a scaled and shifted form of error function * Probit, the inverse or quantile function of the normal CDF *
Q-function In statistics, the Q-function is the tail distribution function of the standard normal distribution. y) = P(X > x) = Q(x) where x = \frac. Other definitions of the ''Q''-function, all of which are simple transformations of the normal cumulati ...
, the tail probability of the normal distribution


References


Further reading

* * *


External links


A Table of Integrals of the Error Functions
{{Authority control Special hypergeometric functions Gaussian function Functions related to probability distributions Analytic functions