Python Gaussian Error Function
Contents |
2/sqrt(pi)*integral(exp(-t**2), t=0..z). Parameters:x module 'scipy' has no attribute 'special' : ndarray Input array. Returns:res : ndarray The values of
Scipy Erfinv
the error function at the given points x. See also erfc, erfinv, erfcinv Notes The cumulative of the unit normal distribution
Complementary Error Function
is given by Phi(z) = 1/2[1 + erf(z/sqrt(2))]. References [R200]http://en.wikipedia.org/wiki/Error_function [R201]Milton Abramowitz and Irene A. Stegun, eds. Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables. New York: Dover, 1972. http://www.math.sfu.ca/~cbm/aands/page_297.htm [R202]Steven G. Johnson, Faddeeva W function implementation. http://ab-initio.mit.edu/Faddeeva Previous topic scipy.special.multigammaln Next topic scipy.special.erfc © Copyright 2008-2009, The Scipy community. Last updated on May 11, 2014. Created using Sphinx 1.2.2.
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta error function calculator Discuss the workings and policies of this site About Us Learn more
Error Function Table
about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack erf(inf) Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.special.erf.html each other. Join them; it only takes a minute: Sign up Is there an easily available implementation of erf() for Python? up vote 36 down vote favorite 7 I can implement the error function, erf, myself, but I'd prefer not to. Is there a python package with no external dependencies that contains an implementation of this function? http://stackoverflow.com/questions/457408/is-there-an-easily-available-implementation-of-erf-for-python I have found http://pylab.sourceforge.net/packages/included_functions.html>this but this seems to be part of some much larger package (and it's not even clear which one!). I'm sorry if this is a naive question - I'm totally new to Python. python math share|improve this question asked Jan 19 '09 at 12:10 rog 2,21211721 add a comment| 7 Answers 7 active oldest votes up vote 44 down vote Since v.2.7. the standard math module contains erf function. This should be the easiest way. http://docs.python.org/2/library/math.html#math.erf share|improve this answer edited Nov 19 '13 at 14:28 Colonel Panic 53.3k33221278 answered Jul 12 '11 at 9:31 bezalel 59146 1 +1: simplest answer. –Neil G Dec 21 '11 at 4:42 Wow! Never noticed that! –smci May 20 '13 at 23:30 Is there a Python module that provides erf⻹(x) ? –Lori Feb 1 '15 at 22:49 add a comment| up vote 39 down vote I recommend SciPy for numerical functions in Python, but if you want something with no dependencies, here is a function with an
Random Entry New in MathWorld MathWorld Classroom About MathWorld Contribute to MathWorld Send a Message to the Team MathWorld Book Wolfram Web Resources» 13,594 entries Last updated: Wed Oct 19 http://mathworld.wolfram.com/Erf.html 2016 Created, developed, and nurturedbyEricWeisstein at WolframResearch Calculus and Analysis>Special Functions>Erf> Calculus and Analysis>Complex Analysis>Entire Functions> Interactive Entries>webMathematica Examples> More... History and Terminology>Wolfram Language Commands> MathWorld Contributors>D'Orsogna> Less... Erf is the "error function" encountered in integrating the normal distribution (which is a normalized form of the Gaussian function). It is an entire function defined by (1) Note error function that some authors (e.g., Whittaker and Watson 1990, p.341) define without the leading factor of . Erf is implemented in the Wolfram Language as Erf[z]. A two-argument form giving is also implemented as Erf[z0, z1]. Erf satisfies the identities (2) (3) (4) where is erfc, the complementary error function, and is a confluent hypergeometric function of python gaussian error the first kind. For , (5) where is the incomplete gamma function. Erf can also be defined as a Maclaurin series (6) (7) (OEIS A007680). Similarly, (8) (OEIS A103979 and A103980). For , may be computed from (9) (10) (OEIS A000079 and A001147; Acton 1990). For , (11) (12) Using integration by parts gives (13) (14) (15) (16) so (17) and continuing the procedure gives the asymptotic series (18) (19) (20) (OEIS A001147 and A000079). Erf has the values (21) (22) It is an odd function (23) and satisfies (24) Erf may be expressed in terms of a confluent hypergeometric function of the first kind as (25) (26) Its derivative is (27) where is a Hermite polynomial. The first derivative is (28) and the integral is (29) Min Max Re Im Erf can also be extended to the complex plane, as illustrated above. A simple integral involving erf that Wolfram Language cannot do is given by (30) (M.R.D'Orsogna, pers. comm., May 9, 2004). More complicated integrals include (3