comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Definition of Median was(Re: Finding the index of the median)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Definition of Median was(Re: Finding the index of the median) [message #7334 is a reply to message #7322] Wed, 30 October 1996 00:00 Go to previous message
meron is currently offline  meron
Messages: 51
Registered: July 1995
Member
In article <327771BA.2781@silk.gsfc.nasa.gov>, "Thomas A. McGlynn" <tam@silk.gsfc.nasa.gov> writes:
> In looking at the get the index of the median
> value, I noted that the behavior
> of the IDL median filter is not what I would have expected.
>
> E.g.,
> print, median([1,2,3,10])
>
> prints out 3. This is independent of the order of elements
> in the array. Is there an accepted definition of what
> the median value is in this case. For example, I might
> think 2.5 is a more appropriate choice (but one which would
> have made the previous discussion incorrect).
>
No, median must be one of the elements of the set. 2.5 isn't such.
The definition is, in principle "a value from the original set such
that there are as many values below it as above it". Which cannot be
fulfilled strictly if the number of elements is even. So in such case
you decide arbitrarily (but preferably consistantly) whether to pick
the one above or below the dividing line.

Mati Meron | "When you argue with a fool,
meron@cars.uchicago.edu | chances are he is doing just the same"
[Message index]
 
Read Message
Read Message
Previous Topic: Is there a cheap implementation of IDL
Next Topic: Alarm clock -- ring!

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:21:52 PDT 2025

Total time taken to generate the page: 0.00370 seconds