Analysis Project

Time-Resolved Decomposition of Agent-Based Model Dynamics

Eleven canonical models, four decomposition methods, one pipeline

11Models
4Methods
4Structural Classes
22Animations

Overview

An analysis project standing apart from any model library or companion publication. Eleven agent-based models serve as test systems across four structural classes: lattice, continuous space, network, and profile. Each model runs through the same decomposition pipeline, rendered as a movie that advances in step with the simulation that produced it, so spectral and correlation structure can be watched forming beside the simulation.

Models are cited to the sources below. Rules come from the reference implementations by Cuevas et al.

The four decompositions

Four measurements are computed for every model, adapted to the structural class of the model but never substituted for something easier.

Wavelet transform

A continuous transform with an analytic Morlet wavelet, applied to the order parameter, resolving when a timescale appears and whether it drifts. The transform is computed once over the full record and revealed behind an advancing cursor, which avoids the edge artifacts that a transform recomputed on truncated data would introduce at every frame.

Wavenumber transform

The radially averaged power spectral density of the two-dimensional discrete Fourier transform for a lattice, averaged over the annulus of constant wavenumber magnitude. On a network the operator is replaced by the graph Fourier transform, projecting node state onto the eigenvectors of the Laplacian, where the eigenvalue is the analog of squared wavenumber. Recomputed at every frame.

Cross-correlation

Normalized circular cross-correlation by way of the correlation theorem: between species for the predator-prey lattice, between agent categories for segregation, and frame to frame otherwise. A network instead receives a node-by-node correlation matrix ordered by the Fiedler vector. Recomputed at every frame.

Phase portrait

A trajectory in a two-dimensional state space. Natural coordinate pairs are used wherever a model supplies them, such as prey against predator or prevalence against incidence, and a delay embedding is used otherwise, with the delay taken at the first minimum of the autocorrelation.

Scope

Continuous wavelet analysis of an order parameter, radially averaged spatial power spectra, normalized cross-correlation, and phase portraits are all standard analysis methods. Spectral analysis of cellular automata is in developed literature, alongside graph signal processing applications to network epidemic states.

However, these methods often report on a single instant. In this gallery, decompositions are time-resolved and shown against the generating simulation instead of reported at a single instant. One pipeline spans four structural classes, with the wavenumber operator exchanged for the graph Fourier transform for the network domain. Spectra are computed on indicator fields rather than on categorical state codes as a lattice storing labels would otherwise be transformed to treat labels as magnitudes, making a predator coded as 2 twice a prey coded as 1. The analysis frame is selected by maximum lag-1 spatial autocorrelation rather than defaulting to the final state, which is frequently degenerate.

The six panels

Panels 4 and 5 are re-evaluated at every frame. Panels 2, 3, and 6 are progressive reveals of quantities defined over the whole record, which is marked in each panel title rather than left for a viewer to assume.

PanelContentBehavior
1Model stateThe rendered simulation frame
2Order parameterRevealed to the current time, with a marker at the cursor
3Wavelet scalogramRevealed to the current time behind a cursor
4Wavenumber spectrumRecomputed at every frame
5Cross-correlationRecomputed at every frame
6Phase portraitRevealed to the current time, with the current point marked

Models and analyses

On the left, the simulation. On the right, the six-panel decomposition advancing in step with it. Every animation starts as the page opens and loops continuously, so any pair can be compared against any other without a click. Readings under each pair are computed from the state file shipped with the model.

Game of Life

Alg. 7.1 Lattice

The cellular automaton of Conway on a 50 by 50 lattice with a cut-off boundary. The order parameter is the live-cell count.

Simulation
Decomposition, evolving in time
  • Live-cell count falls from 658 to a plateau near 222, where the standard deviation across the final fifth of the run is 16.
  • Frame-to-frame correlation measures 0.64 at the analysis frame and decays below 0.5 by a lag of 5 steps, which bounds the lifetime of a typical structure.
  • The wavenumber spectrum spans barely 1.3 decades at a slope near −1.2, so no single patch size dominates.

Fire and percolation

Alg. 7.2 Lattice

Fire spreading through a randomly seeded forest. A burning cell never extinguishes, which makes the process monotone percolation.

Simulation
Decomposition, evolving in time
  • Burnt-cell count rises monotonically to 17460 and then holds exactly constant, the signature of an absorbing state.
  • The dominant wavelet band peaks at step 143 of 250, which places the fastest advance of the fire front near the middle of the run.
  • Frame-to-frame correlation reaches 0.994 and never falls below 0.5 through a lag of 20, because burning is irreversible.

Heroes and cowards

Alg. 7.3 Continuous space

Agents position themselves relative to an assigned friend and an assigned enemy in continuous two-dimensional space.

Simulation
Decomposition, evolving in time
  • Swarm spread collapses from 7.1 to 0.48 by step 376, then re-expands to 8.9 by step 868.
  • Wavelet energy migrates toward lower frequency as the run proceeds, and the strongest band arrives in the final 200 steps.
  • The swarm centroid returns to within 15 percent of the starting separation, so circulation occurs with no net drift.

Wealth exchange

Alg. 7.4 Profile

Random pairwise transfer of one unit of currency, converging to a Boltzmann-Gibbs wealth distribution.

