I would like to compute samples of the number of product purchased in a supermarket. I want to model it with a mixed Poisson lognormal distribution.

  1. Items purchased $x$ of a given consumer follow a Poisson distribution with the mean rate of purchasing $\lambda$


  1. The mean rate of purchasing $\lambda$ of different consumers differ, and are distributed lognormally.

By combining 1 and 2, the probability density function of $x$ items purchased results the following distribution:

$f(x)=\frac{1}{x!\sigma\sqrt{2\pi}}\int_{0}^{\infty}\lambda^{x-1} e^{-\lambda} e^{\frac{(log(\lambda-\mu)^2}{2\sigma^2} }\text{d}\lambda $

I am simulating purchases in a supermarket, and I would like to sample this distribution to know the items purchased by each consumer by computing samples of this random variable, for example, with mean 2.32 and standard deviation 1.29 of products.

My simulator can generate easily samples of a Poisson and a Gaussian random variable. Is there any form to compute samples of the above mixed distribution using random samples of Poisson and Gaussian random variables?. I have seen in this post that lognormal and Gaussian distribution are related, but I do not know how to apply this to compute Poisson-lognormal random variable of items purchased.


1 Answer 1


You can generate a sample by first generating a normally distributed value, then take the exponent of that, then use that as the parameter in a Poisson distribution and take a sample from that distribution. The resulting samples of this three-step process will be Poisson-Lognormally distributed.

  • 1
    $\begingroup$ thank you very much, I have to try this, seems simple process. $\endgroup$ Jan 14, 2019 at 12:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.