ACD-ABM: mechanism circuit tracing demonstrated on three agent-based simulators (network SIR, interbank contagion, NearshoreABM_XAI) 1.0.0
Three stochastic simulators and the code that traces causal mechanisms in them. (1) Network SIR: a susceptible-infected-recovered process on a Barabási-Albert network of 100 agents. (2) Interbank contagion: 100 banks in which distress spreads through DebtRank dynamics and through fire sales of a common illiquid asset, with two policy instruments, emergency liquidity assistance and a market-maker of last resort. (3) NearshoreABM_XAI: the NearshoreABM model of anchor and supplier firms in the 32 Mexican states, instrumented so that the outputs of its credit, matching and infrastructure mechanisms can be recorded and injected.
The three are analyzed with ACD-ABM, a gradient-free method that attributes the effect of a policy on an aggregate outcome to the model’s mechanisms and to the simulation steps at which they act. It records the output of each mechanism in a baseline run, injects it into a policy run whose random number generator is synchronized with the baseline, and measures the share of the policy effect that the patch undoes (Expected Causal Effect), with paired bootstrap intervals, a coverage check of the mechanism partition and a rule that declines attribution when the policy effect cannot be distinguished from zero. The method is implemented in a simulator-independent Julia module.
All scripts, input data and reference outputs needed to reproduce the tables and figures of the associated article are included.
Release Notes
First release. Accompanies the article “Mechanism Circuit Tracing for Stochastic Simulators: A Gradient-Free Causal Interpretability Framework” (Intelligent Computing, 2026).
To reproduce every table and figure of the article:
julia run_all.jl
python figures/make_figures.py
python figures/make_fig1.py
python compare_with_reference.py
Requires Julia 1.12 (packages are pinned in abm/NearshoreABM_XAI/Manifest.toml) and, for the figures and the comparison script, Python 3 with NumPy and Matplotlib. The full sequence takes a little over an hour on a 12-thread workstation. See README.md for the script behind each table and figure.