FazBrowse Wikipedia Viewer | Main Page |
Search Wikipedia:
|
Viewing: https://en.wikipedia.org/wiki/Error_function

Error function

Contents
Name
    Taylor series
    Table of values
Related functions
    Complementary error function
    Imaginary error function
References

\\operatorname{erf}(z) = \\frac{2}{\\sqrt\\pi}\\int_0^z e^{-t^2}\\, dt</math>"},"fields_of_application":{"wt":"Probability, thermodynamics, digital communications"},"domain":{"wt":"<math>\\mathbb{C}</math>"},"range":{"wt":"<math>\\mathbb{C}</math>"},"parity":{"wt":"Odd"},"root":{"wt":"0"},"derivative":{"wt":"<math>\\frac{d}{dz}\\operatorname{erf}(z) = \\frac{2}{\\sqrt\\pi} e^{-z^2} </math>"},"antiderivative":{"wt":"<math>\\int \\operatorname{erf}(z)\\,dz = z \\operatorname{erf}(z) + \\frac{e^{-z^2}}{\\sqrt\\pi} + C</math>"},"taylor_series":{"wt":"<math display=\"block\">\\begin{align}\n\\operatorname{erf}(z)\n&= \\frac{2}{\\sqrt\\pi}\\sum_{n=0}^\\infty\\frac{(-1)^n z^{2n+1}}{n! (2n+1)} \\\\[6pt]\n&= \\frac{2}{\\sqrt\\pi} \\left(z-\\frac{z^3}{3}+\\frac{z^5}{10}-\\frac{z^7}{42}+\\frac{z^9}{216}\\cdots\\right)\n\\end{align}</math>"}},"i":0}}]}'>
Error function
Plot of the error function over real numbers
Plot of the error function over real numbers
General information
General definitionℂ
Basic features
ParityOdd
Specific features
Root0
Derivativeerf⁡(z)=2π∑n=0∞(−1)nz2n+1n!(2n+1)=2π(z−z33+z510−z742+z9216⋯)

In mathematics, the error function (also called the Gauss error function), often denoted by exp⁡(−t2) is holomorphic on the whole complex plane X, the error function has the following interpretation: for a real random variable erf⁡(x) is the probability that erfc⁡(z)=1−erf⁡(z)

and the imaginary error function

Name

edit

The name "error function" and its abbreviation p and σ and expected value zero, then

a. 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 normally distributed random variable σ and a constant \\mu"}}'>L>μ, it can be shown via integration by substitution that

B are certain numeric constants. If Pr⁡[X≤L]≤Aexp⁡(−Blog⁡(k))=AkB

and so the probability goes to 0 as [La,Lb] can be derived as e−t2 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 z¯ denotes the complex conjugate of 1 (see Gaussian integral). At the real axis, z→∞ and ±i∞.

Taylor series

edit

The error function is an entire function; it has no singularities (except at infinity) and its Taylor expansion always converges. For erf⁡(0)=0, one obtains the error function's Maclaurin series as: −(2k−1)z2k(2k+1)

expresses the multiplier to turn the z as the first term).

The imaginary error function has a similar Maclaurin series: ddzerf⁡(z)=2πe−z2. From this, the derivative of the imaginary error function is also immediate: Hk are the physicists' Hermite polynomials.

An antiderivative of the error function, obtainable by integration by parts, is x than a Taylor expansion is obtained by using Bürmann's theorem: c1=31/200 and 0.0034361: w satisfying erf−1(x) satisfying

|z|<1 of the complex plane, using the Maclaurin series

ck=∑m=0k−1cmck−1−m(m+1)(2m+1)={1,1,76,12790,43692520,3480716200,…}.

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

(sequence A092677 in the OEIS) respectively; without cancellation the numerator terms are values in ±1.

For erfc−1(1−z)=erf−1(z). For real erfi⁡(erfi−1(x))=x. The inverse imaginary error function is defined as erfi−1(z)=∑k=0∞(−1)kck2k+1(π2z)2k+1,

where erfc⁡(x)=e−x2xπ(1+∑n=1∞(−1)n1⋅3⋅5⋯(2n−1)(2x2)n)=e−x2xπ∑n=0∞(−1)n(2n−1)!!(2x2)n, where 2n−1. This series diverges for every finite erfc⁡(x)=e−x2xπ∑n=0N−1(−1)n(2n−1)!!(2x2)n+RN(x),

where the remainder is

