bugGNU Octave - Bugs: bug #36328, Poissrnd bug for lambda =0 (again)

 
 

bug #36328: Poissrnd bug for lambda =0 (again)

Submitter:  None
Submitted:  Sat 28 Apr 2012 02:00:27 PM UTC
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  bpabbott
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.6.1
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment (Rich Markup)
   

( Jump to the original submission )

Tue 01 May 2012 02:21:17 AM UTC, comment #8: 

I pushed the changeset to stable

Ben Abbott <bpabbott>
Project Member
Tue 01 May 2012 01:14:31 AM UTC, comment #7: 

No.

Michael Godfrey <godfrey>
Project Member
Mon 30 Apr 2012 11:39:13 PM UTC, comment #6: 

Any objection to pushing the changeset to stable ?

Ben Abbott <bpabbott>
Project Member
Mon 30 Apr 2012 09:40:37 PM UTC, comment #5: 

As an aside, it's interesting to note that this gives another good case for why 0^0 = 1. :-)

Jordi GutiƩrrez Hermoso <jordigh>
Project Administrator
Mon 30 Apr 2012 08:53:37 PM UTC, comment #4: 


>> poissrnd(0,1,1) 


ans =

     0

>> version


ans =

7.9.0.529 (R2009b)

>>


Michael Godfrey <godfrey>
Project Member
Mon 30 Apr 2012 08:11:00 PM UTC, comment #3: 

I don't have access to Matlab's statistics toolbox.

Ben Abbott <bpabbott>
Project Member
Mon 30 Apr 2012 07:32:21 PM UTC, comment #2: 

For another opinion, what does Matlab report for the sample code?  Does it return NaN or 0?

Rik <rik5>
Project Administrator
Sun 29 Apr 2012 04:52:47 PM UTC, comment #1: 

I've attached a patch for testing.

(file #25754)

Ben Abbott <bpabbott>
Project Member
Sat 28 Apr 2012 02:00:27 PM UTC, original submission:  

Hi

poissrnd(0, 1,1)
returns a NaN.

Poissonrnd should return a zero instead.
(Mathematically there is nothing wrong with a poisson process
with rate 0, the outcome is simply always zero)

The fix is simple.
In poissrnd.m replace twice
if (lambda > 0...
with
if (lambda >= 0...


Note this is a regression from  bug  jwe@5154 reported ages ago.


Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #25754:  changeset.patch added by bpabbott (1KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jordigh (Posted a comment)
  • -email is unavailable- added by godfrey (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by bpabbott (Updated 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 project members can vote.

     

     

     

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-05-01 bpabbott StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2012-04-29 bpabbott Attached File- Added changeset.patch, #25754
        CategoryLibraries None
        StatusNone Ready For Test
        Assigned toNone bpabbott

    Back to the top

    Powered by Savane 3.11