Why direct_sample!, knuths_sample!, alias_sample or any of the other Weighted sampling algorithms say they are not defined? Are those functions not yet shipped?
direct_sample!(Random.GLOBAL_RNG, rand(50), Weights(rand(50)))
Why direct_sample!, knuths_sample!, alias_sample or any of the other Weighted sampling algorithms say they are not defined? Are those functions not yet shipped?
direct_sample!(Random.GLOBAL_RNG, rand(50), Weights(rand(50)))
you want to use StatsBase
https://juliastats.org/StatsBase.jl/latest/sampling/#StatsBase.sample