Error function
erf(
returns the Error Function evaluated for each element
of x
)x
.
You can also find the standard normal probability
distribution using the function normcdf
(Statistics and Machine Learning Toolbox). The relationship between the error
function erf
and normcdf
is
For expressions of the form 1 - erf(x)
,
use the complementary error function erfc
instead.
This substitution maintains accuracy. When erf(x)
is
close to 1
, then 1 - erf(x)
is
a small number and might be rounded down to 0
.
Instead, replace 1 - erf(x)
with erfc(x)
.