Error function explained
In mathematics, the error function (also called the Gauss error function), often denoted by , is a function defined as:[1]
Error function |
Imagealt: | Plot of the error function |
General Definition: |
|
Fields Of Application: | Probability, thermodynamics, digital communications |
Domain: |
|
Range: |
|
Parity: | Odd |
Root: | 0 |
Derivative: |
|
Antiderivative: | \int\operatorname{erf}zdz=z\operatorname{erf}z+
+C
|
Taylor Series: |
|
In some old texts,
is defined without the factor of
.
[2] This
nonelementary integral is a
sigmoid function that occurs often in
probability,
statistics, 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.
, is the probability that falls in the range .
Two closely related functions are the complementary error function () defined asand the imaginary error function () defined aswhere is the imaginary unit.
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."[3] The error function complement was also discussed by Glaisher in a separate publication in the same year.[4] For the "law of facility" of errors whose density is given by(the normal distribution), Glaisher calculates the probability of an error lying between and as:
Applications
When the results of a series of measurements are described by a normal distribution with standard deviation and expected value 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 error function and its approximations can be used to estimate results that hold with high probability or with low probability. Given a random variable (a normal distribution with mean and standard deviation) and a constant, it can be shown via integration by substitution:
where and are certain numeric constants. If is sufficiently far from the mean, specifically, then:
so the probability goes to 0 as .
The probability for being in the interval can be derived as
Properties
The property means that the error function is an odd function. This directly results from the fact that the integrand is an even function (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 :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 ."[5]
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 and integrating term by term, one obtains the error function's Maclaurin series as:which holds for every complex number . The denominator terms are sequence A007680 in the OEIS.
For iterative calculation of the above series, the following alternative formulation may be useful: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:which holds for every complex number .
Derivative and integral
The derivative of the error function follows immediately from its definition:From this, the derivative of the imaginary error function is also immediate:An antiderivative of the error function, obtainable by integration by parts, isAn antiderivative of the imaginary error function, also obtainable by integration by parts, isHigher order derivatives are given bywhere are the physicists' Hermite polynomials.
Bürmann series
An expansion,[6] which converges more rapidly for all real values of than a Taylor expansion, is obtained by using Hans Heinrich Bürmann's theorem: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:
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
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[7] where and
So we have the series expansion (common factors have been canceled from numerators and denominators):(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 asFor real, there is a unique real number satisfying . The inverse imaginary error function is defined as .[8]
For any real x, Newton's method can be used to compute, and for, the following Maclaurin series converges: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 iswhere 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 haswhere the remainder iswhich follows easily by induction, writingand integrating by parts.
The asymptotic behavior of the remainder term, in Landau notation, isas . This can be found by 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:[9]
Factorial series
The inverse factorial series:converges for . Here denotes the rising factorial, and denotes a signed Stirling number of the first kind.[10] [11] There also exists a representation by an infinite sum containing the double factorial:
Numerical approximations
Approximation with elementary functions
- Abramowitz and Stegun give several approximations of varying accuracy (equations 7.1.25–28). This allows one to choose the fastest approximation suitable for a given application. In order of increasing accuracy, they are:(maximum error:)where,,,
(maximum error:)where,,,
(maximum error:)where,,,,,
(maximum error:)where,,,,, 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[12]
- The above have been generalized to sums of exponentials[13] with increasing accuracy in terms of so that can be accurately approximated or bounded by, whereIn 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.[14]
- A tight approximation of the complementary error function for is given by Karagiannidis & Lioumpas (2007)[15] who showed for the appropriate choice of parameters thatThey 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.[16]
- A single-term lower bound is[17] 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":[18] [19] whereThis is designed to be very accurate in a neighborhood of 0 and a neighborhood of 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.[20] This approximation can be inverted to obtain an approximation for the inverse error function:
- An approximation with a maximal error of for any real argument is:[21] withand
- An approximation of
with a maximum relative error less than
\left( ≈ 1.1 x 10-16\right)
in absolute value is:[22] for and for
- A simple approximation for real-valued arguments could be done through Hyperbolic functions:which keeps the absolute difference
Table of values
| | |
---|
0 | | |
0.02 | | |
0.04 | | |
0.06 | | |
0.08 | | |
0.1 | | |
0.2 | | |
0.3 | | |
0.4 | | |
0.5 | | |
0.6 | | |
0.7 | | |
0.8 | | |
0.9 | | |
1 | | |
1.1 | | |
1.2 | | |
1.3 | | |
1.4 | | |
1.5 | | |
1.6 | | |
1.7 | | |
1.8 | | |
1.9 | | |
2 | | |
2.1 | | |
2.2 | | |
2.3 | | |
2.4 | | |
2.5 | | |
3 | | |
3.5 | | | |
Related functions
Complementary error function
The complementary error function, denoted, is defined aswhich 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:[23] 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:[24]
Imaginary error function
The imaginary error function, denoted, is defined aswhere 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, as they differ only by scaling and translation. Indeed,or rearranged for and :
Consequently, the error function is also closely related to the Q-function, which is the tail probability of the standard normal distribution. The Q-function can be expressed in terms of the error function as
The inverse of is known as the normal quantile function, or probit function and may be expressed in terms of the inverse error function as
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):
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[25]
The general recurrence formula is
They have the power seriesfrom which follow the symmetry propertiesand
Implementations
As real function of a real argument
As complex function of a complex argument
[https://jugit.fz-juelich.de/mlz/libcerf 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
External links
Notes and References
- Book: Andrews, Larry C.. Special functions of mathematics for engineers. 110. SPIE Press . 1998. 9780819426161.
- Book: Whittaker . E. T. . Watson . G. N.. 978-0-521-58807-2. 341. Cambridge University Press. A Course of Modern Analysis. A Course of Modern Analysis. 1927.
- Glaisher. James Whitbread Lee. On a class of definite integrals. London, Edinburgh, and Dublin Philosophical Magazine and Journal of Science. July 1871 . 42 . 294–302. 6 December 2017. 277 . 4 . 10.1080/14786447108640568.
- Glaisher. James Whitbread Lee. On a class of definite integrals. Part II. London, Edinburgh, and Dublin Philosophical Magazine and Journal of Science. September 1871 . 42. 421–436. 6 December 2017. 4 . 279 . 10.1080/14786447108640600.
- Web site: A007680 – OEIS. oeis.org. 2020-04-02.
- 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 . The Mathematica Journal . 2014 . 16 . 10.3888/tmj.16-11 . free .
- Dominici . Diego . Asymptotic analysis of the derivatives of the inverse error function . math/0607230 . 2006.
- Bergsma . Wicher . On a new correlation coefficient, its orthogonal decomposition and associated tests of independence . math/0604627 . 2006.
- Book: Cuyt . Annie A. M.. Annie Cuyt . Petersen . Vigdis B. . Verdonk . Brigitte . Waadeland . Haakon . Jones . William B. . Handbook of Continued Fractions for Special Functions . Springer-Verlag . 2008 . 978-1-4020-6948-2 .
- Schlömilch. Oskar Xavier . Oscar Schlömilch. 1859. Ueber facultätenreihen. . de . 4 . 390–415.
- Book: Nielson, Niels . Handbuch der Theorie der Gammafunktion . 1906 . B. G. Teubner . Leipzig. de. 2017-12-04. p. 283 Eq. 3.
- New Exponential Bounds and Approximations for the Computation of Error Probability in Fading Channels. Chiani. M.. Dardari. D. . Simon . M.K.. 2003 . IEEE Transactions on Wireless Communications. 2. 4. 840–845. 10.1109/TWC.2003.814350 . 10.1.1.190.6761.
- 10.1109/TCOMM.2020.3006902 . Global minimax approximations and bounds for the Gaussian Q-function by sums of exponentials. IEEE Transactions on Communications . 2020 . Tanash . I.M. . Riihonen . T. . 68 . 10 . 6514–6524 . 2007.06939 . 220514754.
- 10.5281/zenodo.4112978 . Coefficients for Global Minimax Approximations and Bounds for the Gaussian Q-Function by Sums of Exponentials [Data set] ]. Zenodo . 2020 . Tanash . I.M. . Riihonen . T..
- Karagiannidis . G. K. . Lioumpas . A. S. . An improved approximation for the Gaussian Q-function . 2007 . IEEE Communications Letters . 11 . 8 . 644–646. 10.1109/LCOMM.2007.070470 . 4043576 .
- 10.1109/LCOMM.2021.3052257. Improved coefficients for the Karagiannidis–Lioumpas approximations and bounds to the Gaussian Q-function. IEEE Communications Letters . 2021 . Tanash . I.M.. Riihonen. T.. 25. 5. 1468–1471. 2101.07631. 231639206.
- Chang . Seok-Ho . Cosman . Pamela C. . Pamela Cosman . Milstein . Laurence B. . November 2011 . Chernoff-Type Bounds for the Gaussian Error Function . IEEE Transactions on Communications . 59 . 11 . 2939–2944 . 10.1109/TCOMM.2011.072011.100049 . 13636638.
- Book: Winitzki, Sergei . Computational Science and Its Applications – ICCSA 2003 . 2003 . 2667 . Uniform approximations for transcendental functions . Springer, Berlin . 780–789 . 978-3-540-40155-1 . 10.1007/3-540-44839-X_82 . registration . https://archive.org/details/computationalsci0000iccs_a2w6 . Lecture Notes in Computer Science .
- Zeng . Caibin . Chen . Yang Cuan . Global Padé approximations of the generalized Mittag-Leffler function and its inverse . Fractional Calculus and Applied Analysis . 2015 . 18 . 6 . 1492–1506 . 10.1515/fca-2015-0086 . Indeed, Winitzki [32] provided the so-called global Padé approximation . 1310.5592 . 118148950 .
- Web site:
- Book: Press, William H. . Numerical Recipes in Fortran 77: The Art of Scientific Computing . 0-521-43064-X . 1992 . 214 . Cambridge University Press .
- Dia . Yaya D. . 2023 . Approximate Incomplete Integrals, Application to Complementary Error Function . SSRN Electronic Journal . en . 10.2139/ssrn.4487559 . 1556-5068.
- John W. Craig, A new, simple and exact result for calculating the probability of error for two-dimensional signal constellations, Proceedings of the 1991 IEEE Military Communication Conference, vol. 2, pp. 571–575.
- 10.1109/TCOMM.2020.2986209 . A Novel Extension to Craig's Q-Function Formula and Its Application in Dual-Branch EGC Performance Analysis. IEEE Transactions on Communications . 68 . 7 . 4117–4125 . 2020 . Behnad . Aydin . 216500014.
- Book: Carslaw . H. S. . Horatio Scott Carslaw . Jaeger . J. C.. John Conrad Jaeger . 1959 . Conduction of Heat in Solids . 2nd . Oxford University Press . 978-0-19-853368-9 . 484.
- Web site: math.h - mathematical declarations . 21 April 2023 . opengroup.org . 2018 . 7.
- Web site: Special Functions – GSL 2.7 documentation.