changeset 14760:8d3ab19f8599

Fix logncdf tests to use more accurate expected result. * scripts/statistics/distributions/logncdf.m: use erf(1/sqrt(2)*1/sqrt(2)) instead of erf(1/2) to avoid floating point errors that are below eps (alternate solution would be to add tolerance to the tests).
author Michael Goffioul <michael.goffioul@gmail.com>
date Tue, 12 Jun 2012 19:50:13 +0100
parents 2feab289622a
children 154c150f6a21
files scripts/statistics/distributions/logncdf.m
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/statistics/distributions/logncdf.m	Tue Jun 12 19:44:09 2012 +0100
+++ b/scripts/statistics/distributions/logncdf.m	Tue Jun 12 19:50:13 2012 +0100
@@ -73,7 +73,7 @@
 
 %!shared x,y
 %! x = [-1 0 1 e Inf];
-%! y = [0, 0, 0.5, 1/2+1/2*erf(1/2), 1];
+%! y = [0, 0, 0.5, 1/2+1/2*erf((1/sqrt(2))*(1/sqrt(2))), 1];
 %!assert (logncdf (x, zeros (1,5), sqrt(2)*ones (1,5)), y)
 %!assert (logncdf (x, 0, sqrt(2)*ones (1,5)), y)
 %!assert (logncdf (x, zeros (1,5), sqrt(2)), y)