Error Function Matlab Code
Contents |
X = erfinv(Y) Inverse of the error function Definition The error function erf(X) is twice the integral of inverse error function matlab the Gaussian distribution with 0 mean and variance of:
The matlab error function definitions are not permitted in this context complementary error function erfc(X) is defined as: The scaled complementary error function erfcx(X) is defined matlab error function fit as: For large X, erfcx(X) is approximately . Description Y = erf(X) returns the value of the error function for each element of real array q function matlab X. Y = erfc(X) computes the value of the complementary error function. Y = erfcx(X) computes the value of the scaled complementary error function. X = erfinv(Y) returns the value of the inverse error function for each element of Y. The elements of Y must fall within the domain Examples erfinv(1)Gamma Function Matlab
is Inf
erfinv(-1) is -Inf. For abs(Y) > 1, erfinv(Y) is NaN. Remarks The relationship between the error function and the standard normal probability distribution is: x = -5:0.1:5; standard_normal_cdf = (1 + (erf(x/sqrt(2))))./2; Algorithms For the error functions, the MATLAB code is a translation of a Fortran program by W. J. Cody, Argonne National Laboratory, NETLIB/SPECFUN, March 19, 1990. The main computation evaluates near-minimax rational approximations from [1]. For the inverse of the error function, rational approximations accurate to approximately six significant digits are used to generate an initial approximation, which is then improved to full accuracy by two steps of Newton's method. The M-file is easily modified to eliminate the Newton improvement. The resulting code is about three times faster in execution, but is considerably less accurate. References [1] Cody, W. J., "Rational Chebyshev Approximations for the Error Function," Math. Comp., pgs. 631-638, 1969 [ Previous | Help Desk | Next ]Search All Support Resources Support Documentation MathWorks Search MathWorks.com MathWorks Documentation Support Documentation Toggle navigation Trial Software Product Updates Documentation
Gaussian Function Matlab
Home Symbolic Math Toolbox Examples Functions and Other Reference Release Notes normal distribution matlab PDF Documentation Mathematics Mathematical Functions Symbolic Math Toolbox Functions erf On this page Syntax Description Examples error function mathematica Error Function for Floating-Point and Symbolic Numbers Error Function for Variables and Expressions Error Function for Vectors and Matrices Special Values of Error Function Handling Expressions That http://cens.ioc.ee/local/man/matlab/techdoc/ref/erf.html Contain Error Function Plot Error Function Input Arguments X More About Error Function Tips Algorithms References See Also This is machine translation Translated by Mouse over text to see original. Click the button below to return to the English verison of the page. Back to English × Translate This Page Select Language Bulgarian Catalan Chinese https://www.mathworks.com/help/symbolic/erf.html Simplified Chinese Traditional Czech Danish Dutch English Estonian Finnish French German Greek Haitian Creole Hindi Hmong Daw Hungarian Indonesian Italian Japanese Korean Latvian Lithuanian Malay Maltese Norwegian Polish Portuguese Romanian Russian Slovak Slovenian Spanish Swedish Thai Turkish Ukrainian Vietnamese Welsh MathWorks Machine Translation The automated translation of this page is provided by a general purpose third party translator tool. MathWorks does not warrant, and disclaims all liability for, the accuracy, suitability, or fitness for purpose of the translation. Translate erfError functioncollapse all in page Syntaxerf(X) exampleDescriptionexampleerf(X
) represents the error function of X. If X is a vector or a matrix, erf(X) computes the error function of each element of X.ExamplesError Function for Floating-Point and Symbolic Numbers Depending on its arguments, erf can return floating-point or exact symbolic results. Compute the error function for these numbers. Because these numbers are not symbolic objects, you get the floating-point results:A = [erf(1/2), erf(1.41), erf(sqrt(2))]A = 0.5205 0.9539 0.9545Compute the error function for
X = erfinv(Y) Inverse of the error function Definition The error function erf(X) is twice the integral of http://cens.ioc.ee/local/man/matlab/techdoc/ref/erf.html the Gaussian distribution with 0 mean and variance of:
The http://www.obs.ujf-grenoble.fr/scci/logiciels/matlab61/help/techdoc/ref/erf.html complementary error function erfc(X) is defined as: The scaled complementary error function erfcx(X) is defined as: For large X, erfcx(X) is approximately . Description Y = erf(X) returns the value of the error function for each element of real array error function X. Y = erfc(X) computes the value of the complementary error function. Y = erfcx(X) computes the value of the scaled complementary error function. X = erfinv(Y) returns the value of the inverse error function for each element of Y. The elements of Y must fall within the domain Examples erfinv(1) error function matlab is Inf erfinv(-1) is -Inf. For abs(Y) > 1, erfinv(Y) is NaN. Remarks The relationship between the error function and the standard normal probability distribution is: x = -5:0.1:5; standard_normal_cdf = (1 + (erf(x/sqrt(2))))./2; Algorithms For the error functions, the MATLAB code is a translation of a Fortran program by W. J. Cody, Argonne National Laboratory, NETLIB/SPECFUN, March 19, 1990. The main computation evaluates near-minimax rational approximations from [1]. For the inverse of the error function, rational approximations accurate to approximately six significant digits are used to generate an initial approximation, which is then improved to full accuracy by two steps of Newton's method. The M-file is easily modified to eliminate the Newton improvement. The resulting code is about three times faster in execution, but is considerably less accurate. References [1] Cody, W. J., "Rational Chebyshev Approximations for the Error Function," Math. Comp., pgs. 631-638, 1969 [ Previous | Help Desk | Next ]= erfcinv(Y) Inverse complementary error function Definition The error function erf(X) is twice the integral of the Gaussian distribution with 0 mean and variance of . The complementary error function erfc(X) is defined as The scaled complementary error function erfcx(X) is defined as For large X, erfcx(X) is approximately Description Y = erf(X) returns the value of the error function for each element of real array X. Y = erfc(X) computes the value of the complementary error function. Y = erfcx(X) computes the value of the scaled complementary error function. X = erfinv(Y) returns the value of the inverse error function for each element of Y. Elements of Y must be in the interval [-1 1]. The function erfinv satisfies for and . X = erfcinv(Y) returns the value of the inverse of the complementary error function for each element of Y. Elements of Y must be in the interval [0 2]. The function erfcinv satisfies for and . Remarks The relationship between the complementary error function erfc and the standard normal probability distribution returned by the Statistics Toolbox function normcdf is The relationship between the inverse complementary error function erfcinv and the inverse standard normal probability distribution returned by the Statistics Toolbox function norminv is Examples erfinv(1) is Inf erfinv(-1) is -Inf. For abs(Y) > 1, erfinv(Y) is NaN. Algorithms For the error functions, the MATLAB code is a translation of a Fortran program by W. J. Cody, Argonne National Laboratory, NETLIB/SPECFUN, March 19, 1990. The main computation evaluates near-minimax rational approximations from [1]. For the inverse of the error function, rational approximations accurate to approximately six significant digits are used to generate an initial approximation, which is then improved to full accuracy by one step of Halley's method. References [1] Cody, W. J., "Rational Chebyshev Approximations for the Error Function," Math. Comp., pgs. 631-638, 1969 epserror