bugGNU Octave - Bugs: bug #60783, hist: better documentation for...

 
 

bug #60783: hist: better documentation for third "norm" parameter

Submitted by:  Kai Torben Ohlhus <siko1056>
Submitted on:  Wed 16 Jun 2021 01:32:10 AM UTC  
 
Category:  Octave Function Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Documentation
Status:  Fixed Assigned to:  Kai Torben Ohlhus <siko1056>
Originator Name:  Open/Closed:  Closed
Release:  6.2.0 Operating System:  Any

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

( Jump to the original submission)

Mon 21 Jun 2021 06:36:47 AM UTC, comment #6: 

Thanks for the pointer Markus 🙂  I think changing to a deterministic test matrix is the safer approach.

Fixed with this cset: https://hg.savannah.gnu.org/hgweb/octave/rev/eece40ca8c2a

Closing as fixed if no further issues occur.

Kai Torben Ohlhus <siko1056>
Project MemberIn charge of this item.
Mon 21 Jun 2021 06:22:01 AM UTC, comment #5: 

E.g. on jwe's buildbot:
http://buildbot.octave.org:8010/#/builders/33/builds/687/steps/7/logs/stdio

>>>>> processing /scratch/buildbot/workers/jwe-debian-x86_64-3/gcc-debian/src/scripts/plot/draw/hist.m
***** test <*60783>
[nn, xx] = hist (rand (10, 3), 5, 1);
assert (sum (nn, 1), [1 1 1], 2*eps);
[nn, xx] = hist (rand (10, 3), 5, [1 2 3]);
assert (sum (nn, 1), [1 2 3], 2*eps);
[nn, xx] = hist (rand (10, 3), 5, [1 2 3]');
assert (sum (nn, 1), [1 2 3], 2*eps);
!!!!! regression: https://octave.org/testfailure/?60783
ASSERT errors for:  assert (sum (nn, 1),[1, 2, 3],2 * eps)
  Location  |  Observed  |  Expected  |  Reason
    (3)           3            3         Abs err 8.8818e-16 exceeds tol 4.4409e-16 by 4e-16

Markus Mützel <mmuetzel>
Project Member
Mon 21 Jun 2021 01:17:04 AM UTC, comment #4: 

Can you provide a pointer (url or console output) to such an failure?  jwe's Buildbots and my systems seem fine 🤔

Instead of seeds or increasing the tolerances, we could consider changing the example to something static, depending on what is going wrong.

Kai Torben Ohlhus <siko1056>
Project MemberIn charge of this item.
Sun 20 Jun 2021 10:23:34 AM UTC, comment #3: 

The BIST that was added for this change fails intermittently.

Should we set a seed before creating the random matrices to make the tests reproducible?

Markus Mützel <mmuetzel>
Project Member
Wed 16 Jun 2021 06:56:53 AM UTC, comment #2: 
Kai Torben Ohlhus <siko1056>
Project MemberIn charge of this item.
Wed 16 Jun 2021 01:33:49 AM UTC, comment #1: 

An undocumented "feature" is that for each bar a different "norm" is possible

>> [nn, xx] = hist(rand(10,2),0:5, [1 2]); nn', xx'
ans =

   0.7000   0.3000        0        0        0        0
   1.2000   0.8000        0        0        0        0

ans =

   0   1   2   3   4   5

Kai Torben Ohlhus <siko1056>
Project MemberIn charge of this item.
Wed 16 Jun 2021 01:32:10 AM UTC, original submission:  

In addition to bug #42394, it is not really specified what the third norm parameter should be.

This recently led to confusion https://octave.discourse.group/t/parameter-norm-for-function-hist/1262/2 how to use it properly.

In essence: "norm" can either be a scalar, or a (row) vector with as many elements as bars are given

>> [nn, xx] = hist(rand(10,2),0:5); nn', xx'
ans =

   5   5   0   0   0   0
   4   6   0   0   0   0

ans =

   0   1   2   3   4   5

>> [nn, xx] = hist(rand(10,2),0:5, 1); nn', xx'
ans =

   0.6000   0.4000        0        0        0        0
   0.5000   0.5000        0        0        0        0

ans =

   0   1   2   3   4   5

>> [nn, xx] = hist(rand(10,2),0:5, [1 1]); nn', xx'
ans =

   0.6000   0.4000        0        0        0        0
   0.5000   0.5000        0        0        0        0

ans =

   0   1   2   3   4   5

>> [nn, xx] = hist(rand(10,2),0:5, [1 1]'); nn', xx'
error: .*=: nonconformant arguments (op1 is 6x2, op2 is 2x2)
error: called from
    hist at line 230 column 10
>> [nn, xx] = hist(rand(10,2),0:5, [1 1 1]); nn', xx'
error: quotient: nonconformant arguments (op1 is 1x3, op2 is 1x2)
error: called from
    hist at line 230 column 10

Kai Torben Ohlhus <siko1056>
Project MemberIn charge of this item.

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by siko1056 (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-06-21 siko1056 StatusNeed Info => Fixed
        Open/ClosedOpen => Closed
    2021-06-20 mmuetzel StatusFixed => Need Info
        Open/ClosedClosed => Open
    2021-06-16 siko1056 StatusIn Progress => Fixed
        Open/ClosedOpen => Closed

    Back to the top


    Powered by Savane 3.7