Random samples from combination of poisson distributions

6 ビュー (過去 30 日間)
RR
RR 2020 年 6 月 9 日
コメント済み: RR 2020 年 6 月 11 日
How can I generate random samples from a multiple combination of poisson distributions?
I'm wondering if there is the possibility to create a sort of 'poisson' mixture model distribution simular to a gaussian mixture model distribution (gmdistribution function).
Thank you all in advance,
RR

採用された回答

Jeff Miller
Jeff Miller 2020 年 6 月 9 日
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:
% generate a random value of x from a poisson mixture distribution:
ru = rand;
if r1<0.2
x = poissrnd(lambda1); % prob = 0.2 that x comes from this distribution
elseif ru<0.5
x = poissrnd(lambda2); % prob = 0.3 that x comes from this distribution
else
x = poissrnd(lambda3); % prob = 0.5 that x comes from this distribution
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?
  1 件のコメント
RR
RR 2020 年 6 月 11 日
thank you for the answer. That was the point!
I would like to generate random numbers coming from a combined and weighted poissons distribution to reshape that in a volumetric image (n x m x k matrix).

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by