# Combining Mathematical and Simulation Approaches to Understand the Dynamics of Computer Models

• Luis R. Izquierdo
• Segismundo S. Izquierdo
• José M. Galán
• José I. Santos
Chapter
Part of the Understanding Complex Systems book series (UCS)

To learn how to better understand the dynamics of computer models using both simulation and mathematical analysis. Our starting point is a computer model which is already implemented and ready to be run; the objective is to gain a thorough understanding of its dynamics. Combining computer simulation with mathematical analysis can help to provide a picture of the model dynamics that could not be drawn by using only one of the two techniques.

### Abstract

This chapter shows how computer simulation and mathematical analysis can be used together to understand the dynamics of computer models. For this purpose, we show that it is useful to see the computer model as a particular implementation of a formal model in a certain programming language. This formal model is the abstract entity which is defined by the input-output relation that the computer model executes, and can be seen as a function that transforms probability distributions over the set of possible inputs into probability distributions over the set of possible outputs.

It is shown here that both computer simulation and mathematical analysis are extremely useful tools to analyse this formal model, and they are certainly complementary in the sense that they can provide fundamentally different insights on the same model. Even more importantly, this chapter shows that there are plenty of synergies to be exploited by using the two techniques together.

The mathematical approach to analyse formal models consists in examining the rules that define the model directly. Its aim is to deduce the logical implications of these rules for any particular instance to which they can be applied. Our analysis of mathematical techniques to study formal models is focused on the theory of Markov Chains, which is particularly useful to characterise the dynamics of computer models.

In contrast with mathematical analysis, the computer simulation approach does not look at the rules that define the formal model directly, but instead tries to infer general properties of these rules by examining the outputs they produce when applied to particular instances of the input space. Thus, conclusions obtained with this approach may not be general. On a more positive note, computer simulation enables us to explore formal models beyond mathematical tractability, and we can achieve any arbitrary level of accuracy in our computational approximations by running the model sufficiently many times.

Bearing in mind the relative strengths and limitations of both approaches, this chapter explains three different ways in which mathematical analysis and computer simulation can be usefully combined to produce a better understanding of the dynamics of computer models. In doing so, it becomes clear that mathematical analysis and computer simulation should not be regarded as alternative – or even opposed – approaches to the formal study of social systems, but as complementary. Not only can they provide fundamentally different insights on the same model, but they can also produce hints for solutions for each other. In short, there are plenty of synergies to be exploited by using the two techniques together, so the full potential of each technique cannot be reached unless they are used in conjunction.

## Keywords

Computer Simulation Markov Chain Computer Model Formal Model Mathematical Analysis
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

## Notes

### Acknowledgements

The authors have benefited from the financial support of the Spanish Ministry of Education and Science (projects DPI2004-06590, DPI2005-05676 and TIN2008-06464-C03-02), the Spanish Ministry for Science and Innovation (CSD2010-00034), and the JCyL (projects VA006B09, BU034A08 and GREX251-2009). We are also very grateful to Nick Gotts, Bruce Edmonds, Gary Polhill, and Cesáreo Hernández for many extremely useful discussions.

## References

