Merge weighted random sampled set with different distributions

48 Views Asked by At

Here is my problem:

I have a set $S_1$ of $N$ items each item i attached to a weight $w_{1_i}$. From this set I sample a subset of m items $(m << N)$ using weighted random sampling with replacement.

Then I have a set $S_2$ of $M$ items in which some items of $S_1$ may be included but with a different weight $w_2$.

I want now to sample a subset of $n (n > m)$ items from $S2$ doing a random weighted sampling with replacement but I want to keep the items that are in $S1 ∩ S2$ and have been previously picked.

My question is, how should these items be included in order for my new subset to follow accurately the weight distribution of the set $S2$?

My thinking was, to include the k items that are in $S1 ∩ S2$ with a count of $c_i$ = $w_{2_i} * m$ and complete them with a random weighted sampling of $m - sum(c_i)$ items in $S2$ - {k items}.

Does that sound like a reasonnable way to do it?