erf takes as argument a number a.
erf returns the floating point value of the error function at x=a,
where the error function is defined by:
erf(x)= |
| ∫ |
| e−t2dt |
The normalization is chosen so that:
erf(+∞)=1, erf(−∞)=−1 |
since:
∫ |
| e−t2dt= |
|
Input:
Output:
Input:
Output:
Remark
The relation between erf and normal_cdf is:
normal_cdf(x)= |
| + |
| erf( |
| ) |
Indeed, making the change of variable t=u*√2 in
normal_cdf(x)= |
| + |
| ∫ |
| e−t2/2dt |
gives:
normal_cdf(x)= |
| + |
| ∫ |
| e−u2du= |
| + |
| erf( |
| ) |
Check:
normal_cdf(1)=0.841344746069