RN(x)=O(x−(1+2N)e−x2)

as x, only the first few terms of this asymptotic expansion are needed to obtain a good approximation of erfc⁡(z)=zπe−z21z2+a11+a2z2+a31+⋯ where Re⁡(z2)>0. Here

s(n,k) denotes a signed Stirling number of the first kind. The Taylor series can be written in terms of the double factorial:

5×10)

a2 = 0.230389, 3</sub> {{=}} 0.000972"}},"i":0}}]}'>a3 = 0.000972, 4</sub> {{=}} 0.078108"}},"i":0}}]}'>a4 = 0.078108

where a2 = −0.0958798, 3</sub> {{=}} 0.7478556"}},"i":0}}]}'>a3 = 0.7478556

where 1</sub> {{=}} 0.0705230784"}},"i":0}}]}'>a1 = 0.0705230784, 2</sub> {{=}} 0.0422820123"}},"i":0}}]}'>a2 = 0.0422820123, 3</sub> {{=}} 0.0092705272"}},"i":0}}]}'>a3 = 0.0092705272, 4</sub> {{=}} 0.0001520143"}},"i":0}}]}'>a4 = 0.0001520143, 5</sub> {{=}} 0.0002765672"}},"i":0}}]}'>a5 = 0.0002765672, 6</sub> {{=}} 0.0000430638"}},"i":0}}]}'>a6 = 0.0000430638

where a2 = −0.284496736, 3</sub> {{=}} 1.421413741"}},"i":0}}]}'>a3 = 1.421413741, 4</sub> {{=}} −1.453152027"}},"i":0}}]}'>a4 = −1.453152027, 5</sub> {{=}} 1.061405429"}},"i":0}}]}'>a5 = 1.061405429

erf⁡(x)≈1−(a1t+a2t2+⋯+a5t5+a6t6+a7t7)e−x2,t=11+p1x+p2x2 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 2×10. The parameters are obtained by fitting the extended approximation to the accurate values of the error function using the following Python code.

Python code to fit extended A&S approximation
7 in total\na0 = [\n 0.254829592,\n -0.284496736,\n 1.421413741,\n -1.453152027,\n 1.061405429,\n 0.0, # new term\n 0.0, # another new term\n]\n\nparams0 = np.array([p1_0, p2_0] + a0, dtype=float)\n\n#\n# Fit using nonlinear least squares (Levenberg–Marquardt)\n#\n\nresult = least_squares(\n residuals, params0, args=(xs, ys), xtol=1e-14, ftol=1e-14, gtol=1e-14, max_nfev=5000\n)\n\nparams = result.x\np1_fit = params[0]\np2_fit = params[1]\na_fit = params[2:]\n\n#\n# Print fitted parameters\n#\n\nprint(\"\\nFitted parameters:\")\nprint(f\"p1 = {p1_fit:.15g},\")\nprint(f\"p2 = {p2_fit:.15g},\")\nfor i, ai in enumerate(a_fit, 1):\n print(f\"a{i} = {ai:.15g},\")\n\n#\n# Evaluate approximation error\n#\n\napprox_vals = approx_erf(params, xs)\nabs_err = np.abs(approx_vals - ys)\n\nprint(f\"\\nMaximum absolute error on [{xmin},{xmax}]:\", np.max(abs_err))\nprint(\"RMS error:\", np.sqrt(np.mean(abs_err**2)))\nprint(\"Done.\")\n"}}'>importnumpyasnp frommathimport erf, exp, sqrt fromscipy.optimizeimport least_squares # # Extended A&S approximation: # erf(x) ≈ 1 − t * exp(−x^2) * (a1 + a2*t + a3*t^2 + ... + a7*t^6) # where now # t = 1 / (1 + p1*x + p2*x^2) # We fit parameters p1, p2, a1..a7 over x in [0, 10]. # defapprox_erf(params, x): p1 = params[0] p2 = params[1] a = params[2:] t = 1.0 / (1.0 + p1 * x + p2 * x * x) poly = np.zeros_like(x) tt = np.ones_like(x) # t^0 # polynomial: a1*t^0 + a2*t^1 + ... + a7*t^6 for ak in a: poly += ak * tt tt *= t return 1.0 - t * np.exp(-x * x) * poly defresiduals(params, xs, ys): return approx_erf(params, xs) - ys # # Prepare data for fitting # N = 300 xmin = 0 xmax = 10 xs = np.linspace(xmin, xmax, N) ys = np.array([erf(x) for x in xs], dtype=float) # # Initial guess for parameters # Start from original A&S values and extend them conservatively # p1_0 = 0.3275911 # original A&S p p2_0 = 0.0 # new denominator parameter # original A&S 5 coefficients, add two => 7 in total a0 = [ 0.254829592, -0.284496736, 1.421413741, -1.453152027, 1.061405429, 0.0, # new term 0.0, # another new term ] params0 = np.array([p1_0, p2_0] + a0, dtype=float) # # Fit using nonlinear least squares (Levenberg–Marquardt) # result = least_squares( residuals, params0, args=(xs, ys), xtol=1e-14, ftol=1e-14, gtol=1e-14, max_nfev=5000 ) params = result.x p1_fit = params[0] p2_fit = params[1] a_fit = params[2:] # # Print fitted parameters # print("\nFitted parameters:") print(f"p1 = {p1_fit:.15g},") print(f"p2 = {p2_fit:.15g},") for i, ai in enumerate(a_fit, 1): print(f"a{i} = {ai:.15g},") # # Evaluate approximation error # approx_vals = approx_erf(params, xs) abs_err = np.abs(approx_vals - ys) print(f"\nMaximum absolute error on [{xmin},{xmax}]:", np.max(abs_err)) print("RMS error:", np.sqrt(np.mean(abs_err**2))) print("Done.")


All of these approximations are valid for erf(x) is an odd function, so N exponentials with increasing accuracy in terms of 2Q̃(√2x), where Q(x) ≈ Q̃(x), x ≥ 0. The coefficients n</sub>'',''b<sub>n</sub>'')}{{su|b=''n'' {{=}} 1|p=''N''}}"}},"i":0}}]}'>{(an,bn)}
n = 1
for many variations of the exponential approximations and bounds up to {A,B} that for all β can be picked to minimize error on the desired interval of approximation.

