 (ns clojurewerkz.statistiker.statistics
-  (:import [org.apache.commons.math3.stat.descriptive.rank Percentile])
+  (:import [org.apache.commons.math3.stat.descriptive.rank Percentile]
+           [org.apache.commons.math3.stat StatUtils])
   (:require [clojurewerkz.statistiker.fast-math :refer [sqrt pow]]))
 
 (defn mean


(defn geometric-mean
  [values]
  (pow (reduce * values) (/ 1 (count values))))


(def ^:private percentile-mappings
  {:min    1


(defn percentiles
  [values percentiles]
  (let [p (Percentile.)
        _ (.setData p (double-array values))]
    (mapv #(.evaluate p (double %)) percentiles)))

(defn percentile
  [values percentile]
  (let [p (Percentile.)
        _ (.setData p (double-array values))]
    (.evaluate p (double percentile))))
