# Comparing Equation-Based and Agent-Based Data Generation Methods for Early Warning Signal Analysis

^{*}

## Abstract

**:**

## 1. Introduction

## 2. System Used for Data Generation

#### 2.1. Pitchfork System

#### 2.2. Hysteresis System

## 3. Data Generation and Comparison

## 4. Early Warning Signal Analysis

## 5. Results

#### 5.1. Pitchfork System

#### 5.2. Hysteresis System

## 6. Discussion and Limitations

## 7. Summary

## Author Contributions

## Funding

## Conflicts of Interest

## Appendix A

Pseudocode: 2D Ising model using Metropolis algorithm |

Create an initial lattice configuration of $N$ × $N$ spins for the total number of spins do: Select a random spin ${S}_{i}$ Compute the change in energy $\mathsf{\Delta}E$ associated with flipping the spin: (A) Pitchfork Model: $\mathsf{\Delta}E=2\cdot {S}_{i}\cdot {\sum}_{\langle i,j\rangle}{S}_{j}$ (B) Hysteresis Model: $\mathsf{\Delta}E=2\cdot {S}_{i}\cdot \left({\sum}_{\langle i,j\rangle}{S}_{i,j}-H\right)$ Generate a uniformly distributed random number $R$ between 0 and 1 if $R<{e}^{-\mathsf{\Delta}E\cdot T}$ then: Accept the flip: ${S}_{i}\leftarrow -{S}_{i}$ else: Do not accept the flip: ${S}_{i}\leftarrow {S}_{i}$ end ifend for |

## References