Another approximation is given by Sergei Winitzki using his "global Padé approximations": x. Using the alternate value The extended "global Pade" approximation, importnumpy,math fromscipy.optimizeimport least_squares # approximation to erf(x) defapprox_erf(p,x): frac=(4+p[0]*x**2+p[1]*x**4+p[2]*x**6)/( math.pi+p[3]*x**2+p[4]*x**4+p[5]*x**6) return numpy.sign(x)*numpy.sqrt( 1-numpy.exp(-x*x*frac)) defresiduals(params, xs, ys): return approx_erf(params, xs) - ys # data for fitting N = 200 xmin = 0 xmax = 9 xs = numpy.linspace(xmin, xmax, N) ys = numpy.array([math.erf(x) for x in xs], dtype=float) params0 = numpy.array([0.9,0.1,0.008,0.8,0.1,0.008], dtype=float) # fitting result = least_squares( residuals, params0, args=(xs, ys), xtol=1e-14, ftol=1e-14, gtol=1e-14, max_nfev=5000 ) params = result.x # print out fitted parameters print("\nFitted parameters:") for i, pi in enumerate(params, 0): print(f"p{i} = {pi:.15g},") # evaluate approximation error approx_vals = approx_erf(params, xs) abs_err = numpy.abs(approx_vals - ys) print(f"\nMaximum absolute error on [{xmin},{xmax}]:", numpy.max(abs_err)) print("RMS error:", numpy.sqrt(numpy.mean(abs_err**2))) print("Done.")

Winitzki's approximation can be inverted to obtain an approximation for the inverse error function: erf⁡(x)={1−τ,x≥0τ−1,x<0τ=t⋅exp⁡(−x2−1.26551223+1.00002368t+0.37409196t2+0.09678418t3−0.18628806t4+0.27886807t5−1.13520398t6+1.48851587t7−0.82215223t8+0.17087277t9)t=11+12|x|

An approximation of (≈1.1×10−16) in absolute value is: for x\\ge 0</math>,"}},"i":0}}]}'>x<0 Q(x)=12erfc⁡(x2), bounds developed for the Q-function can be adapted to approximate the complementary error function. A pair of tight lower and upper bounds on the Gaussian Q-function for positive arguments QB(x;a,b)=exp⁡(−x2)a+exp⁡(−x2/2)b(x+1), where the parameters aL=12 and bU=2. These expressions maintain simplicity and tightness, providing a practical trade-off between accuracy and ease of computation. They are particularly valuable in theoretical contexts, such as communication theory over fading channels, where both functions frequently appear. Additionally, the original Q-function bounds can be extended to erfc⁡(x), though this is less commonly required in error function applications.

