bugGNU Octave - Bugs: bug #45378, Tests for z_test_2.m.

 
 

bug #45378: Tests for z_test_2.m.

Submitter:  Allan Jacobs <allanjacobs>
Submitted:  Mon 22 Jun 2015 07:20:02 PM UTC
   
 
Category:  Octave Function Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Other
Status:  Fixed Assigned to:  None
Originator Name:  allanjacobs Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 11 Aug 2017 06:28:43 PM UTC, comment #4: 

The test failure(s) were due to a couple of typos.  I fixed those and pushed the changeset here:

http://hg.savannah.gnu.org/hgweb/octave/rev/89a1ed157a2a

John W. Eaton <jwe>
Group administrator
Wed 18 Jan 2017 05:04:13 PM UTC, comment #3: 

Opening this bug report. Seems to be close by mistake

Avinoam Kalma <avinoam>
Group Member
Mon 29 Jun 2015 03:41:01 AM UTC, comment #2: 

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)

Rik <rik5>
Group administrator
Thu 25 Jun 2015 05:02:41 PM UTC, comment #1: 

Thanks for your contribution. Marking as having a patch submitted, someone will review your change and provide feedback or merge it into the Octave repo.

Mike Miller <mtmiller>
Group Member
Mon 22 Jun 2015 07:20:02 PM UTC, original submission:  

Six tests for z_test_2.m are added.  Three are derived from those in z_test.m.  The source code difference file z_test_2.diff is attached.

Allan Jacobs <allanjacobs>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #34336:  z_test_2.cset added by rik5 (3KiB - application/octet-stream)
file #34296:  z_test_2.diff added by allanjacobs (3KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by avinoam (Posted a comment)
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by allanjacobs (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-08-11 jwe StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2017-01-18 avinoam Open/ClosedClosed Open
    2015-09-22 rik5 Open/ClosedOpen Closed
    2015-06-29 rik5 Attached File- Added z_test_2.cset, #34336
    2015-06-25 mtmiller Severity3 - Normal 2 - Minor
        Item GroupNone Other
        StatusNone Patch Submitted
    2015-06-22 allanjacobs Attached File- Added z_test_2.diff, #34296

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code