(defn median
"
Returns the median of the data, x.
Examples:
(median (sample-normal 100))
References:
http://incanter.org/docs/parallelcolt/api/cern/jet/stat/tdouble/DoubleDescriptive.html
http://en.wikipedia.org/wiki/Median
"
([x]
(let [xx (sort (to-list x))]
(DoubleDescriptive/median (DoubleArrayList. (double-array xx))))))
Comments top
No comments for median. Log in to add a comment.