Table of values

edit
x00.977435425 0.040.0676215940.909921874 0.10.2227025890.671373241 0.40.5204998780.396143909 0.70.7421009650.203091788 10.8802050700.089686022 1.30.9522851200.033894854 1.60.9837904590.010909498 1.90.9953222650.002979467 2.20.9988568230.000688514 2.50.9999779100.000000743

Related functions

edit

Complementary error function

edit
Plot of the error function erf(z) in the complex plane from erfc, is defined as erfc to avoid arithmetic underflow). Another form of erfc(x) = 2 − erfc(−x) to obtain erfc⁡(x+y∣x,y≥0)=2π∫0π2exp⁡(−x2sin2θ−y2cos2θ)dθ.

Imaginary error function

edit
Plot of the imaginary error function erfi(z) in the complex plane from erfi, is defined as erfi
to avoid arithmetic overflow).

Despite the name "imaginary error function", z, the resulting complex error function is usually discussed in scaled form as the Faddeeva function: norm(x) by some software languageserf and Q(x)=12−12erf⁡(x2)=12erfc⁡(x2).

The inverse of P and the incomplete gamma function, inerfc⁡(z)=∫z∞in−1erfc⁡(ζ)dζi0erfc⁡(z)=erfc⁡(z)i1erfc⁡(z)=ierfc⁡(z)=1πe−z2−zerfc⁡(z)i2erfc⁡(z)=14(erfc⁡(z)−2zierfc⁡(z))

The general recurrence formula is i2merfc⁡(−z)=−i2merfc⁡(z)+∑q=0mz2q22(m−q)−1(2q)!(m−q)! and Weisstein, Eric W. "Erf". MathWorld.

  • ↑ Schöpf & Supancic (2014).
  • ↑ Weisstein, Eric W. "Bürmann's Theorem". MathWorld.
  • ↑ Schlömilch, Oskar Xavier (1859). "Ueber facultätenreihen". Zeitschrift für Mathematik und Physik (in German). 4: 390–415.
  • ↑ Nielson (1906), p. 283, eq. 3.
  • ↑ Tanash, I.M.; Riihonen, T. (2020). "Global minimax approximations and bounds for the Gaussian Q-function by sums of exponentials". IEEE Transactions on Communications. 68 (10): 6514–6524. arXiv:2007.06939. Bibcode:2020ITCom..68.6514T. doi:10.1109/TCOMM.2020.3006902. S2CID 220514754.
  • ↑ Tanash, I.M.; Riihonen, T. (2021). "Improved coefficients for the Karagiannidis–Lioumpas approximations and bounds to the Gaussian Q-function". IEEE Communications Letters. 25 (5): 1468–1471. arXiv:2101.07631. Bibcode:2021IComL..25.1468T. doi:10.1109/LCOMM.2021.3052257. S2CID 231639206.
  • ↑ Zeng, Caibin; Chen, Yang Cuan (2015). "Global Padé approximations of the generalized Mittag-Leffler function and its inverse". Fractional Calculus and Applied Analysis. 18 (6): 1492–1506. arXiv:1310.5592. doi:10.1515/fca-2015-0086. S2CID 118148950. Indeed, Winitzki [32] provided the so-called global Padé approximation
  • ↑ ","href":"./Template:Cite_web"},"params":{"url":{"wt":"https://www.academia.edu/9730974/A_handy_approximation_for_the_error_function_and_its_inverse"},"last":{"wt":"Winitzki"},"first":{"wt":"Sergei"},"date":{"wt":"6 February 2008"},"title":{"wt":"A handy approximation for the error function and its inverse"}},"i":0}}]}'/>Winitzki, Sergei (6 February 2008). "A handy approximation for the error function and its inverse".
  • ↑ Abreu, Giuseppe (2012). "Very Simple Tight Bounds on the Q-Function". IEEE Transactions on Communications. 60 (9): 2415–2420. Bibcode:2012ITCom..60.2415A. doi:10.1109/TCOMM.2012.080612.110075.
  • 1 2 3 Behnad, Aydin (2020). "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. Bibcode:2020ITCom..68.4117B. doi:10.1109/TCOMM.2020.2986209. S2CID 216500014.
  • ↑ "Special Functions – GSL 2.7 documentation".
  • References

    edit

    View original on Wikipedia | Back | FazBrowse Home