Suppose we perform n different multinomial experiments, each time with k possible outcomes: category 1 to category k. The probability of drawing category j in the i-th experiment is pij. That is, the probabilities of drawing a certain category differ for different experiments. We do know all the pij (i=1,…,n, j=1,…,k) (and for each i these pij sum up to 1, as they should).
Let xi be the outcome of the i-th experiment.
Now we are told that we have to draw category j (j=1,...,k) exactly nj times (where the sum of the nj is equal to n, of course).
My problem is to sample the xi (i=1,…,n) given that category 1 is drawn n1 times, category 2 n2 times, …, and category k nk times using the probabilities pij.
Does anyone know how to do this in an efficient way?
For small n one could generate all possible samples, select the ones where category 1 is drawn n1 times, category 2 n2 times, …, and category k nk times, calculate the probabilities of these samples conditional on the constraint that one of them has to be chosen, and then draw one of these samples. However, in my case n is large and this approach does not work.
(What complicates the problem further is that some of the pij may be equal to zero. This means that drawing the categories sequentially does not always work as for some categories there may not be enough experiments left where this category has non-zero probability).