kde n0 xs = kde_ n0 (lo - range / 10) (hi + range / 10) xs
+ range | U.length xs <= 1 = 1 -- Unreasonable guess
-- | Gaussian kernel density estimator for one-dimensional data, using
-- the method of Botev et al.
-- ^ Upper bound (@max@) of the mesh range.
-> U.Vector Double -> (U.Vector Double, U.Vector Double)
+ | U.null xs = error "Statistics.KernelDensity.kde: empty sample"
| n0 < 1 = error "Statistics.KernelDensity.kde: invalid number of points"
| otherwise = (mesh, density)