bugGNU Octave - Bugs: bug #29930, median gives incorrect result for...

 
 

bug #29930: median gives incorrect result for data containing NaN's

Submitted by:  Alois Schlögl <schloegl>
Submitted on:  Fri 21 May 2010 08:26:19 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: Jaroslav Hajek <highegg>
Originator Name: Open/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Wed 26 May 2010 07:11:45 AM UTC, comment #2:

Fixed by
http://hg.savannah.gnu.org/hgweb/octave/rev/9e4407c19e8d

thanks for the report.

Jaroslav Hajek <highegg>In charge of this item.
Mon 24 May 2010 07:03:27 PM UTC, comment #1:

Hmm, I see no nice way to treat NaNs as missing while still using nth_element instead of sort. So I guess we'd better just set elements to NaN where needed.

Jaroslav Hajek <highegg>In charge of this item.
Fri 21 May 2010 08:26:19 AM UTC, original submission:

octave:6> which median
`median' is a function from the file /usr/local/share/octave/3.3.51+/m/statistics/base/median.m
octave:7> median([1,2,3,NaN,NaN])
ans = 3

The result should be either NaN (this is the result of ML), or it should be 2 (like the NaN-toolbox, considering NaN's as missing values).

Alois

Alois Schlögl <schloegl>

 

(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 highegg (Posted a comment)
  • -unavailable- added by schloegl (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
    Wed 26 May 2010 07:11:45 AM UTChigheggStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Mon 24 May 2010 07:03:27 PM UTChigheggAssigned toNone=>highegg

    Back to the top


    Powered by Savane 3.1-cleanup1