Definition of Median was(Re: Finding the index of the median) [message #7340] |
Wed, 30 October 1996 00:00  |
Thomas A. McGlynn
Messages: 23 Registered: March 1996
|
Junior Member |
|
|
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).
Perhaps more important, if the selection of 3 rather than
2 as the median arises because 3>2, then does the IDL median
function systematically 'overestimate' the median. More precisely
given two values that are reasonably choices for the median
does IDL always choose the later?
I don't like IDL's choice here. In some of my work
I've used a n-dimensional
median definition as the point (or points) at which the
unit to all the array elements sum to zero. This gives
a nice generalization of the concept of median to higher dimensions
but it would require a value (any value) m where 2<m<3 in the
current instance.
Tom McGlynn
tam@silk.gsfc.nasa.gov
|
|
|
|