Simulation
Decomposition, evolving in time
  • The Gini coefficient climbs from 0.011 and settles near 0.408, varying by 1.5 percent across the final fifth of 3000 sweeps.
  • Wavelet energy occupies the lowest frequency band and decays steadily, the mark of one slow transient with no periodic component.
  • Two panels stay empty for a profile model, since a wealth distribution carries no spatial layout to correlate.

Segregation

Alg. 7.5 Continuous space

Relocation driven by counts of same-category neighbors, after Schelling. Reproduced as published, including a neighbor-selection defect.

Simulation
Decomposition, evolving in time
  • The segregation index locks at 0.7389 by step 8 and then holds to machine precision for the remaining 62 steps.
  • Cross-correlation between the two categories stays within 0.05 of zero at every offset, so the groups hold independent territory.
  • Frame-to-frame correlation remains above 0.5 through a lag of 20, the expected result once relocation stops.

One-dimensional diffusion

Alg. 7.6 Profile

Explicit finite-difference scheme at the stability limit, D = 0.5, with stochastic rounding.

Simulation
Decomposition, evolving in time
  • Peak concentration decays from 239 to 134 across 2000 iterations, and no single step increases.
  • The wavenumber spectrum falls at a slope near −1.1 across 9.6 decades, the widest dynamic range in the gallery.
  • The delay embedding traces an open arc that never revisits an earlier state, as irreversible spreading requires.

Two-dimensional diffusion

Alg. 7.7 Lattice

Explicit five-point scheme at the two-dimensional stability limit, D = 0.25.

Simulation
Decomposition, evolving in time
  • Peak concentration decays from 251 to 223 over 100 steps without a single increase.
  • The spectrum steepens to a slope of −2.6, the sharpest roll-off among the lattice models, because the field stays smooth.
  • Frame-to-frame correlation holds at 1.000 through a lag of 20, so the field evolves far more slowly than the frame interval.

Predator and prey

Alg. 7.9 Lattice

Energy-driven predation, reproduction, and death on a lattice. The prey-predator plane traces one orbit within the captured run.

Simulation
Decomposition, evolving in time
  • Prey count completes one boom and collapse inside 100 steps, rising from 256 at step 5 to 8155 at step 33.
  • The two species reach maximum anti-correlation at zero spatial offset, −0.408, so predators and prey hold mutually exclusive ground.
  • The phase portrait traces a single orbit in the prey-predator plane before predator numbers fall to zero.

Voter model

Alg. 7.10 Network

Opinion dynamics on the karate club network of Zachary, push variant.

Simulation
Decomposition, evolving in time
  • The majority fraction wanders between 0.53 and 0.97 across 4000 updates, and consensus stays out of reach.
  • Graph Fourier energy concentrates at mode 13 of 34 (λ = 2), which carries 45 percent of the total.
  • Node-node correlation reaches −0.62 between opposing blocs, and Fiedler ordering separates the club into two camps.

SIS epidemic

Alg. 7.11 Network

Susceptible-infected-susceptible spreading on the same network, under a Greenwood force of infection that is independent of the number of exposures.

Simulation
Decomposition, evolving in time
  • Prevalence fluctuates between 6 and 16 infected nodes across the final fifth of the run, and the infection never dies out.
  • Outbreak peaks recur at irregular spacings between 66 and 164 steps, so the process carries no fixed period.
  • Graph Fourier energy spreads across the spectrum, and the largest single mode holds only 15 percent.

Network diffusion

Alg. 7.12 Network

Graph-Laplacian diffusion converging to consensus.

Simulation
Decomposition, evolving in time
  • Spread decays monotonically from 30.6 to 0.05 over 10000 steps, and no step increases.
  • The graph Fourier transform collapses onto the Fiedler mode (λ = 0.469), which retains 100 percent of the energy.
  • Across the three models sharing this 34-node graph, low-mode energy separates the dynamics cleanly: 100 percent for diffusion, 5 percent for the epidemic, and 3 percent for the voter model.

References

  1. Cuevas, E., Avila, K., Islas Toski, M., and Escobar, H. (2025). Agent-Based Models with MATLAB. Morgan Kaufmann and Elsevier. Source of the model rules used here.
  2. Li, W. Power Spectra of Regular Languages and Cellular Automata. Complex Systems.
  3. Ninagawa, S. Power Spectral Analysis of Elementary Cellular Automata. Complex Systems, 17(4).
  4. Infection Analysis on Irregular Networks through Graph Signal Processing (2018). arXiv:1808.04879.
  5. Shuman, D. I., Narang, S. K., Frossard, P., Ortega, A., and Vandergheynst, P. The Emerging Field of Signal Processing on Graphs. IEEE Signal Processing Magazine.
  6. Schelling, T. C. (1971). Dynamic models of segregation. Journal of Mathematical Sociology, 1(2), 143–186.
  7. Dragulescu, A., and Yakovenko, V. M. (2000). Statistical mechanics of money. European Physical Journal B, 17(4), 723–729.
  8. Zachary, W. W. (1977). An information flow model for conflict and fission in small groups. Journal of Anthropological Research, 33, 452–473. Contact network for the voter, epidemic, and network-diffusion models.
  9. Allen, L. J. S. An Introduction to Stochastic Epidemic Models. Greenwood and Reed-Frost chain-binomial formulations.