# How we generate random variates from a generalized poisson distribution?

3 views (last 30 days)
ektor on 19 Oct 2015
Commented: ektor on 19 Oct 2015
Dear all, I want to use generate draws from the "generalized poisson distribution". Is there any function in matlab to do that?
thanks

#### 1 Comment

ektor on 19 Oct 2015
Dear all,
any suggestion?

Image Analyst on 19 Oct 2015
If you have the Statistics and Machine Learning Toolbox, that is one of the distributions given in the random() function. From the help:
Generate a single random value from Poisson distributions with rate parameters 1, 2, ..., 6, respectively:
x2 = random('Poisson',1:6,1,6)
x2 =
0 0 1 2 5 7

#### 1 Comment

ektor on 19 Oct 2015
The generalized poisson model assumes GP(lamba, phi) where lamba is the mean and phi is a dispersion parameter. So according to the above function I have
M=poissrnd(lamda)
x2 = random(M,phi,1,1)
Is that correct?. If you could give me a more specific example for my case that would be great.
Many thanks