remove StatsBase dependence