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

 
 

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

Submitted by:  None
Submitted on:  Sat 28 Apr 2012 02:00:27 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: Ben Abbott <bpabbott>
Originator Name: Originator Email: -unavailable-
Open/Closed: ClosedRelease: 3.6.1
Operating System: GNU/Linux

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 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 MemberIn charge of this item.
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 MemberIn charge of this item.
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 MemberIn charge of this item.
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 MemberIn charge of this item.
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 File(s):
   
   
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
  • -unavailable- added by jordigh (Posted a comment)
  • -unavailable- added by godfrey (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by bpabbott (Updated 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 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 01 May 2012 02:21:17 AM UTCbpabbottStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Sun 29 Apr 2012 04:52:47 PM UTCbpabbottAttached File-=>Added changeset.patch, #25754
      CategoryLibraries=>None
      StatusNone=>Ready For Test
      Assigned toNone=>bpabbott

    Back to the top


    Powered by Savane 3.1-cleanup1