erf                   package:VGAM                   R Documentation

_E_r_r_o_r _F_u_n_c_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     Computes the error function based on the normal distribution.

_U_s_a_g_e:

     erf(x)

_A_r_g_u_m_e_n_t_s:

       x: Numeric. 

_D_e_t_a_i_l_s:

     Erf(x) is defined as

              Erf(x) = (2/sqrt(pi)) int_0^x exp(-t^2) dt

     so that it is closely related to 'pnorm'.

_V_a_l_u_e:

     Returns the value of the function evaluated at 'x'.

_N_o_t_e:

     Some authors omit the term 2/sqrt(pi) from the definition of
     Erf(x). Although defined for complex arguments, this function only
     works for real arguments.

     The _complementary error function_ erfc(x) is defined as 1-erf(x),
     and is implemented by 'erfc'.

_A_u_t_h_o_r(_s):

     T. W. Yee

_R_e_f_e_r_e_n_c_e_s:

     Abramowitz, M. and Stegun, I. A. (1972) _Handbook of Mathematical
     Functions with Formulas, Graphs, and Mathematical Tables_, New
     York: Dover Publications Inc.

_S_e_e _A_l_s_o:

     'pnorm'.

_E_x_a_m_p_l_e_s:

     ## Not run: 
     x = seq(-3, 3, len=200)
     plot(x, erf(x), type="l", col="red", las=1, lwd=2,
          main="red is erf(x), blue is pnorm(x)")
     abline(v=0, h=0, lty="dashed", col="black")
     lines(x, pnorm(x), col="blue", lty="dotted", lwd=2)
     ## End(Not run)