1. Arthur WB (1989) Competing technologies, increasing returns, and lock-in by historical events. Econ J 99(394):116–131
2. Arthur WB, Holland JH, LeBaron B, Palmer R, Tayler P (1997) Asset pricing under endogenous expectations in an artificial stock market. In: Arthur WB, Durlauf S, Lane D (eds) The economy as an evolving complex system II. Addison-Wesley Longman, Reading, pp 15–44Google Scholar
3. Axelrod RM (1986) An evolutionary approach to norms. Am Polit Sci Rev 80(4):1095–1111
4. Axelrod RM (1997a) Advancing the art of simulation in the social sciences. In: Conte R, Hegselmann R, Terna P (eds) Simulating social phenomena (Lecture notes in economics and mathematical systems, 456). Springer, Berlin, pp 21–40Google Scholar
5. Axelrod RM (1997b) The dissemination of culture: a model with local convergence and global polarization. J Confl Resolut 41(2):203–226
6. Axelrod RM, Bennett DS (1993) A landscape theory of aggregation. Br J Polit Sci 23(2):211–233
7. Axtell RL (2000) Why agents? On the varied motivations for agent computing in the social sciences. In: Macal VM, Sallach D (eds) Proceedings of the workshop on agent simulation: applications, models, and tools, Argonne National Laboratory, Argonne, pp 3–24Google Scholar
8. Axtell RL, Epstein JM (1994) Agent based modeling: understanding our creations. The Bulletin of the Santa Fe Institute, Winter 1994, pp 28–32Google Scholar
9. Balzer W, Brendel KR, Hofmann S (2001) Bad arguments in the comparison of game theory and simulation in social studies. J Artif Soc Soc Simul 4(2), http://jasss.soc.surrey.ac.uk/4/2/1.html
10. Benveniste A, Métivier M, Priouret P (1990) Adaptive algorithms and stochastic approximations. Springer, Berlin
11. Böhm C, Jacopini G (1966) Flow diagrams, turing machines and languages with only two formation rules. Commun ACM 9(5):366–371
12. Bush RR, Mosteller F (1955) Stochastic models for learning. Wiley, New York
13. Castellano C, Marsili M, Vespignani A (2000) Nonequilibrium phase transition in a model for social influence. Phys Rev Lett 85(16):3536–3539
14. Cutland N (1980) Computability: an introduction to recursive function theory. Cambridge University Press, Cambridge
15. Edmonds B (2001) The use of models: making MABS actually work. In: Moss S, Davidsson P (eds) Multi-agent-based simulation (Lecture notes in artificial intelligence, 1979). Springer, Berlin, pp 15–32Google Scholar
16. Edmonds B (2005) Simulation and complexity: how they can relate. In: Feldmann V, Mühlfeld K (eds) Virtual worlds of precision: computer-based simulations in the sciences and social sciences. Lit-Verlag, Münster, pp 5–32Google Scholar
17. Edwards M, Huet S, Goreaud F, Deffuant G (2003) Comparing an individual-based model of behaviour diffusion with its mean field aggregate approximation. J Artif Soc Soc Simul 6(4), http://jasss.soc.surrey.ac.uk/6/4/9.html
18. Ehrentreich N (2002) The Santa Fe Artificial Stock Market re-examined: suggested corrections (Betriebswirtschaftliche Diskussionsbeiträge Nr. 45/02). Wirtschaftswissenschaftliche Fakultät, Martin-Luther-Universität, Halle/Saale, http://econwpa.wustl.edu:80/eps/comp/papers/0209/0209001.pdf
19. Ehrentreich N (2006) Technical trading in the Santa Fe Institute Artificial Stock Market revisited. J Econ Behav Organ 61(4):599–616
20. Epstein JM (2006) Remarks on the foundations of agent-based generative social science. In: Judd KL, Tesfatsion L (eds) Handbook of computational economics, vol. 2: agent-based computational economics. North-Holland, Amsterdam, pp 1585–1604Google Scholar
21. Epstein JM, Axtell RL (1996) Growing artificial societies: social science from the bottom up. Brookings Institution Press/MIT Press, CambridgeGoogle Scholar
22. Evans A, Heppenstall A, Birkin M (2013) Understanding simulation results. Chapter 9 in this volumeGoogle Scholar
23. Flache A, Hegselmann R (1999) Rationality vs. learning in the evolution of solidarity networks: a theoretical comparison. Comput Math Organ Theory 5(2):97–127
24. Flache A, Hegselmann R (2001) Do irregular grids make a difference? Relaxing the spatial regularity assumption in cellular models of social dynamics. J Artif Soc Soc Simul 4(4), http://jasss.soc.surrey.ac.uk/4/4/6.html
25. Flache A, Macy MW (2002) Stochastic collusion and the power law of learning. J Confl Resolut 46(5):629–653
26. Galán JM, Izquierdo LR (2005) Appearances can be deceiving: lessons learned re-implementing Axelrod’s ‘Evolutionary approach to norms’. J Artif Soc Soc Simul 8(3), http://jasss.soc.surrey.ac.uk/8/3/2.html
27. Galán JM et al (2009) Errors and artefacts in agent-based modelling. J Artif Soc Soc Simul 12(1), http://jasss.soc.surrey.ac.uk/12/1/1.html
28. Genz A, Kwong KS (2000) Numerical evaluation of singular multivariate normal distributions. J Stat Comput Sim 68(1):1–21
29. Gilbert N (1999) Simulation: a new way of doing social science. Am Behav Sci 42(10):1485–1487Google Scholar
30. Gilbert N (2007) Agent-based models, vol 153, Quantitative applications in the social sciences. Sage, LondonGoogle Scholar
31. Gilbert N, Terna P (2000) How to build and use agent-based models in social science. Mind Soc 1(1):57–72
32. Gilbert N, Troitzsch KG (1999) Simulation for the social scientist. Open University Press, BuckinghamGoogle Scholar
33. Gotts NM, Polhill JG, Law ANR (2003a) Agent-based simulation in the study of social dilemmas. Artif Intell Rev 19(1):3–92
34. Gotts NM, Polhill JG, Adam WJ (2003b) Simulation and analysis in agent-based modelling of land use change. In: Online proceedings of the first conference of the European social simulation association, Groningen, The Netherlands, 18–21 Sept 2003, http://www.uni-koblenz.de/~essa/ESSA2003/proceedings.htm
35. Gotts NM, Polhill JG, Law ANR (2003c) Aspiration levels in a land-use simulation. Cybern Syst 34(8):663–683
36. Gotts NM, Polhill JG, Law ANR, Izquierdo LR (2003d) Dynamics of imitation in a land use simulation. In: Dautenhahn K, Nehaniv C (eds) Proceedings of the second international symposium on imitation in animals and artefacts, University of Wales, Aberystwyth, 7–11 April 2003, pp 39–46Google Scholar
37. Grinstead CM, Snell JL (1997) Chapter 11: Markov chains. In: Grinstead CM, Snell JL (eds) Introduction to probability (Second revised edition). American Mathematical Society, Providence, pp 405–470, http://www.dartmouth.edu/~chance/teaching_aids/books_articles/probability_book/book.html
38. Häggström O (2002) Finite Markov chains and algorithmic applications. Cambridge University Press, Cambridge
39. Harel D (1980) On folk theorems. Commun ACM 23(7):379–389
40. Hauert C, Doebeli M (2004) Spatial structure often inhibits the evolution of cooperation in the snowdrift game. Nature 428(6983):643–646
41. Hegselmann R, Flache A (2000) Rational and adaptive playing. Anal Krit 22(1):75–97Google Scholar
42. Holland JH, Miller JH (1991) Artificial adaptive agents in economic theory. Am Econ Rev 81(2): 365–370Google Scholar
43. Huet S, Edwards M, Deffuant G (2007) Taking into account the variations of neighbourhood sizes in the mean-field approximation of the threshold model on a random network. J Artif Soc Soc Simul 10(1), http://jasss.soc.surrey.ac.uk/10/1/10.html
44. Imhof LA, Fudenberg D, Nowak MA (2005) Evolutionary cycles of cooperation and defection. Proc Natl Acad Sci USA 102(31):10797–10800
45. Izquierdo SS, Izquierdo LR (2006) On the structural robustness of evolutionary models of cooperation. In: Corchado E, Yin H, Botti VJ, Fyfe C (eds) Intelligent data engineering and automated learning – IDEAL 2006 (Lecture notes in computer science, 4224). Springer, Berlin/Heidelberg, pp 172–182Google Scholar
46. Izquierdo SS, Izquierdo LR (2007) The impact on market efficiency of quality uncertainty without asymmetric information. J Bus Res 60(8):858–867
47. Izquierdo LR, Polhill JG (2006) Is your model susceptible to floating point errors? J Artif Soc Soc Simul 9(4), http://jasss.soc.surrey.ac.uk/9/4/4.html
48. Izquierdo LR, Izquierdo SS, Gotts NM, Polhill JG (2007) Transient and asymptotic dynamics of reinforcement learning in games. Game Econ Behav 61(2):259–276
49. Izquierdo LR, Galán JM, Santos JI, Olmo R (2008a) Modelado de sistemas complejos mediante simulación basada en agentes y mediante dinámica de sistemas. Empiria 16:85–112Google Scholar
50. Izquierdo SS, Izquierdo LR, Gotts NM (2008b) Reinforcement learning dynamics in social dilemmas. J Artif Soc Soc Simul 11(2), http://jasss.soc.surrey.ac.uk/11/2/1.html
51. Izquierdo LR, Izquierdo SS, Galán JM, Santos JI (2009) Techniques to understand computer simulations: Markov chain analysis. J Artif Soc Soc Simul 12(1), http://jasss.soc.surrey.ac.uk/12/1/6.html
52. Janssen J, Manca R (2006) Applied semi-Markov processes. Springer, New York
53. Karr AF (1990) Markov processes. In: Heyman DP, Sobel MJ (eds) Stochastic models, vol 2, Handbooks in operations research and management science. Elsevier, Amsterdam, pp 95–123
54. Klemm K, Eguíluz VM, Toral R, San Miguel M (2003a) Nonequilibrium transitions in complex networks: a model of social interaction. Phys Rev E 67(2):026120
55. Klemm K, Eguíluz VM, Toral R, San Miguel M (2003b) Role of dimensionality in Axelrod’s model for the dissemination of culture. Phys A 327(1–2):1–5
56. Klemm K, Eguíluz VM, Toral R, San Miguel M (2003c) Global culture: a noise-induced transition in finite systems. Phys Rev E 67(4):045101
57. Klemm K, Eguíluz VM, Toral R, San Miguel M (2005) Globalization, polarization and cultural drift. J Econ Dyn Control 29(1–2):321–334
58. Kulkarni VG (1995) Modeling and analysis of stochastic systems. Chapman & Hall/CRC, Boca Raton
59. Kulkarni VG (1999) Modeling, analysis, design, and control of stochastic systems. Springer, New York
60. Kushner HJ, Yin GG (1997) Stochastic approximation algorithms and applications. Springer, New York
61. Lebaron B, Arthur WB, Palmer R (1999) Time series properties of an artificial stock market. J Econ Dyn Control 23(9–10):1487–1516
62. Leombruni R, Richiardi M (2005) Why are economists sceptical about agent-based simulations? Phys A 355(1):103–109
63. Lieberman E, Havlin S, Nowak MA (2009) Evolutionary dynamics on graphs. Nature 433(7023): 312–316
64. Mabrouk N, Deffuant G, Lobry C (2007) Confronting macro, meso and micro scale modelling of bacteria dynamics. In: M2M 2007: Third international model-to-model workshop, Marseille, France, 15–16 Mar 2007, http://m2m2007.macaulay.ac.uk/M2M2007-Mabrouk.pdf
65. Macy MW, Flache A (2002) Learning dynamics in social dilemmas. Proc Natl Acad Sci USA 99(3):7229–7236
66. Miller JH, Page SE (2004) The standing ovation problem. Complexity 9(5):8–16
67. Nowak MA, May RM (1992) Evolutionary games and spatial chaos. Nature 359(6398):826–829
68. Nowak MA, Sigmund K (1992) Tit for tat in heterogeneous populations. Nature 355(6357): 250–253
69. Nowak MA, Sigmund K (1993) A strategy of win-stay, lose-shift that outperforms tit for tat in the Prisoner’s Dilemma game. Nature 364(6432):56–58
70. Ostrom T (1988) Computer simulation: the third symbol system. J Exp Soc Psychol 24(5):381–392
71. Polhill JG, Izquierdo LR, Gotts NM (2006) What every agent based modeller should know about floating point arithmetic. Environ Model Software 21(3):283–309
72. Richiardi M, Leombruni R, Saam NJ, Sonnessa M (2006) A common protocol for agent-based social simulation. J Artif Soc Soc Simul 9(1), http://jasss.soc.surrey.ac.uk/9/1/15.html
73. Santos FC, Pacheco JM, Lenaerts T (2006) Evolutionary dynamics of social dilemmas in structured heterogeneous populations. Proc Natl Acad Sci USA 103(9):3490–3494
74. Suber P (2002) Formal systems and machines: an isomorphism (Electronic hand-out for the course “Logical Systems”, Earlham College, Richmond, IN) http://www.earlham.edu/~peters/courses/logsys/machines.htm
75. Takadama K, Suematsu YL, Sugimoto N, Nawa NE, Shimohara K (2003) Cross-element validation in multiagent-based simulation: switching learning mechanisms in agents. J Artif Soc Soc Simul 6(4), http://jasss.soc.surrey.ac.uk/6/4/6.html
76. Takahashi N (2000) The emergence of generalized exchange. Am J Sociol 10(4):1105–1134
77. Traulsen A, Nowak MA, Pacheco JM (2006) Stochastic dynamics of invasion and fixation. Phys Rev E 74(1):011909
78. Vilà X (2008) A model-to-model analysis of Bertrand competition. J Artif Soc Soc Simul 11(2), http://jasss.soc.surrey.ac.uk/11/2/11.html
79. Wilensky U (1999) NetLogo, http://ccl.northwestern.edu/netlogo

## Authors and Affiliations

• Luis R. Izquierdo
• 1
• Segismundo S. Izquierdo
• 2
• José M. Galán
• 1
• José I. Santos
• 1
1. 1.Departamento de Ingeniería CivilUniversidad de BurgosBurgosSpain