Open cafaxo opened 1 year ago
The doc says
wsample([rng], [a], w) Select a weighted random sample of size 1 from a with probabilities proportional to the weights given in w. If a is not present, select a random weight from w.
wsample([rng], [a], w)
Select a weighted random sample of size 1 from a with probabilities proportional to the weights given in w. If a is not present, select a random weight from w.
From this, I expect wsample(w) ∈ w. However, I am getting
wsample(w) ∈ w
julia> wsample([1,10]) 2
Just passing by: it does look that a sensibile behavior (sampling the weight indices) and a bad documentation. Definitely not a bug.
The doc says
From this, I expect
wsample(w) ∈ w
. However, I am getting