bugGNU Octave - Bugs: bug #51059, statistics: hist3 function doesn't...

 
 

bug #51059: statistics: hist3 function doesn't handle NaN inputs properly

Submitted by:  None
Submitted on:  Thu 18 May 2017 02:11:47 PM UTC  
 
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Alastair HarrisonOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 4.2.1
Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Fri 19 May 2017 11:16:26 AM UTC, comment #5:

> Actually there's still an issue if after nan-removal the matrix X becomes empty. I think there needs to be another empty check just after line 97.


Looking at this better, there's actually a bunch of other special cases. The NaN needs to be removed after computing the edges only. Also we need to center the values in the histogram if all values are the same

http://hg.code.sf.net/p/octave/statistics/rev/498e4ee08706

Carnë Draug <carandraug>
Project Member
Thu 18 May 2017 03:33:42 PM UTC, comment #4:

Actually there's still an issue if after nan-removal the matrix X becomes empty. I think there needs to be another empty check just after line 97.

Anonymous
Thu 18 May 2017 03:30:26 PM UTC, comment #3:

Thank you for the fix. I have pushed your proposed fix and test http://hg.code.sf.net/p/octave/statistics/rev/9cab018f36a5

Carnë Draug <carandraug>
Project Member
Thu 18 May 2017 02:27:18 PM UTC, comment #2:

So sorry, it seems my markup was malformed. One last try:

In statistics 1.3.0, hist3 doesn't appear to do the right thing for inputs containing NaN values. The code appears to try to ignore input rows containing NaN values, but instead it ends up turning the input matrix into a column vector with NaNs removed.

Reproduce like this:

I think the problem is on line 97:

Should be:

Here's a unit test that exercises the NaN-suppression code:

Anonymous
Thu 18 May 2017 02:24:50 PM UTC, comment #1:

Sorry, my original submission seems to have been truncated. Hopefully the remainder won't be.

I think the problem is on line 97:

Anonymous
Thu 18 May 2017 02:11:47 PM UTC, original submission:

In statistics 1.3.0, hist3 doesn't appear to do the right thing for inputs containing NaN values. The code appears to try to ignore input rows containing NaN values, but instead it ends up turning the input matrix into a column vector with NaNs removed.

Reproduce like this:

I think the problem is on line 97:

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by None (Submitted the item)
  •  

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

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 18 May 2017 03:30:34 PM UTCcarandraugSummaryhist3 function doesn't handle NaN inputs properly=>statistics: hist3 function doesn't handle NaN inputs properly
    Thu 18 May 2017 03:30:26 PM UTCcarandraugStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1