How To Calculate Error Function In Matlab
Contents |
Search All Support Resources Support Documentation MathWorks Search MathWorks.com MathWorks Documentation Support Documentation Toggle navigation Trial Software Product Updates Documentation Home MATLAB Examples Functions Release Notes erfc matlab PDF Documentation Mathematics Elementary Math Special Functions MATLAB Functions erf On this
Complementary Error Function
page Syntax Description Examples Find Error Function Find Cumulative Distribution Function of Normal Distribution Calculate Solution of Heat
Erf Function Calculator
Equation with Initial Condition Input Arguments x More About Error Function Tall Array Support Tips See Also This is machine translation Translated by Mouse over text to see original.
Error Function Table
Click the button below to return to the English verison of the page. Back to English × Translate This Page Select Language Bulgarian Catalan Chinese 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 inverse error function 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
) returns the Error Function evaluated for each element of x.Examplescollapse allFind Error FunctionOpen ScriptFind the error function of a value.erf(0.76) ans = 0.7175 Find the error function of the elements of a vector.V = [-0.5 0 1 0.72]; erf(V) ans = -0.5205 0 0.8427 0.6914 Find the error function of the elements of a matrix.M = [0.29 -0.11; 3.1 -2.9]; erf(M) ans = 0.3183 -0.1236 1.0000 -1.0000 Find Cumulative Distribution Function of Normal DistributionOpen ScriptThe cumulative distribution function (CDF) of the normal, or Gaussian, distribution with standard deviation and mean is Note that for increased computational accuracy, you can rewrite the formula in terms of erfc . For details, see Tips.Plot the CDF of the normal distribution with and .x = -3:0.1:3; y = (1/2)*(1
Search All Support Resources Support Documentation MathWorks Search MathWorks.com MathWorks Documentation Support Documentation Toggle navigation Trial Software Product Updates Documentation Home Symbolic Math Toolbox Examples erf function excel Functions and Other Reference Release Notes PDF Documentation Mathematics Mathematical Functions error matlab Symbolic Math Toolbox Functions erfc On this page Syntax Description Examples Complementary Error Function for Floating-Point and Symbolic erf(2/sqrt(2)) Numbers Error Function for Variables and Expressions Complementary Error Function for Vectors and Matrices Special Values of Complementary Error Function Handling Expressions That Contain Complementary Error Function Plot Complementary https://www.mathworks.com/help/matlab/ref/erf.html Error Function Input Arguments X K More About Complementary Error Function Iterated Integral of Complementary 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/erfc.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 erfcComplementary error functioncollapse all in page Syntaxerfc(X) exampleerfc(K,X) exampleDescriptionexampleerfc(X
) represents the complementary error function of X, that is,erfc(X) = 1 - erf(X).exampleerfc(K
,X) represents the iterated integral of the complementary error function of X, that is, erfc(K, X) = int(erfc(K - 1, y), y, X, inf).ExamplesComplementary Error Function for Floating-Point and Symbolic Numbers Depending on its arguments, erfc can return floating-point or exact symbolic results. Compute the complementary error function for these numbers. Because these numbers are not symbolic objects, you get the floating-point results:A = [erfc(1/2), erfc(1.41), erfc(sqrt(2))]A = 0.4795 0.0461 0.0455
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.matlab-cookbook.com/recipes/0100_Statistics/010_sem.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) how to calculate 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 ]to divide this by the square root of the sample size to get the standard error of the mean (SEM). data=randn(1,30); sem=std(data)/sqrt(length(data)) % standard error of the mean sem = 0.1813 The standard deviation describes the spread of a sample distribution. The SEM describes certainty with which we know the mean of the underlying population based upon our sample of it. More specifically, the SEM is the theoretical standard deviation of the sample-mean's estimate of a population mean. To make the SEM more informative we can convert it to a confidence interval. With a confidence interval, we can say that (assuming normality) there is an X% chance that the underlying population mean falls within certain limits. We can calculate the limits for whatever certainty level we like. A 95% confidence interval tells us that there's a 95% chance that the underlying population mean falls within a certain range of values. Calculating that is easy: it's simply a matter of scaling the SEM by the appropriate quantile from the normal distribution. For example, 95% of the data will fall within 1.96 standard deviations of a normal distribution. So the 95% confidence limits are: data=randn(1,30); sem=std(data)/sqrt(length(data)); % standard error of the mean sem = sem * 1.96 % 95% confidence interval sem = 0.3553 If you know the appropriate quantile from the normal distribution then you can calculate any confidence interval you like. You either look it up in a table or, better yet, use MATLAB's norminv command. The SEM_calc.m function does this for you. Note, however, that norminv is part of the Statistics Toolbox.
Finally, MATLAB's stats toolbox also offers other distributions, such as the t-distribution which is the interval the t-test is based on. The tInterval_Calc.m function computes the t-interval for a distribution. Both the t-interval and SEM functions linked to here contain extra error checking code. They ignore NaNs, for example. Discussion We've talked about how to calculate the S