The Poisson Process: Everything you need to know
By: Sachin Date
Tags: Poisson, Programming, Time Series Analysis, Statistics, Data Science

Modeling inter-arrival times

The Poisson process has a remarkable substructure. Even though the number of occurrence of events is modeled using a discrete Poisson distribution, the interval of time between consecutive events can be modeled using the Exponential distribution,which is a continuous distribution.

Let’s explore this further.

Let X1, X2, X3,…etc. be random variables such that:

X1 = the interval of time between the start of the process and the 1st event, i.e. 1st arrival,

X2 = the inter-arrival time between the first and the second arrival,

X3 = the inter-arrival time between the second and the third arrival,

and so forth.

The distribution of random variable Xk which represents the inter-arrival time between the (k-1)th and (k)th arrival is:

Inter-arrival times are exponentially distributed (Image by Author)

The Probability Density Function (PDF) of the random variable Xk is as follows:

PDF of inter-arrival times in a Poisson process (Image by Author)

And the Cumulative Distribution Function (CDF) is:

CDF of interval-arrival times in a Poisson process (Image by Author)

Recollect that CDF of X returns the probability that the interval of time between consecutive arrivals will be less than or equal to some value t.

Simulating inter-arrival times in a Poisson process

We now have enough information to generate inter-arrival times in a Poisson process. We do this by using the Inverse-CDF technique, in which we literally construct the inverse function of the CDF, and feed it different probability values from a Uniform(0,1) distribution. This gives us the corresponding inter-arrival times for the respective probabilities.

The inverse function of the CDF of the inter-arrival times is:

Inverse of the CDF of inter-arrival times (Image by Author)

As mentioned earlier, we feed into this function, probability values from the continuous uniform distribution Uniform(0,1). We’ll soon see how to do this operation programmatically using a couple of lines of Python code.

For now, following is the table of patient inter-arrival times in hours at the ER for the first 10 patients. We have generated this date using the above formula, with λ set to 5 patients per hour.

λ = 5 arrivals per hour (Image by Author)

Here is the plot of interval-times for the first 500 arrivals. As expected, it is the inverse of the graph of the CDF.

Inverse of CDF of interval arrival times (Image by Author)

Modeling the arrival times in a Poisson process

Now that we know how to generate inter-arrival times, it is easy to generate the patient arrival times.

From the table of 10 sample inter-arrival times shown above, we can deduce the following:

Arrival time of first patient = x1 = 0.431257556

Arrival time of second patient =

x1 + inter-arrival time between first and second patient =

x1 + x2 = 0.431257556 + 0.264141966 = 0.6954

Arrival time of third patient =

x1 + x2 + x3 = 0.431257556 + 0.264141966 + 0.190045932 = 0.885445

… and so on

Keeping in mind that X1, X2, X3,…Xk are the inter-arrival times, if we define T1, T2, T3, …Tk as the variables that will represent the patient arrival times at the ER, we see that:

T1 = X1

T2 = X1 + X2

T3 = X1 + X2 + X3

…

Tk = X1 + X2 + X3 + … + Xk

Notice that since T1, T2, T3…Tk are defined as linear combinations of random variables X1, X2, X3,…Xk, the variables T1, T2, T3,…Tk are also random variables.

Here is one more very interesting fact:

Since T1, T2, T3…Tk are each the sum of exponentially distributed random variables X1, X2, X3,…Xk, the random variables T1, T2, T3,…,Tk follow the Gamma distribution.

The arrival times in a Poisson process follow the Gamma distribution which is a continuous distribution.

Let’s take a step back and note how smoothly we traveled from a discrete distribution to a set of continuous distributions! Such is the magical structure of the Poisson process. While the process itself is discrete, its substructure is represented entirely by continuous random variables.

The following schematic summarizes the three main distributions that comprise the Poisson process: