# Simulating Negative Binomial Arrivals

I am building a simulation. I want to generate arrivals according to a negative binomial process. The data will show the minute of each "customer" arrival and look something like the following:

Arrival      Time
1            1/1/2015 0:12
2            1/1/2015 0:56
3            1/1/2015 1:27
...          ...
83465        1/10/2015 22:12


I have historical count data that I am modeling in hopes of estimate the parameters of the negative binomial distribution. It looks like this:

Hour                    Arrivals
10/1/2014 0:00          2
10/1/2014 1:00          3
10/1/2014 2:00          1
...                     ...
10/20/2014 22:00        1


I know that if I was using Poisson regression, I would have an estimate for a parameter $λ$ returned by the regression. This parameter would represent the expected number of arrivals during a given period (in my case an hour).

I could then simulate this process by from time $t=0$ by sampling from an exponential distribution with mean $μ=1/λ$. This would return the an interarrival time $t1$. I could then schedule an arrival to occur at $t0+t1$. I could repeat this process for the next arrival which would occur at $t0+t1 + t2$ and so on...

What is the analogous process for a negative binomial process? NB regression returns an estimate for the mean but also the dispersion $θ$.

• It is unclear whether you are interested in simulation (all model parameters are then fixed and synthetic datasets are produced by a random generator) or in estimation (all model parameters are then unknown and the dataset used to estimate those parameters). – Xi'an Jan 6 '15 at 20:45
• Simulation. All parameters are known, and I want to create a synthetic dataset of timestamps that represent "customer" arrivals. – DG1 Jan 6 '15 at 20:50
• Specifically, the mean and dispersion will be known based on negative binomial regression of count data. This data was collected in the past. I am running a simulation of the future. – DG1 Jan 6 '15 at 20:51