- Boettiger, C.; Ross, N.; Hastings, A. Early warning signals: The charted and uncharted territories. Theor. Ecol.
**2013**, 6, 255–264. [Google Scholar] [CrossRef] [Green Version] - Scheffer, M. Critical Transitions in Nature and Society; Princeton University Press: Princeton, NJ, USA, 2009. [Google Scholar]
- Kuehn, C. A mathematical framework for critical transitions: Bifurcations, fast–slow systems and stochastic dynamics. Phys. D Nonlinear Phenom.
**2011**, 240, 1020–1035. [Google Scholar] [CrossRef] [Green Version] - Scheffer, M.; Carpenter, S.; Foley, J.A.; Folke, C.; Walker, B.R. Catastrophic shifts in ecosystems. Nat. Cell Biol.
**2001**, 413, 591–596. [Google Scholar] [CrossRef] - Scheffer, M.; Carpenter, S.R. Catastrophic regime shifts in ecosystems: Linking theory to observation. Trends Ecol. Evol.
**2003**, 18, 648–656. [Google Scholar] [CrossRef] - May, R.M.; Levin, S.A.; Sugihara, G. Ecology for bankers. Nature
**2008**, 451, 893–894. [Google Scholar] [CrossRef] [Green Version] - McSharry, P.E.; Smith, L.A.; Tarassenko, L. Prediction of epileptic seizures: Are nonlinear methods relevant? Nat. Med.
**2003**, 9, 241–242. [Google Scholar] [CrossRef] - Venegas, J.G.; Winkler, T.; Musch, G.; Melo, M.F.V.; Layfield, D.; Tgavalekos, N.; Fischman, A.J.; Callahan, R.J.; Bellani, G.; Harris, R.S. Self-organized patchiness in asthma as a prelude to catastrophic shifts. Nat. Cell Biol.
**2005**, 434, 777–782. [Google Scholar] [CrossRef] - Bakke, J.; Lie, Ø.; Heegaard, E.; Dokken, T.; Haug, G.H.; Birks, H.H.; Dulski, P.; Nilsen, T. Rapid oceanic and atmospheric changes during the Younger Dryas cold period. Nat. Geosci.
**2009**, 2, 202–205. [Google Scholar] [CrossRef] - Lenton, T.M.; Held, H.; Kriegler, E.; Hall, J.W.; Lucht, W.; Rahmstorf, S.; Schellnhuber, H.J. Tipping elements in the Earth’s climate system. Proc. Natl. Acad. Sci. USA
**2008**, 105, 1786–1793. [Google Scholar] [CrossRef] [Green Version] - Dakos, V.; Carpenter, S.R.; Brock, W.A.; Ellison, A.M.; Guttal, V.; Ives, A.R.; Kéfi, S.; Livina, V.N.; Seekell, D.A.; Van Nes, E.H.; et al. Methods for Detecting Early Warnings of Critical Transitions in Time Series Illustrated Using Simulated Ecological Data. PLoS ONE
**2012**, 7, e41010. [Google Scholar] [CrossRef] [Green Version] - Jäger, G.; Füllsack, M. Systematically false positives in early warning signal analysis. PLoS ONE
**2019**, 14, e0211072. [Google Scholar] [CrossRef] [Green Version] - Wu, Z.; Huang, N.E.; Long, S.R.; Peng, C.-K. On the trend, detrending, and variability of nonlinear and nonstationary time series. Proc. Natl. Acad. Sci. USA
**2007**, 104, 14889–14894. [Google Scholar] [CrossRef] [Green Version] - Kéfi, S.; Dakos, V.; Scheffer, M.; Van Nes, E.H.; Rietkerk, M. Early warning signals also precede non-catastrophic transitions. Oikos
**2012**, 122, 641–648. [Google Scholar] [CrossRef] [Green Version] - Biggs, R.; Carpenter, S.R.; Brock, W.A. Turning back from the brink: Detecting an impending regime shift in time to avert it. Proc. Natl. Acad. Sci. USA
**2009**, 106, 826–831. [Google Scholar] [CrossRef] [Green Version] - D’Souza, K.; Epureanu, B.I.; Pascual, M. Forecasting Bifurcations from Large Perturbation Recoveries in Feedback Ecosystems. PLoS ONE
**2015**, 10, e0137779. [Google Scholar] [CrossRef] - Füllsack, M.; Plakolb, S.; Jäger, G. Predicting regime shifts in social systems modelled with agent-based methods. J. Comput. Soc. Sci.
**2020**, 1–23. [Google Scholar] [CrossRef] - Hofer, C.; Jäger, G.; Füllsack, M. Critical transitions and Early Warning Signals in repeated Cooperation Games. J. Dyn. Games
**2018**, 5, 223–230. [Google Scholar] [CrossRef] [Green Version] - Huet, S.; Edwards, M.; Deffuant, G. Taking into account the variations of social network in the mean-field approximation of the threshold behaviour diffusion model. In Proceedings of the ESSA Conference Model to Model Workshop, Valladolid, Spain, 16–19 September 2004; p. 15. [Google Scholar]
- Mabrouk, N. Analyzing Individual-Based Models of Microbial Systems. Ph.D. Thesis, Université Blaise Pascal Clermont II, Clermont-Ferrand, France, 2010. [Google Scholar]
- Edwards, M.; Huet, S.; Goreaud, F.; Deffuant, G. Comparing an individual-based model of behaviour diffusion with its mean field aggregate approximation. J. Artif. Soc. Soc. Simul.
**2003**, 6, 4. [Google Scholar] - Ising, E. Beitrag zur theorie des ferromagnetismus. Zeitschrift für Physik
**1925**, 31, 253–258. (In Germany) [Google Scholar] [CrossRef] - Morales, I.O.; Landa, E.; Angeles, C.C.; Toledo, J.C.; Rivera, A.L.; Temis, J.M.; Frank, A. Behavior of Early Warnings near the Critical Temperature in the Two-Dimensional Ising Model. PLoS ONE
**2015**, 10, e0130751. [Google Scholar] [CrossRef] [Green Version] - Smug, D.; Sornette, D.; Ashwin, P. A Generalized 2D-Dynamical Mean-Field Ising Model with a Rich Set of Bifurcations (Inspired and Applied to Financial Crises). Int. J. Bifurc. Chaos
**2018**, 28. [Google Scholar] [CrossRef] [Green Version] - McCoy, B.M.; Wu, T.T. The Two-Dimensional Ising Model; Courier Corporation: North Chelmsford, MA, USA, 2014. [Google Scholar]
- Grabowski, A.; Kosiński, R. Ising-based model of opinion formation in a complex network of interpersonal interactions. Phys. A Stat. Mech. Its Appl.
**2006**, 361, 651–664. [Google Scholar] [CrossRef] - Ostilli, M.; Yoneki, E.; Leung, I.X.; Mendes, J.F.F.; Liò, P.; Crowcroft, J. Statistical mechanics of rumour spreading in network communities. Procedia Comput. Sci.
**2010**, 1, 2331–2339. [Google Scholar] [CrossRef] [Green Version] - Roli, A. An Introduction to Complex System Science. 2015. Available online: http://www.lia.disi.unibo.it/~aro/download/css-course/css-lecture_notes.pdf (accessed on 9 December 2020).
- Singh, R. IsingModel. 2014. Available online: https://rajeshrinet.github.io/blog/2014/ising-model (accessed on 9 December 2020).
- Stone, J.V. Information Theory: A Tutorial Introduction; Sebtel Press: Sheffield, UK, 2015. [Google Scholar]
- Murdock, J. Normal forms. Scholarpedia
**2006**, 1, 1902. [Google Scholar] [CrossRef] - Tan, P.-N.; Steinbach, M.; Kumar, V. Introduction to Data Mining; Pearson: London, UK, 2014. [Google Scholar]
- Müller, M. Information Retrieval for Music and Motion. In Information Retrieval for Music and Motion; Springer: Berlin/Heidelberg, Germany, 2007; pp. 69–84. [Google Scholar]
- Dakos, V.; Bascompte, J. Critical slowing down as early warning for the onset of collapse in mutualistic communities. Proc. Natl. Acad. Sci. USA
**2014**, 111, 17546–17551. [Google Scholar] [CrossRef] [Green Version] - Scheffer, M.; Carpenter, S.R.; Lenton, T.M.; Bascompte, J.; Brock, W.A.; Dakos, V.; Van De Koppel, J.; Van De Leemput, I.A.; Levin, S.A.; Van Nes, E.H.; et al. Anticipating Critical Transitions. Science
**2012**, 338, 344–348. [Google Scholar] [CrossRef] [Green Version] - Kendall, M.G. The treatment of ties in ranking problems. Biometrika
**1945**, 33, 239–251. [Google Scholar] [CrossRef] - Jones, E.; Oliphant, T.; Peterson, P. SciPy: Open Source Scientific Tools for Python. 2001. Available online: http://www.scipy.org (accessed on 9 December 2020).
- Wen, H.; Ciamarra, M.P.; Cheong, S.A. How one might miss early warning signals of critical transitions in time series data: A systematic study of two major currency pairs. PLoS ONE
**2018**, 13, e0191439. [Google Scholar] [CrossRef] [Green Version]

**Figure 1.**Top row plots: mean (bold), min and max (brighter) of 100 time series each as used for early warning signal (EWS) analysis from the pitchfork (left column) and the hysteresis (right column) system, generated from simulations with agent-based model (ABM) (blue) and equation-based model (EBM) (green). In red are the theoretical (i.e., mathematically calculated) equilibria (or tipping) of the systems. Second row plots: results of dynamic time warping (DTW) comparison of ABM and EBM data, indicating a distinctively closer match in the pitchfork system. Bottom row plots: phase portrait of ABM and EBM data, confirming the closer match in the pitchfork system with additional indicators.

**Figure 2.**EWS analysis of Ising time-series (TS) in pitchfork mode. Left column shows analysis of EBM-generated data; the right, of ABM-generated data (blue: original data; green: detrended). Solid lines indicate mean curves; brighter areas mark upper and lower bounds of samples. The bold solid line segment (time steps 100 to 1700) shows the range to which Kendall’s τ calculation was applied. The red dashed line in the first-row plots shows the mathematically calculated (i.e., theoretical) upper equilibrium branch of the pitchfork bifurcation. Note that the coefficient of variation (CV), detrended fluctuation analysis (DFA) and Reddening are indicators that by themselves apply detrending to data. That is why no separate (green) signals are shown in these cases.

**Figure 3.**EWS analysis of Ising time-series (TS) in hysteresis mode. All plots and indications in analogy to Figure 2. In this case, the red dashed line in the first-row plots shows the mathematically calculated (i.e., theoretical) sigmoid curve of a combined saddle-node bifurcation.

Agent-Based Model | Equation-Based Model | |
---|---|---|

Pitchfork system | 2D Ising model without external field | Mean-field approximation of 2D Ising model without external field |

Hysteresis system | 2D Ising model with external field | Mean-field approximation of 2D Ising model with external field |

Agent-Based Pitchfork Model | Equation-Based Pitchfork Model | ||
---|---|---|---|

Temperature T (critical parameter) | Over [1.42, 3.12] | Inverse temp. B (critical parameter) | Over [2.7, −0.3] |

Lattice size N | 50 < N < 100 | Time step ∆t | 0.1 |

Weight of normal distribution p | 0.01 < p < 0.02 |

Agent-Based Pitchfork Model | Equation-Based Pitchfork Model | ||
---|---|---|---|

External field H (critical parameter) | Over [−0.2, 0.2] | External field H (critical parameter) | Over [0.6, −0.5] |

Lattice size N | 50 < N < 100 | Time step ∆t | 0.1 |

Temperature T | 2.12 | Inverse temp. B | 1.3 |

Weight of normal distribution p | 0.004 < p < 0.008 |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Reisinger, D.; Füllsack, M.
Comparing Equation-Based and Agent-Based Data Generation Methods for Early Warning Signal Analysis. *Systems* **2020**, *8*, 54.
https://doi.org/10.3390/systems8040054

**AMA Style**

Reisinger D, Füllsack M.
Comparing Equation-Based and Agent-Based Data Generation Methods for Early Warning Signal Analysis. *Systems*. 2020; 8(4):54.
https://doi.org/10.3390/systems8040054

**Chicago/Turabian Style**

Reisinger, Daniel, and Manfred Füllsack.
2020. "Comparing Equation-Based and Agent-Based Data Generation Methods for Early Warning Signal Analysis" *Systems* 8, no. 4: 54.
https://doi.org/10.3390/systems8040054