Computes the error function, or its inverse, based on the normal distribution. Also computes the complement of the error function, or its inverse,
erf(x, inverse = FALSE)
erfc(x, inverse = FALSE)
Numeric.
Logical. Of length 1.
Returns the value of the function evaluated at x
.
pnorm
.
The inverse function is defined for
Abramowitz, M. and Stegun, I. A. (1972) Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables, New York: Dover Publications Inc.
# NOT RUN {
curve(erf, -3, 3, col = "orange", ylab = "", las = 1)
curve(pnorm, -3, 3, add = TRUE, col = "blue", lty = "dotted", lwd = 2)
abline(v = 0, h = 0, lty = "dashed")
legend("topleft", c("erf(x)", "pnorm(x)"), col = c("orange", "blue"),
lty = c("solid", "dotted"), lwd = 1:2)
# }
Run the code above in your browser using DataLab