diff scripts/statistics/distributions/stdnormal_cdf.m @ 10523:e74bff13aa26

improve stdnormal_cdf accuracy by using erfc (bug #29543)
author Jaroslav Hajek <highegg@gmail.com>
date Thu, 15 Apr 2010 21:10:07 +0200
parents a1dbe9d80eee
children 1740012184f9
line wrap: on
line diff
--- a/scripts/statistics/distributions/stdnormal_cdf.m
+++ b/scripts/statistics/distributions/stdnormal_cdf.m
@@ -37,7 +37,7 @@
     error ("stdnormal_cdf: x must not be empty");
   endif
 
-  cdf = (ones (sz) + erf (x / sqrt (2))) / 2;
+  cdf = erfc (x / (-sqrt(2))) / 2;
 
 endfunction