[Jprogramming] Find the median

Raul Miller rauldmiller at gmail.com
Sat Mar 23 17:00:20 UTC 2013


Here's an interesting take on median:
http://www.johnmyleswhite.com/notebook/2013/03/22/modes-medians-and-means-an-unifying-perspective/

It's worth noting that when you use linear discrepancy that there's no
difference between the various definitions of median of a list with an
even number of elements.

For example:

   X=: 131 3 281 2 67 353
   mean=: +/%#
   dscL=: +/@(|@- ])
   (dscL mean@((>.,<.)@-:@<:@# { /:~)) X
693
   (dscL <. at -:@<:@# { /:~) X
693
   (dscL >. at -:@<:@# { /:~) X
693

-- 
Raul


More information about the Programming mailing list