bugGNU Octave - Bugs: bug #46238, normrnd() produces NaN for 0 in...

 
 

bug #46238: normrnd() produces NaN for 0 in standard deviation vector

Submitted by:  None
Submitted on:  Sat 17 Oct 2015 03:36:02 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: RobertOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 4.0.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.

 

Sat 17 Oct 2015 04:14:28 PM UTC, comment #1:

Thanks for catching this. Obviously the scalar and vector cases were meant to be the same, but a probable typo let in the error.

I've fixed this on the stable branch of Octave and it will be part of the next 4.0.1 bug fix release. You can either wait until then, or use the m-file directly from the Mercurial stable repository.

Rik <rik5>
Project Administrator
Sat 17 Oct 2015 03:36:02 PM UTC, original submission:

When calling normrnd() with 0 standard deviation on scalar arguments, it (correctly) returns the given mean, e.g.

However, when called with vector arguments, the elements where the standard deviation is 0 are replaced by NaN, e.g.

The issue is on line 93 or normrnd.m:
which should be
similar to line 86, which deals with scalar arguments:

Correcting this would make behaviour between scalar and vector operations consistent, and also make normrnd() behave the same way as Matlab.

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 rik5 (Posted a comment)
  • -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 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 17 Oct 2015 04:14:28 PM UTCrik5StatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1