I am trying to create some simulated data, where for each participant, the average number of events that occur in a given week can be any positive number, but usually in the range of 0 to 5. Trouble is, a lot of the time the average is small, like 0.25. I can only sample whole numbers, i.e. 0, 1, 2, 3, 4, 5. How do I sample from these distributions and still maintain their distribution average over all weeks?

(If the averages were all between 0 and 1, and those were my only options, I would just sample a random number between 0 and 1 and return a 1 if it was less than the average).


1 Answer 1


You can sample from a discrete distribution, the Poisson sounds like a good fit here.

  • $\begingroup$ Poisson looks like it would be perfect here, but if OP didn't like the mean = variance aspect, they could also sample from a negative binomial distribution, which is similar but doesn't require that restriction. $\endgroup$
    – Noah
    Oct 24, 2018 at 15:30
  • $\begingroup$ Thanks both. I'm trying to do this in excel, and I found a nice way to do this using inverse binomial here - reddit.com/r/excel/comments/3hsdyg/… $\endgroup$
    – dashnick
    Oct 24, 2018 at 15:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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