Tutorials › Stochastic Processes › Homogeneous Poisson Processes from Exponential Waiting Times

Simulation of Stochastic Processes · Tutorial 982 of 994

Homogeneous Poisson Processes from Exponential Waiting Times

Learn how exponential interarrival times generate Poisson event paths, and how to summarize simulated counts and arrival times over a fixed horizon.

Intermediate 9 min read

What You'll Learn

  • Convert independent uniform draws into exponential interarrival times.
  • Accumulate waiting times and count arrivals up to a fixed horizon.
  • Justify the Poisson count law and independent increments from the arrival-time construction.
  • Compute theoretical and simulated count summaries.
  • Summarize arrival times while distinguishing pooled event times from first-arrival times.
  • Check common simulation errors involving waiting times and horizon endpoints.

From Waiting Times to Event Paths

A homogeneous Poisson process models events that occur randomly over time at a constant rate. In simulation, one direct way to generate its path is to draw the waiting time to the next event, add that wait to the current time, and repeat. This gives event times themselves, so the output can answer questions about both the number of events by a horizon and when they occurred.

Fix a rate \(\lambda>0\). On a probability space \((\Omega,\mathcal{F},\mathbb{P})\), let \(X_1,X_2,\ldots\) be independent and identically distributed exponential random variables with rate \(\lambda\), so that \(\mathbb{P}(X_k>x)=e^{-\lambda x}\) for \(x\ge0\). Define the arrival times \(S_k=X_1+\cdots+X_k\), and let \(N_t\) count arrivals by time \(t\). The state space is \(S=\{0,1,2,\ldots\}\), and time is continuous, \(t\ge0\). We use the convention \(S_0=0\), and count an arrival at the horizon: \(N_t=\#\{k\ge1:S_k\le t\}\). For a fixed \(t\), equality \(S_k=t\) has probability zero, but the inclusive convention makes the algorithm precise.

Definition: A homogeneous Poisson process of rate \(\lambda\) is a counting process starting at zero with independent increments, for which the count in any interval of length \(h\ge0\) has probabilities \(\mathbb{P}(N_{s+h}-N_s=n)=e^{-\lambda h}(\lambda h)^n/n!\), for \(n=0,1,2,\ldots\). The exponential-waiting-time construction below has these properties.

To simulate a wait, draw \(U_k\) independently from the uniform distribution on \((0,1)\) and set \(X_k=-\log(U_k)/\lambda\). Indeed, for \(x\ge0\), \(\mathbb{P}(-\log(U_k)/\lambda>x)=\mathbb{P}(U_k<e^{-\lambda x})=e^{-\lambda x}\). Thus the transformed draws have the required exponential distribution, and independence is preserved because each wait is a function of a separate independent draw. In practice, a pseudorandom generator supplies the uniform draws; exact endpoint values 0 or 1 must be avoided because the logarithm is not finite there.

1
Initialize.
Set the current time to \(s=0\), and set the event count to \(n=0\).
2
Draw and accumulate.
Generate an independent \(U\in(0,1)\), calculate \(x=-\log(U)/\lambda\), and set \(s_{\mathrm{new}}=s+x\).
3
Apply the horizon rule.
If \(s_{\mathrm{new}}\le T\), record the arrival at \(s_{\mathrm{new}}\), increase \(n\) by one, and set \(s=s_{\mathrm{new}}\). Otherwise stop; the recorded arrivals are the path through horizon \(T\).

The loop stops almost surely after finitely many events on any finite horizon. The count-law proof below shows that \(N_T\) has a probability distribution on the nonnegative integers whose probabilities sum to one, so infinitely many arrivals before \(T\) have probability zero.

Why the Construction Gives Poisson Counts

Theorem: If the interarrival times are independent exponential random variables with rate \(\lambda>0\), the process \(N_t=\#\{k:S_k\le t\}\) has independent increments, and for every \(h\ge0\), \(\mathbb{P}(N_{s+h}-N_s=n)=e^{-\lambda h}(\lambda h)^n/n!\). In particular, \(\mathbb{E}[N_t]=\operatorname{Var}(N_t)=\lambda t\).

Proof. First fix \(T>0\) and an integer \(n\ge1\). The joint density of the first \(n\) waiting times \(X_1,\ldots,X_n\) at positive values \(x_1,\ldots,x_n\) is \(\lambda^n e^{-\lambda(x_1+\cdots+x_n)}\), by independence. Changing variables from the waits to ordered arrival times \(s_k=x_1+\cdots+x_k\) has Jacobian determinant \(1\). Therefore the density of \(S_1,\ldots,S_n\) on \(0<s_1<\cdots<s_n\) is \(\lambda^n e^{-\lambda s_n}\). Given these first \(n\) arrivals, the event that there is no further arrival by \(T\) is \(X_{n+1}>T-s_n\), whose probability is \(e^{-\lambda(T-s_n)}\), by the exponential tail and independence. Multiplying gives the density-and-survival factor \(\lambda^n e^{-\lambda T}\) for exactly these \(n\) arrivals and no others before \(T\). For \(n=0\), the probability of no arrival is \(\mathbb{P}(X_1>T)=e^{-\lambda T}\), the same formula with the empty product.

Now partition \([0,T]\) at \(0=t_0<t_1<\cdots<t_m=T\), and write \(\Delta_r=t_r-t_{r-1}\). If interval \(r\) contains \(k_r\) arrivals, the ordered arrival times within that interval occupy a region of volume \(\Delta_r^{k_r}/k_r!\). This is because the cube of side length \(\Delta_r\) is divided, apart from ties of volume zero, into \(k_r!\) equally sized orderings; when \(k_r=0\), the volume is \(1\). The intervals together have total ordered-region volume equal to the product of these volumes. Integrating the factor \(\lambda^{\sum_r k_r}e^{-\lambda T}\) over that region gives

$$ \mathbb{P}\big(N_{t_r}-N_{t_{r-1}}=k_r,\ 1\le r\le m\big) =\prod_{r=1}^{m}e^{-\lambda\Delta_r}\frac{(\lambda\Delta_r)^{k_r}}{k_r!}. $$

This factorization proves both the Poisson count law for each interval and independence of the counts in disjoint consecutive intervals. Finally, for \(a=\lambda t\), summing the count probabilities gives \(\mathbb{E}[N_t]=e^{-a}\sum_{n\ge1}n a^n/n!=a\), after shifting the index in the exponential series. Similarly, \(\mathbb{E}[N_t(N_t-1)]=e^{-a}\sum_{n\ge2}n(n-1)a^n/n!=a^2\). Since \(N_t^2=N_t(N_t-1)+N_t\), its variance is \(a^2+a-a^2=a\). At \(t=0\), \(N_0=0\), so the same conclusions hold. \(\square\)

Worked Example: One Simulated Path Through a Fixed Horizon

Take rate \(\lambda=2\) and horizon \(T=1\). For a fully traceable illustrative set of uniform inputs, use \(U_1=e^{-1/2}\), \(U_2=e^{-1}\), and \(U_3=e^{-3/2}\). These are possible values in \((0,1)\); the calculations illustrate the transform rather than suggest that a continuous random draw has positive probability of equaling any one specified value.

The waiting times from \(X_k=-\log(U_k)/2\) are \(X_1=1/4\), \(X_2=1/2\), and \(X_3=3/4\). Accumulating gives \(S_1=1/4\), \(S_2=1/4+1/2=3/4\), and \(S_3=3/4+3/4=3/2\). The first two arrivals satisfy \(S_k\le1\), while \(S_3>1\), so the simulated count is \(N_1=2\). The mean of the two recorded arrival times is \((1/4+3/4)/2=1/2\), and their sum is \(1\).

Check: The theoretical mean count is \(\lambda T=2\), and the simulated count is \(2\). This agreement in one path is not a guarantee that each simulated count equals its expectation; it is only a useful arithmetic check. The stopping decision is also correct because the next accumulated time, \(3/2\), exceeds the horizon \(1\).

Arrival-Time Summaries and Repeated Runs

Counts are only one summary of a simulated path. The event list \(S_1,\ldots,S_{N_T}\) also supports summaries such as the first observed arrival, the last arrival, or the average of all observed event times. For a fixed arrival index \(k\), the time \(S_k\) is a sum of \(k\) independent exponential waits. A rate-\(\lambda\) exponential variable has mean \(1/\lambda\) and variance \(1/\lambda^2\); these follow by integrating its density \(\lambda e^{-\lambda x}\) on \(x\ge0\). Linearity of expectation and independence therefore give the next result.

Result: For each integer \(k\ge1\), \(\mathbb{E}[S_k]=k/\lambda\) and \(\operatorname{Var}(S_k)=k/\lambda^2\).

Proof. By definition, \(S_k=\sum_{r=1}^kX_r\). Each summand has mean \(1/\lambda\), so \(\mathbb{E}[S_k]=\sum_{r=1}^k\mathbb{E}[X_r]=k/\lambda\). Independence makes every covariance between distinct summands zero, so \(\operatorname{Var}(S_k)=\sum_{r=1}^k\operatorname{Var}(X_r)=k/\lambda^2\). \(\square\)

Worked Example: Summarizing Four Simulated Runs

Let \(\lambda=1\) and \(T=2\). Suppose four independent runs produce the following arrival times, with the first wait beyond the horizon shown where needed: run 1 has \(1/2,3/2,5/2\); run 2 has \(1,5/2\); run 3 has \(5/2\); run 4 has \(1/4,7/4,11/4\). These values can be generated by exponential waits: consecutive differences are the waits, and every wait is positive. For example, the first two waits in run 4 are \(1/4\) and \(7/4-1/4=3/2\).

Applying the inclusive rule \(S_k\le2\), the four counts are \(2,1,0,2\), respectively. Their sum is \(5\), so the sample mean count per run is \(5/4\). The total simulated exposure is \(4\cdot2=8\) time units, giving the rate estimate \(5/8\) events per unit time. The sample variance of the run counts is computed using denominator \(4-1=3\): the deviations from \(5/4\) are \(3/4,-1/4,-5/4,3/4\), whose squared values sum to \(9/16+1/16+25/16+9/16=11/4\). Thus the sample variance is \((11/4)/3=11/12\), and the estimated Monte Carlo standard error of the sample mean count is \(\sqrt{(11/12)/4}=\sqrt{11/48}\). The corresponding estimated standard error for the rate estimate is \(\sqrt{11/48}/2=\sqrt{11/192}\).

The recorded event times across the four runs are \(1/2,3/2,1,1/4,7/4\). Their sum is \(1/2+3/2+1+1/4+7/4=5\), so their pooled average is \(5/5=1\). The first arrival times among the three runs with at least one arrival are \(1/2,1,1/4\); their average is \((1/2+1+1/4)/3=7/12\). These are different summaries of the simulated paths. In particular, \(7/12\) is an average among runs with an arrival by time \(2\), not an estimate formed from every run's unrestricted first-arrival time.

Check: The total number of arrivals is \(2+1+0+2=5\), matching the five listed event times. The pooled average is \(1\), which is within the horizon \([0,2]\), and the rate estimate uses all \(8\) units of simulated exposure, not just the runs with events.

Worked Example: Checking Theoretical Count and Arrival-Time Summaries

Take \(\lambda=3/2\), horizon \(T=2\), and arrival index \(k=2\). The count parameter is \(\lambda T=(3/2)\cdot2=3\). Hence \(\mathbb{P}(N_2=2)=e^{-3}3^2/2!=9e^{-3}/2\), while \(\mathbb{E}[N_2]=3\) and \(\operatorname{Var}(N_2)=3\). For the second arrival, the result above gives \(\mathbb{E}[S_2]=2/(3/2)=4/3\) and \(\operatorname{Var}(S_2)=2/(3/2)^2=8/9\).

Check: The two waiting times each have mean \(1/(3/2)=2/3\), so their sum has mean \(2/3+2/3=4/3\). Their variances are each \(1/(3/2)^2=4/9\), so independence gives total variance \(4/9+4/9=8/9\). The expected count \(3\) is also the count parameter used in the probability formula.

Common Pitfalls and Practical Checks

Common mistake: treating waits as event times. If the first two waiting times are \(1/4\) and \(1/2\), the arrival times are \(S_1=1/4\) and \(S_2=1/4+1/2=3/4\). A wrong calculation records the second event at \(1/2\), using the second wait itself as an absolute time. The correction is to add each new wait to the previous arrival time.

Another important check is the horizon comparison. Record an event when its accumulated time satisfies \(S_k\le T\), and stop when \(S_k>T\). Do not count a wait merely because it was drawn: it is the proposed next arrival time that must be compared with \(T\). For continuous exponential waiting times, an exact tie with a fixed \(T\) has probability zero, but implementing a consistent inclusive rule avoids ambiguity.

For estimating an expected count, simulate independent whole paths and average their counts. For estimating a rate from a fixed common horizon \(T\), total arrivals divided by total exposure, \(\sum_{r=1}^R N_T^{(r)}/(RT)\), is the corresponding pooled rate estimate. Arrival-time averages require a clearly specified target: averaging first arrival times only over runs with an arrival by \(T\) excludes runs with no such arrival, while averaging all recorded event times weights runs with more events more heavily. Report which summary was calculated and how events or runs were included.

Check Your Understanding

Use the exponential-waiting-time construction and show the intermediate calculations in each answer.

  1. For \(\lambda=4\) and a uniform input \(U=e^{-1/2}\), calculate the waiting time.
  2. If the successive waits are \(1/3\), \(1/2\), and \(1\), list the arrival times and find the count through horizon \(1\), using \(S_k\le1\).
  3. For rate \(\lambda=2\), state the mean and variance of the third arrival time \(S_3\).
  4. Four independent runs over horizon \(T=3\) have counts \(1,2,0,1\). Find their sample mean count and the pooled rate estimate.
  5. Explain why using the second exponential wait directly as the second event time gives the wrong path.