I have a set of $n$ elements, $x_1,x_2,\dots,x_n$, each with a weight $w_1, w_2,\dots, w_n$. I want to sample a subset of fixed size $k$ such that the probability of drawing $\{x_a,\dots,x_b\}$ is proportional to $w_a\dots w_b$.

The only solution I could think of is some kind of MCMC, but I would prefer direct sampling because speed is of concern.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.