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

 
 

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

Submitter:  Alois Schlögl <schloegl>
Submitted:  Fri 21 May 2010 08:26:19 AM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  highegg
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 26 May 2010 07:11:45 AM UTC, comment #2: 
Jaroslav Hajek <highegg>
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>
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 Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by highegg (Posted a comment)
  • -email is unavailable- added by schloegl (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-05-26 highegg StatusNone Fixed
        Open/ClosedOpen Closed
    2010-05-24 highegg Assigned toNone highegg

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code