One easy way to generate a random score from a poisson mixture distribution is to randomly select the particular poisson first and then randomly select the number from that poisson, something like this:
ru = rand;
if r1<0.2
x = poissrnd(lambda1);
elseif ru<0.5
x = poissrnd(lambda2);
else
x = poissrnd(lambda3);
end
There are various ways to vectorize this for lots of x's, but I'm not sure which would be fastest.
Did you just want the poisson mixture for generating random numbers, or did you want it for some other reason too?
Best Answer