Comparing Two Poisson Rates

Statistics · Medium · Free problem

You observe independent event counts from two processes over different observation windows:

  • $X \sim \text{Pois}(\lambda_A \, t_A)$
  • $Y \sim \text{Pois}(\lambda_B \, t_B)$

You want to test whether the two underlying rates are equal:

$H_0: \lambda_A = \lambda_B \quad \text{vs} \quad H_1: \lambda_A \neq \lambda_B$

at significance level $\alpha$.

  1. Show that, under $H_0$, the conditional distribution $X \mid X + Y$ is Binomial. State the parameters explicitly.
  1. Using part (1), describe how to construct an exact conditional test of $H_0$ at level $\alpha$.
  1. For large samples, derive a z-test based on the log rate ratio $\log(\hat{\lambda}_A / \hat{\lambda}_B)$. State the test statistic and its standard error.

Hints

  1. Under $H_0$ both counts come from Poisson distributions with the same rate. What happens when you condition the sum of two independent Poissons on the total?
  2. The conditional distribution $X \mid X + Y$ is Binomial with a success probability determined by the observation times alone -- the unknown rate cancels. Use this to build an exact test.
  3. For the large-sample test, consider the log rate ratio $\log(\hat{\lambda}_A / \hat{\lambda}_B)$ and apply the delta method to get $\text{SE} = \sqrt{1/X + 1/Y}$.

Worked Solution

How to Think About It: You have two Poisson streams and want to know if they share the same rate. The classic trick in Poisson inference is conditioning on the total count $N = X + Y$. Under $H_0$, the total count is sufficient for the common rate, and once you condition on it, the rate parameter drops out entirely. What remains is a Binomial split determined purely by the observation time ratio. This gives you an exact test with no asymptotics needed -- extremely useful for small counts, which show up constantly in rare-event modeling (credit defaults, operational risk, etc.).

Quick Estimate: Suppose $t_A = 2$, $t_B = 3$, $X = 12$, $Y = 9$, so $N = 21$. Under $H_0$, $X \mid N \sim \text{Binom}(21, 2/5)$. The expected value is

1 \times 0.4 = 8.4$, but we observed $X = 12$. The standard deviation is $\sqrt{21 \times 0.4 \times 0.6} \approx 2.24$, so $X = 12$ is about $(12 - 8.4)/2.24 \approx 1.6$ standard deviations above the mean. That is suggestive but not significant at the 5\% level. The MLE rates are $\hat{\lambda}_A = 12/2 = 6$ and $\hat{\lambda}_B = 9/3 = 3$, giving a log rate ratio of $\log(6/3) = \log 2 \approx 0.693$. With standard error $\sqrt{1/12 + 1/9} \approx 0.44$, the z-statistic is $0.693/0.44 \approx 1.57$ -- consistent with our conditional calculation.

Formal Solution:

Part 1: Conditional distribution under $H_0$

Under $H_0$, let $\lambda_A = \lambda_B = \lambda$. Then $X \sim \text{Pois}(\lambda t_A)$ and $Y \sim \text{Pois}(\lambda t_B)$ independently, so:

$N = X + Y \sim \text{Pois}(\lambda(t_A + t_B))$

The conditional PMF of $X$ given $N = n$ is:

$P(X = x \mid N = n) = \frac{P(X = x) \, P(Y = n - x)}{P(N = n)}$

$= \frac{e^{-\lambda t_A}(\lambda t_A)^x / x! \;\cdot\; e^{-\lambda t_B}(\lambda t_B)^{n-x} / (n-x)!}{e^{-\lambda(t_A+t_B)}[\lambda(t_A+t_B)]^n / n!}$

$= \binom{n}{x} \left(\frac{t_A}{t_A + t_B}\right)^x \left(\frac{t_B}{t_A + t_B}\right)^{n - x}$

The $\lambda$ terms cancel completely. Setting $\rho = t_A / (t_A + t_B)$:

$X \mid N = n \;\sim\; \text{Binom}(n, \rho)$

This is the key result: under $H_0$, the conditional distribution depends only on the known time ratio $\rho$, not on the unknown common rate.

Part 2: Exact conditional test

Since $X \mid N \sim \text{Binom}(N, \rho)$ under $H_0$ with $\rho$ known, we can construct an exact test:

$P(X \leq x_L) \leq \alpha/2 \quad \text{and} \quad P(X \geq x_U) \leq \alpha/2$

Reject $H_0$ if $X \leq x_L$ or $X \geq x_U$. Because the Binomial is discrete, the test is conservative (actual size $\leq \alpha$). A randomized version achieves exact size $\alpha$ if needed.

Part 3: Large-sample z-test for the log rate ratio

The MLEs of the rates are $\hat{\lambda}_A = X / t_A$ and $\hat{\lambda}_B = Y / t_B$. Define the log rate ratio:

$\theta = \log\left(\frac{\lambda_A}{\lambda_B}\right), \qquad \hat{\theta} = \log\left(\frac{\hat{\lambda}_A}{\hat{\lambda}_B}\right) = \log\left(\frac{X/t_A}{Y/t_B}\right)$

Under $H_0$, $\theta = 0$. By the delta method applied to $\log(X/t_A) - \log(Y/t_B)$:

$\text{Var}(\hat{\theta}) \approx \text{Var}(\log X) + \text{Var}(\log Y) \approx \frac{1}{X} + \frac{1}{Y}$

since for a Poisson random variable with mean $\mu$, the delta method gives $\text{Var}(\log X) \approx 1/\mu \approx 1/X$ when we plug in the observation. Thus the standard error is:

$\text{SE}(\hat{\theta}) = \sqrt{\frac{1}{X} + \frac{1}{Y}}$

and the test statistic is:

$Z = \frac{\hat{\theta}}{\text{SE}(\hat{\theta})} = \frac{\log(X/t_A) - \log(Y/t_B)}{\sqrt{1/X + 1/Y}}$

Under $H_0$, $Z \xrightarrow{d} N(0,1)$. Reject $H_0$ at level $\alpha$ if $|Z| > z_{\alpha/2}$.

Answer:

  1. Under $H_0$, $X \mid X + Y = n \sim \text{Binom}(n, \, t_A/(t_A + t_B))$. The common rate $\lambda$ cancels entirely.
  1. The exact conditional test rejects $H_0$ when $X$ falls in the extreme tails of this known Binomial distribution.
  1. The large-sample z-statistic for the log rate ratio is:

$Z = \frac{\log(X / t_A) - \log(Y / t_B)}{\sqrt{1/X + 1/Y}} \;\dot{\sim}\; N(0,1) \text{ under } H_0$

Intuition

The core idea is that conditioning on the total count $N = X + Y$ eliminates the nuisance parameter (the common rate $\lambda$) entirely, leaving a distribution that depends only on the known observation time ratio. This is a recurring pattern in Poisson analysis: the total is sufficient for the rate, so conditioning on it produces a distribution-free test. It is the Poisson analog of Fisher's exact test for \times 2$ tables, and both are instances of conditioning on a sufficient statistic to remove nuisance parameters.

In practice, the exact conditional test is preferred when counts are small (rare events, short observation windows), because the normal approximation to the log rate ratio can be poor. The z-test on the log scale is the workhorse for large-sample comparisons -- it shows up in epidemiology (comparing incidence rates), reliability engineering (comparing failure rates), and finance (comparing event frequencies across regimes or portfolios). Note that the standard error $\sqrt{1/X + 1/Y}$ is the Poisson analog of the familiar $\sqrt{1/n_1 + 1/n_2}$ that appears in two-sample proportion tests.

Open the full interactive solver →