bugGNU Octave - Bugs: bug #48889, rose() angular histogram incorrect...

 
 

bug #48889: rose() angular histogram incorrect for certain bin centers

Submitter:  Rik <rik5>
Submitted:  Wed 24 Aug 2016 08:29:59 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  rik5
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  9.1.0 Planned Release:  9.1.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Tue 26 Dec 2023 07:10:01 PM UTC, comment #10: 

This turned out to be a huge project.  I overhauled the function in this changeset: https://hg.savannah.gnu.org/hgweb/octave/rev/475939906cbb.  I added several BIST tests for corner cases exposed by this bug report.

Marking as Fixed again and closing report.

Rik <rik5>
Group administrator
Thu 21 Dec 2023 08:40:34 PM UTC, comment #9: 

You're correct that there does seem to be an issue here.  Re-opening the bug report.

Rik <rik5>
Group administrator
Thu 21 Dec 2023 04:54:50 PM UTC, comment #8: 

I used ver6.3 and did the following:

>>[t1,r1] = rose( [1:1:360]/180*pi , [0:10:350]/180*pi )
>>polar(ti,r1)


and got an uneven rose at about 0. Similar in matlab produces a even rose.  Shouldn't we get a even rose in Octave also since the background distribution is even?

Idar Barstad <idar>
Tue 27 Sep 2016 08:51:01 AM UTC, comment #7: 

This was far trickier than I expected.  There is a questionable choice in the algorithm used by Matlab for rose which means that the first and last bins may not be centered on the values specified by the user.  I added a Programming Note to the documentation, and also a warning() if the situation is encountered.  Matlab itself is now trying to deprecate rose in favor of polarhistogram which does not have this issue.

See cset http://hg.savannah.gnu.org/hgweb/octave/rev/e9f77d099a63.

Fixed, closing report.

Rik <rik5>
Group administrator
Wed 07 Sep 2016 03:52:01 PM UTC, comment #6: 

Re-opening the report and re-titling to reflect the remaining issue.

Rik <rik5>
Group administrator
Wed 07 Sep 2016 03:37:40 PM UTC, comment #5: 

The 180 degrees offset is fixed by the patch, but another problem with rose remains: specifying the bin centres does not produce correct results. I ran


rose([0,pi/2,pi,3*pi/2],[0,pi/2,pi,3*pi/2])


both on MATLAB and Octave. See the attached images roseMatlab.png and roseOctave.png for the result.


Martin Kunz <mkunz>
Mon 29 Aug 2016 07:19:23 PM UTC, comment #4: 

I pushed a fix to rose here (http://hg.savannah.gnu.org/hgweb/octave/rev/cc3be522ec79).  Closing report.

Rik <rik5>
Group administrator
Mon 29 Aug 2016 06:58:29 AM UTC, comment #3: 

Rik, here the results:

[th, r] =  rose ([1 2 2 4 4 4], [1 2])
th =
         0    1.5000    4.6416         0         0    4.6416    7.7832         0
r =
     0     5     5     0     0     1     1     0


Markus Mützel <mmuetzel>
Group administrator
Sun 28 Aug 2016 05:55:13 PM UTC, comment #2: 

@Markus:

Could you run this additional example in Matlab?


[th, r] =  rose ([1 2 2 4 4 4], [1 2])



Rik <rik5>
Group administrator
Thu 25 Aug 2016 04:02:59 PM UTC, comment #1: 

Attached please find the diary file (R2015b).

(file #38352)

Markus Mützel <mmuetzel>
Group administrator
Wed 24 Aug 2016 08:29:59 PM UTC, original submission:  

The rose angular histogram is producing values that are offset by 180 degrees from what they should be.

To verify, could someone test the following in matlab and upload the rose.log diary file?


diary rose.log
[th1, r1] = rose ([1 2 2 4 4 4], 8)
[th2, r2] = rose (2*[1 2 2 4 4 4], 8)
diary off



Rik <rik5>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #38441:  roseMatlab.png added by mkunz (14KiB - image/png)
file #38442:  roseOctave.png added by mkunz (22KiB - image/png)
file #38352:  rose.log added by mmuetzel (1KiB - application/octet-stream)

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -email is unavailable- added by idar (Posted a comment)
  • -email is unavailable- added by mkunz (Updated the item)
  • -email is unavailable- added by mmuetzel (Updated the item)
  • -email is unavailable- added by rik5 (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 19 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-12-26 rik5 StatusIn Progress Fixed
        Open/ClosedOpen Closed
        Fixed ReleaseNone 9.1.0
        Planned ReleaseNone 9.1.0
    2023-12-22 rik5 Dependencies- bugs #65070 is dependent
    2023-12-22 rik5 Open/ClosedClosed Open
    2023-12-21 rik5 StatusFixed In Progress
    2016-09-27 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2016-09-07 rik5 StatusFixed Confirmed
        Open/ClosedClosed Open
        Summaryrose() angular histogram incorrect rose() angular histogram incorrect for certain bin centers
    2016-09-07 mkunz Attached File- Added roseMatlab.png, #38441
        Attached File- Added roseOctave.png, #38442
    2016-08-29 rik5 StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2016-08-28 rik5 StatusConfirmed In Progress
        Assigned toNone rik5
    2016-08-25 mmuetzel Attached File- Added rose.log, #38352

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code