Realizing Common Random Numbers: Event-Keyed Hashing for Causally Valid Stochastic Models

📅 2026-03-10
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses a critical issue in counterfactual simulation: traditional state-based pseudorandom number generators (PRNGs) break the correspondence between events and their associated random numbers when interventions alter execution paths, leading to causal inconsistencies in counterfactual comparisons. To resolve this, the authors propose an event-keyed hashing mechanism that integrates counter-based PRNGs—such as Philox or Threefry—with unique event identifiers. This approach decouples random number generation from execution order and explicitly binds stochasticity to the modeled events themselves. By doing so, it restores the stable exogenous structure required by structural causal models, enabling causally consistent paired counterfactual simulations. The method effectively mitigates variance control failure and bias in causal inference caused by changes in simulation execution paths.

Technology Category

Application Category

📝 Abstract
Agent-based models (ABMs) are widely used to estimate causal treatment effects via paired counterfactual simulation. A standard variance reduction technique is common random numbers (CRNs), which couples replicates across intervention scenarios by sharing the same random inputs. In practice, CRNs are implemented by reusing the same base seed, but this relies on a critical assumption: that the same draw index corresponds to the same modeled event across scenarios. Stateful pseudorandom number generators (PRNGs) violate this assumption whenever interventions alter the simulation's execution path, because any change in control flow shifts the draw index used for all downstream events. We argue that this execution-path-dependent draw indexing is not only a variance-reduction nuisance, but represents a fundamental mismatch between the scientific causal structure ABMs are intended to encode and the program-level causal structure induced by stateful PRNG implementations. Formalizing this through the lens of structural causal models (SCMs), we show that standard PRNG practices yield causally incoherent paired counterfactual comparisons even when the mechanistic specification is otherwise sound. We show that a remedy is to combine counter-based random number generators (e.g., Philox/Threefry) with event identifiers. This decouples random number generation from simulation execution order by making random draws explicit functions of the particular modeled event that called them, restoring the stable event-indexed exogenous structure assumed by SCMs.
Problem

Research questions and friction points this paper is trying to address.

common random numbers
agent-based models
causal inference
pseudorandom number generators
counterfactual simulation
Innovation

Methods, ideas, or system contributions that make the work stand out.

Common Random Numbers
Counterfactual Simulation
Structural Causal Models
Counter-based PRNGs
Event-Keyed Hashing
🔎 Similar Papers
No similar papers found.
V
Vince Buffalo
Institute for Disease Modeling, Gates Foundation, Seattle, WA
C
Carl A. B. Pearson
Department of Epidemiology, University of North Carolina, Chapel Hill, NC
Daniel Klein
Daniel Klein
Professor of Economics, George Mason University
political economymoral philosophy