SPARK-2149. Univariate kernel density estimation

Right.  There might be a prettier way to do this that still avoids copying, but I've been advised against using Scala fanciness in performance-critical loops, because it has non-negligible overhead.