Say your team runs an A/B test on a site with millions of events a day, spread across dozens of servers. You want a confidence interval for average order value. The classic bootstrap tells you to resample n rows with replacement, a few thousand times. But no single machine has all the rows, and you do not know n until the day is over.
The Poisson bootstrap solves this. Instead of drawing a resample of exactly n rows, it gives every row an independent weight drawn from a Poisson distribution with mean 1. Each row can be weighted the moment it arrives, on whatever machine it lands on, without knowing how many other rows exist. For large datasets the result matches the classic bootstrap closely. In our NumPy test on 20,000 skewed values, the two methods gave standard errors of 0.2974 and 0.3021 for the mean, against 0.2985 from the textbook formula.
Key Takeaways
- The classic bootstrap resamples
nrows with replacement. The Poisson bootstrap gives each row an independent Poisson(1) weight instead. - Poisson weights do not depend on
nor on other rows, so they work in a single pass over a stream and across many machines. - Each Poisson replicate has a slightly different size (about
non average). For largenthe difference from the classic bootstrap is negligible. - On one machine with data in memory, the classic bootstrap is simpler and was faster in our test. Use the Poisson version when data is streaming or distributed.
- To combine results from many workers, add up their weighted sums and weight totals per replicate, then divide.
What Is the Bootstrap?
The bootstrap is a resampling method for measuring the uncertainty of a statistic. Bradley Efron introduced it in 1979 in “Bootstrap Methods: Another Look at the Jackknife” (Annals of Statistics). You draw many resamples of your data with replacement, compute the statistic on each one, and use the spread of those results as an estimate of its standard error or confidence interval.
Its appeal is that it works for statistics without a simple formula, such as medians, ratios or the coefficients of a two-step model. Our guide to the Heckman selection model recommends it for exactly that reason.
(In reinforcement learning, “bootstrapping” means something unrelated: updating an estimate from another estimate. Our post on n-step TD bootstrapping covers that one.)
How the Poisson Bootstrap Works
In a classic resample of n rows, each row appears some number of times: 0, 1, 2 or more. Those counts follow a multinomial distribution, and they depend on each other, because they must add up to exactly n. That dependency is the problem. To draw the counts, you need to know n and see all the rows.
For large n, the count for any one row is very close to a Poisson distribution with mean 1. The Poisson bootstrap uses that directly: for each replicate, draw an independent Poisson(1) count for every row and use it as the row’s weight. About 37% of rows get weight 0, about 37% get 1, about 18% get 2, and so on. Hanley and MacGibbon described the approach in 2006 in “Creating non-parametric bootstrap samples using Poisson frequencies”. Google researchers later showed how it scales to very large data streams, in a 2012 paper on estimating uncertainty in data streams by Chamandy, Muralidharan, Najmi and Naidu.
The trade-off is that replicate sizes vary. A Poisson replicate of 20,000 rows might have 19,881 or 20,223 rows in total. For large data, that variation is tiny compared with n and has little effect on the result.
Classic vs Poisson Bootstrap in NumPy
The script below draws 20,000 values from a skewed (lognormal) distribution, like order values or session lengths, and estimates the standard error of the mean with both methods, 2,000 replicates each. The mean is a good test case because we can check both against the textbook formula.
import time
import numpy as np
rng = np.random.default_rng(7)
# Skewed data, like order values or session lengths
data = rng.lognormal(mean=3.0, sigma=1.0, size=20_000)
B = 2_000
# Classic bootstrap: resample n rows with replacement, B times
t0 = time.perf_counter()
classic = np.empty(B)
for b in range(B):
idx = rng.integers(0, data.size, data.size)
classic[b] = data[idx].mean()
t_classic = time.perf_counter() - t0
# Poisson bootstrap: give every row a Poisson(1) weight, B times
t0 = time.perf_counter()
poisson = np.empty(B)
for b in range(B):
w = rng.poisson(1.0, data.size)
poisson[b] = (w * data).sum() / w.sum()
t_poisson = time.perf_counter() - t0
se_formula = data.std(ddof=1) / np.sqrt(data.size)
print(f"Sample mean: {data.mean():.3f}")
print(f"Formula SE: {se_formula:.4f}")
print(f"Classic bootstrap SE: {classic.std(ddof=1):.4f} ({t_classic:.2f} s)")
print(f"Poisson bootstrap SE: {poisson.std(ddof=1):.4f} ({t_poisson:.2f} s)")
print("Classic 95% CI:", np.round(np.percentile(classic, [2.5, 97.5]), 3))
print("Poisson 95% CI:", np.round(np.percentile(poisson, [2.5, 97.5]), 3))
# Each Poisson replicate has a slightly different size
sizes = rng.poisson(1.0, (5, data.size)).sum(axis=1)
print("Example replicate sizes:", sizes.tolist()) Output (Python 3.13, NumPy 2.5):
Sample mean: 32.646
Formula SE: 0.2985
Classic bootstrap SE: 0.2974 (0.26 s)
Poisson bootstrap SE: 0.3021 (1.48 s)
Classic 95% CI: [32.078 33.239]
Poisson 95% CI: [32.074 33.269]
Example replicate sizes: [20071, 20223, 19881, 20008, 20025] Both bootstraps land within about 1% of the formula’s standard error, and the 95% intervals agree to within 0.03. The replicate sizes show the one real difference: Poisson replicates are close to 20,000 rows, not exactly 20,000.
Note the timing. On one machine, NumPy generates Poisson weights more slowly than random indices, so the classic bootstrap was five to six times faster here. Timings vary by machine and run. The Poisson bootstrap is not a speed trick for data in memory. Its value shows up when the data is not all in one place.
Why It Suits Streaming Data
Because each row’s weight is drawn on its own, you can process data in one pass as it arrives and never store it. For each of B replicates, keep two running numbers: the weighted sum of values and the sum of weights. When a new chunk arrives, draw its weights, update the totals and drop the chunk.
# Streaming: one pass over chunks, B running sums, nothing stored
def poisson_sums(chunks, B, seed):
rng = np.random.default_rng(seed)
sums = np.zeros(B)
counts = np.zeros(B)
for chunk in chunks:
w = rng.poisson(1.0, (B, chunk.size)) # weights for this chunk only
sums += w @ chunk
counts += w.sum(axis=1)
return sums, counts
chunks = np.array_split(data, 40) # e.g. 40 files arriving over time
sums, counts = poisson_sums(chunks, B=1_000, seed=1)
print(f"Streaming Poisson SE: {(sums / counts).std(ddof=1):.4f}") Streaming Poisson SE: 0.2905 Memory use depends on B and the chunk size, not on how many rows have ever arrived. You can read off a confidence interval at any moment, such as every hour during a test. The classic bootstrap cannot do this, because it needs the final n before drawing a single resample. The estimate here (0.291) differs a little from the earlier run because it uses 1,000 replicates and different random weights. Bootstrap standard errors always carry some simulation noise.
Why It Suits Distributed Data
The same independence makes the method easy to split across machines. Each worker weights its own rows with its own random seed, keeps per-replicate sums and weight totals, and sends back two arrays of length B. The coordinator adds them up.
# Distributed: 4 workers, each with its own rows and seed, then add up
parts = np.array_split(data, 4)
results = [poisson_sums([p], B=1_000, seed=100 + i) for i, p in enumerate(parts)]
total_sums = sum(r[0] for r in results)
total_counts = sum(r[1] for r in results)
print(f"Distributed Poisson SE: {(total_sums / total_counts).std(ddof=1):.4f}") Distributed Poisson SE: 0.3033 No worker needs to know how many rows the others hold, and no rows move between machines. That is a natural fit for MapReduce, Spark or any system that combines partial sums. The Chamandy et al. paper describes this pattern at Google scale, and Amir Najmi’s post An Introduction to the Poisson Bootstrap on the Unofficial Google Data Science blog explains it in plain terms.
Two practical details matter in a real system. First, give each worker a different seed, or the “independent” weights will repeat across machines. Second, if the same user can appear on several workers, generate weights per user rather than per row (for example, from a hash of the user ID and the replicate number), so all of a user’s events share one weight. Otherwise the bootstrap treats correlated rows as independent and understates the uncertainty.
When to Use Which
| Situation | Better choice |
|---|---|
| Data fits in memory on one machine | Classic bootstrap (simpler, exact n) |
| Data arrives as a stream; you want running intervals | Poisson bootstrap |
| Data is split across many workers | Poisson bootstrap |
| Very few rows (say, under 100) | Classic bootstrap; varying replicate sizes matter more |
Back to the A/B Test
The team from the opening no longer needs every event on one machine. Each server draws 1,000 Poisson weights for every event as it arrives, keeps 1,000 weighted sums and 1,000 weight totals, and sends them on a schedule. Adding those totals gives a confidence interval for average order value at any point in the day. In our tests, every Poisson estimate of the standard error, in memory, streaming or split across workers, stayed within 3% of the textbook formula.
Frequently Asked Questions
Is the Poisson Bootstrap Exact?
It is an approximation of the classic bootstrap, which is itself an approximation. The difference comes from the varying replicate size and shrinks as n grows. For datasets with thousands of rows or more, the two give practically the same answer, as the example above shows.
Does It Work for Medians and Other Statistics?
Yes. Any statistic you can compute from weighted data works, such as a weighted median or a weighted quantile. Statistics built from sums (means, ratios, rates) are the easiest because they combine across workers by simple addition. Quantiles need a weighted sketch or another mergeable summary.
How Many Replicates Do I Need?
A few hundred replicates are often enough for a standard error. Confidence intervals based on percentiles need more, commonly 1,000 or more, because the tails are estimated from fewer replicates. In streaming systems, memory and compute grow with the number of replicates, so pick the smallest number that gives stable intervals on your data.
Why Poisson With Mean 1?
In a classic resample of n rows, each row is picked n times with probability 1/n, so its count has mean 1. As n grows, that binomial count approaches a Poisson distribution with mean 1. Using Poisson(1) directly keeps the same average behavior while removing the need to know n.




