Wikipedia / Error function
Wikipedia / Error function
In mathematics, the error function (also called the Gauss error function, is the function
The integral here is a complex contour integral is holomorphic. In many applications, the function argument is a real number, in which case the function value is also real.
In some older texts,. This nonelementary integral is a sigmoid function that occurs often in probability, statistics, and partial differential equations.
, the error function has the following interpretation: for a real random variable that is normally distributed with mean 0 and standard deviation.
Two closely related functions are the complementary error function
and the imaginary error function
is the imaginary unit.
Name
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". The complementary error function was also discussed by Glaisher in a separate publication in the same year. For the "law of facility" of errors whose density is given by
(the normal distribution as
Applications
When the results of a series of measurements are described by a normal distribution with standard deviation and expected value zero, then
. 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 error function and its approximations can be used to estimate results that hold with high probability, it can be shown (via integration by substitution) that
, then
.
Properties
The error function is an odd function is an even function (since 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 maps real numbers to real numbers, for any complex number,
denotes the complex conjugate.
(see Gaussian integral.
Taylor series
The error function is an entire function; it has no singularities (except at infinity) and its Taylor expansion, however, cancellation of leading terms makes the Taylor expansion impractical.
The defining integral cannot be evaluated in closed form in terms of elementary functions (see Liouville's theorem), but by expanding the integrand into its Maclaurin series, integrating term by term, which holds for every complex number. The denominator terms form sequence A007680 in the OEIS. This is a special case of Kummer's function:
because
as the first term).
which holds for every complex number.
Derivative and integral
are the physicists' Hermite polynomials.
An antiderivative of the error function, obtainable by integration by parts
Bürmann series
than a Taylor expansion is obtained by using Bürmann's theorem: is the sign function, the resulting approximation shows its largest relative error
Inverse functions
, there is not a unique, there is a unique real satisfying
The inverse error function, and it is restricted to this domain in many computer algebra of the complex plane, using the Maclaurin series
So we have the series expansion (common factors have been canceled from numerators and denominators):
(After cancellation the numerator and denominator values in and respectively; without cancellation the numerator terms are values in .
.
The inverse complementary error function, there is a unique real. The inverse imaginary error function.
, Newton's method, the following Maclaurin series converges:
is defined as above.
Asymptotic expansion
A useful asymptotic expansion is the double factorial, and its meaning as asymptotic expansion is that for any integer one has
where the remainder is
which follows easily by induction, writing
and integrating by parts. The asymptotic behavior of the remainder term is
. This can be found by
, the above Taylor expansion at 0 provides a very fast convergence).
Continued fraction expansion
A continued fraction expansion of the complementary error function was found by Laplace:.
Factorial series
The inverse factorial series
. Here
denotes the rising factorial denotes a signed Stirling number of the first kind. The Taylor series can be written in terms of the double factorial:
Bounds and numerical approximations
Approximation with elementary functions
Abramowitz and Stegun give several approximations of varying accuracy (equations 7.1.25–28) from C. Hastings, Jr. (maximum error: ) where , , ,
(maximum error: ) where , , ,
(maximum error: ) where , , , , ,
(maximum error: ) where , , , , ,
where p1 = 0.406742016006509, p2 = 0.0072279182302319, a1 = 0.316879890481381, a2 = -0.138329314150635, a3 = 1.08680830347054, a4 = -1.11694155120396, a5 = 1.20644903073232, a6 = -0.393127715207728, a7 = 0.0382613542530727. The maximum error of this approximation is about . The parameters are obtained by fitting the extended approximation to the accurate values of the error function using the following Python code.
All of these approximations are valid for . To use these approximations for negative , use the fact that is an odd function, so .
Exponential bounds and a pure exponential approximation for the complementary error function are given by
The above have been generalized to sums of exponentials with increasing accuracy in terms of so that can be accurately approximated or bounded by In particular, there is a systematic methodology to solve the numerical coefficients that yield a minimax approximation or bound for the closely related Q-function: , , or for . The coefficients for many variations of the exponential approximations and bounds up to have been released to open access as a comprehensive dataset.
A tight approximation of the complementary error function for is given by Karagiannidis & Lioumpas (2007), who showed for the appropriate choice of parameters They determined , which gave a good approximation for all . Alternative coefficients are also available for tailoring accuracy for a specific application or transforming the expression into a tight bound.
A single-term lower bound is where the parameter can be picked to minimize error on the desired interval of approximation.
Another approximation is given by Sergei Winitzki using his "global Padé approximations": This is designed to be very accurate in the neighborhoods of 0 and infinity, and the relative error is less than 0.00035 for all real . Using the alternate value reduces the maximum relative error to about 0.00013.
provides a maximum error of about , as demonstrated by the following Python script.
An approximation with a maximal error of for any real argument is:
in absolute value is: for
A simple approximation for real-valued arguments can be done through hyperbolic functions which keeps the absolute difference
was introduced by Abreu (2012) based on a simple algebraic expression
. These expressions maintain simplicity and tightness, providing a practical trade-off via the binomial theorem, though this is less commonly required in error function applications.
Table of values
Related functions
Complementary error function
The complementary error function, denoted 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: This expression is valid only for positive values of , but 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
Imaginary error function
The imaginary error function, denoted 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
Cumulative distribution function
The error function is essentially identical to the standard normal cumulative distribution function, denoted , also named by some software languages or rearranged for and
Consequently, the error function is also closely related to the Q-function
The inverse of is known as the normal quantile function, or probit
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
It has a simple expression in terms of the Fresnel integral.
In terms of the regularized gamma function and the incomplete gamma function is the sign function.
Iterated integrals of the complementary error function
The iterated integrals of the complementary error function are defined by
Implementations
As real function of a real argument
In POSIX-compliant operating systems, the header math.h shall declare and the mathematical library libm shall provide the functions erf and erfc (double precision) as well as their single precision and extended precision counterparts erff, erfl and erfcf, erfcl.
The GNU Scientific Library provides erf, erfc, log(erf), and scaled error functions.
As complex function of a complex argument
libcerf, 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 as implemented in the MIT Faddeeva Package
Notes
References
Further reading
External links