[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #45378] Tests for z_test_2.m.
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #45378] Tests for z_test_2.m. |
Date: |
Mon, 29 Jun 2015 03:41:01 +0000 |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 |
Follow-up Comment #2, bug #45378 (project octave):
I reviewed the patch and made some changes. First, Octave uses a space
between the name of the function and the opening parenthesis in order to
distinguish from the case of indexing a variable. I added appropriate spaces.
Second, the code failed to run. I used 'test z_test_2' from within Octave
and apparently there were different names for the same variable 'nx' and
'n_x'. I renamed 'nx' to 'n_x' and 'ny' to 'n_y' and now the code runs, but
it produces the error below.
test z_test_2
***** test
x = randn (10000, 1); v_x = 2; x = v_x * x; n_x = length (x);
y = randn (20000, 1); v_y = 3; y = v_y * y; n_y = length (y);
[pval, z] = z_test_2 (x, y, v_x, v_y, ">");
zval = norminv (1-pval);
unew = zval * sqrt (v_x/n_x + v_y/n_y);
delmu = mean (x) - mean (y);
assert (delmu, unew, 100*eps);
x = randn (100, 1); v_x = 2; x = v_x * x;
[pval, z] = z_test_2 (x, x, v_x, v_x, "<");
zval_exp = 0; pval_exp = 0.5;
assert (zval, zval_exp, eps);
assert (pval, pval_exp, eps);
!!!!! test failed
ASSERT errors for: assert (zval,zval_exp,eps)
Location | Observed | Expected | Reason
() -1.2173 0 Abs err 1.2173 exceeds tol
2.2204e-16
Since I don't particularly understand what the tolerance should be, I am
returning the updated changeset to this bug report. See the attached file.
(file #34336)
_______________________________________________________
Additional Item Attachment:
File name: z_test_2.cset Size:2 KB
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?45378>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/