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 analysis 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.
Similar content being viewed by others
Notes
- 1.
Note that simulations of stochastic models are actually using pseudorandom number generators, which are deterministic algorithms that require a seed as an input.
- 2.
A formal model is a model expressed in a formal system (Cutland 1980). A formal system consists of a formal language and a deductive apparatus (a set of axioms and inference rules). Formal systems are used to derive new expressions by applying the inference rules to the axioms and/or previously derived expressions in the same system.
- 3.
The mere fact that the model has been implemented and can be run in a computer is a proof that the model is formal (Suber 2002).
- 4.
As a matter of fact, strictly speaking, inputs and outputs in a computer model are never numbers. We may interpret strings of bits as numbers, but we could equally well interpret the same strings of bits as, e.g. letters. More importantly, a bit itself is already an abstraction, an interpretation we make of an electrical pulse that can be above or below a critical voltage threshold.
- 5.
A sufficient condition for a programming language to be ‘sophisticated enough’ is to allow for the implementation of the following three control structures:
-
Sequence (i.e. executing one subprogram and then another subprogram),
-
Selection (i.e. executing one of two subprograms according to the value of a Boolean variable, e.g. IF[boolean == true]-THEN[subprogram1]-ELSE[subprogram2])
-
Iteration (i.e. executing a subprogram until a Boolean variable becomes false, e.g. WHILE[boolean == true]-DO[subprogram])
Any programming language that can combine subprograms in these three ways can implement any computable function; this statement is known as the ‘structured program theorem’ (Böhm and Jacopini 1966; Harel 1980; Wikipedia 2007).
-
- 6.
Note that statistics extracted from the model can be of any nature, as long as they are unambiguously defined. For example, they can refer to various time-steps and only to certain agents (e.g. ‘average wealth of female agents in odd time-steps from 1 to 99’).
- 7.
We use the term ‘mathematical analysis’ in its broadest sense, i.e. we do not refer to any particular branch of mathematics, but to the general use of (any type of) mathematical technique to analyse a system.
- 8.
Unless, of course, all possible particular instances are explored.
- 9.
The frequency of the event ‘there are i walkers in a patch with a house’ calculated over n simulation runs can be seen as the mean of a sample of n i.i.d. Bernoulli random variables where success denotes that the event occurred and failure denotes that it did not. Thus, the frequency f is the maximum likelihood (unbiased) estimator of the exact probability with which the event occurs. The standard error of the calculated frequency f is the standard deviation of the sample divided by the square root of the sample size. In this particular case, the formula reads:
Std . error(f, n) = (f(1 – f)/(n – 1))1/2
where f is the frequency of the event, n is the number of samples and the standard deviation of the sample has been calculated dividing by n − 1.
- 10.
The term ‘Markov chain’ allows for countably infinite state spaces too (Karr 1990).
- 11.
Formally, the occupancy of state i is defined as:
\( {\pi}_i^{\ast }=\underset{n\to \infty }{\lim}\frac{E\left({N}_i(n)\right)}{n+1} \)
where N i (n) denotes the number of times that the THMC visits state i over the time span {0, 1,…, n}.
- 12.
Given that the system has entered the absorbing class C v
- 13.
This finding does not refute some of the most important conclusions obtained by the authors of the original model.
- 14.
This is so because many assumptions we make in our models are, to some extent, for the sake of simplicity. As a matter of fact, in most cases the whole purpose of modelling is to build an abstraction of the world which is simpler than the world itself, so we can make inferences about the model that we cannot make directly from the real world (Edmonds 2001; Galán et al. 2009; Izquierdo et al. 2008a).
- 15.
This comment is added by the editors as the authors are too modest to so describe their own work.
References
Arthur, W. B. (1989). Competing technologies, increasing returns, and lock-in by historical events. Economic Journal, 99(394), 116–131.
Arthur, W. B., Holland, J. H., LeBaron, B., Palmer, R., & Tayler, P. (1997). Asset pricing under endogenous expectations in an artificial stock market. In W. B. Arthur, S. Durlauf, & D. Lane (Eds.), The economy as an evolving complex system II (pp. 15–44). Reading, MA: Addison-Wesley Longman.
Axelrod, R. M. (1986). An evolutionary approach to norms. American Political Science Review, 80(4), 1095–1111.
Axelrod, R. M. (1997a). Advancing the art of simulation in the social sciences. In R. Conte, R. Hegselmann, & P. Terna (Eds.), Simulating social phenomena, Lecture notes in economics and mathematical systems (Vol. 456, pp. 21–40). Berlin: Springer.
Axelrod, R. M. (1997b). The dissemination of culture: A model with local convergence and global polarization. Journal of Conflict Resolution, 41(2), 203–226.
Axelrod, R. M., & Bennett, D. S. (1993). A landscape theory of aggregation. British Journal of Political Science, 23(2), 211–233.
Axtell, R. L. (2000). Why agents? On the varied motivations for agent computing in the social sciences. In C. M. Macal & D. Sallach (Eds.), Proceedings of the workshop on agent simulation: applications, models, and tools (pp. 3–24). Argonne, IL: Argonne National Laboratory.
Axtell, R. L., & Epstein, J. M. (1994). Agent based modeling: Understanding our creations. The Bulletin of the Santa Fe Institute, Winter, 1994, 28–32.
Balzer, W., Brendel, K. R., & Hofmann, S. (2001). Bad arguments in the comparison of game theory and simulation in social studies. Journal of Artificial Societies and Social Simulation, 4(2). http://jasss.soc.surrey.ac.uk/4/2/1.html
Benveniste, A., Métivier, M., & Priouret, P. (1990). Adaptive algorithms and stochastic approximations. Berlin: Springer.
Böhm, C., & Jacopini, G. (1966). Flow diagrams, turing machines and languages with only two formation rules. Communications of the ACM, 9(5), 366–371.
Bush, R. R., & Mosteller, F. (1955). Stochastic models for learning. New York: Wiley.
Castellano, C., Marsili, M., & Vespignani, A. (2000). Nonequilibrium phase transition in a model for social influence. Physical Review Letters, 85(16), 3536–3539.
Cutland, N. (1980). Computability: An introduction to recursive function theory. Cambridge: Cambridge University Press.
Chung, K.L. (1960). Markov Chains with Stationary Transition Probabilities. Springer, Berlin. https://link.springer.com/book/10.1007%2F978-3-642-49686-8
Edmonds, B. (2001). The use of models: Making MABS actually work. In S. Moss & P. Davidsson (Eds.), Multi-agent-based simulation, Lecture notes in artificial intelligence (Vol. 1979, pp. 15–32). Berlin: Springer.
Edmonds, B. (2005). Simulation and complexity: How they can relate. In V. Feldmann & K. Mühlfeld (Eds.), Virtual worlds of precision: Computer-based simulations in the sciences and social sciences (pp. 5–32). Lit-Verlag: Münster, Germany.
Edwards, M., Huet, S., Goreaud, F., & Deffuant, G. (2003). Comparing an individual-based model of behaviour diffusion with its mean field aggregate approximation. Journal of Artificial Societies and Social Simulation, 6(4). http://jasss.soc.surrey.ac.uk/6/4/9.html
Ehrentreich, N. (2002) The Santa Fe artificial stock market re-examined: Suggested corrections (Betriebswirtschaftliche Diskussionsbeiträge Nr. 45/02). Halle/Saale, Germany: Wirtschaftswissenschaftliche Fakultät, Martin-Luther-Universität. http://econwpa.wustl.edu: 80/eps/comp/papers/0209/0209001.pdf
Ehrentreich, N. (2006). Technical trading in the Santa Fe institute artificial stock market revisited. Journal of Economic Behavior & Organization, 61(4), 599–616.
Epstein, J. M. (2006). Remarks on the foundations of agent-based generative social science. In K. L. Judd & L. Tesfatsion (Eds.), Handbook of computational economics, Agent-based computational economics (Vol. 2, pp. 1585–1604). Amsterdam, The Netherlands: North-Holland.
Epstein, J. M., & Axtell, R. L. (1996). Growing artificial societies: Social science from the bottom up. Cambridge, MA: Brookings Institution Press/MIT Press.
Evans, A., Heppenstall, A., & Birkin, M. (2017). Understanding simulation results. In B. Edmonds & R. Meyer (Eds.), Simulating social complexity: A handbook. Cham: Springer.
Flache, A., & Hegselmann, R. (1999). Rationality vs. learning in the evolution of solidarity networks: A theoretical comparison. Computational & Mathematical Organization Theory, 5(2), 97–127.
Flache, A., & Hegselmann, R. (2001). Do irregular grids make a difference? Relaxing the spatial regularity assumption in cellular models of social dynamics. Journal of Artificial Societies and Social Simulation, 4(4). http://jasss.soc.surrey.ac.uk/4/4/6.html
Flache, A., & Macy, M. W. (2002). Stochastic collusion and the power law of learning. Journal of Conflict Resolution, 46(5), 629–653.
Galán, J. M., & Izquierdo, L. R. (2005). Appearances can be deceiving: Lessons learned re-implementing axelrod’s ‘evolutionary approach to norms’. Journal of Artificial Societies and Social Simulation, 8(3). http://jasss.soc.surrey.ac.uk/8/3/2.html
Galán, J. M., Izquierdo, L. R., Izquierdo, S. S., Santos, J. I., Del Olmo, R., López-Paredes, A., et al. (2009). Errors and artefacts in agent-based modelling. Journal of Artificial Societies and Social Simulation, 12(1). http://jasss.soc.surrey.ac.uk/12/1/1.html
Genz, A., & Kwong, K. S. (2000). Numerical evaluation of singular multivariate normal distributions. Journal of Statistical Computation and Simulation, 68(1), 1–21.
Gilbert, N. (1999). Simulation: A new way of doing social science. The American Behavioral Scientist, 42(10), 1485–1487.
Gilbert, N. (2007). Agent-based models, Quantitative applications in the social sciences (Vol. 153). London: Sage Publications.
Gilbert, N., & Terna, P. (2000). How to build and use agent-based models in social science. Mind and Society, 1(1), 57–72.
Gilbert, N., & Troitzsch, K. G. (1999). Simulation for the social scientist. Buckingham, UK: Open University Press.
Gotts, N. M., Polhill, J. G., & Adam, W. J. (2003, September 18–21). 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. http://www.uni-koblenz.de/~essa/ESSA2003/proceedings.htm
Gotts, N. M., Polhill, J. G., & Law, A. N. R. (2003a). Agent-based simulation in the study of social dilemmas. Artificial Intelligence Review, 19(1), 3–92.
Gotts, N. M., Polhill, J. G., & Law, A. N. R. (2003b). Aspiration levels in a land-use simulation. Cybernetics and Systems, 34(8), 663–683.
Gotts, N. M., Polhill, J. G., Law, A. N. R, & Izquierdo, L. R. (2003, April 7–11). Dynamics of imitation in a land use simulation. In K. Dautenhahn & C. Nehaniv (Eds.), Proceedings of the second international symposium on imitation in animals and artefacts (pp. 39–46). Aberystwyth: University of Wales.
Grinstead, C. M., & Snell, J. L. (1997). Chapter 11: Markov chains. In C. M. Grinstead & J. L. Snell (Eds.), Introduction to probability (2nd Revised ed., pp. 405–470). Providence, RI: American Mathematical Society. http://www.dartmouth.edu/~chance/teaching_aids/books_articles/probability_book/book.html
Häggström, O. (2002). Finite markov chains and algorithmic applications. Cambridge: Cambridge University Press.
Harel, D. (1980). On folk theorems. Communications of the ACM, 23(7), 379–389.
Hauert, C., & Doebeli, M. (2004). Spatial structure often inhibits the evolution of cooperation in the snowdrift game. Nature, 428(6983), 643–646.
Hegselmann, R., & Flache, A. (2000). Rational and adaptive playing. Analyse & Kritik, 22(1), 75–97.
Holland, J. H., & Miller, J. H. (1991). Artificial adaptive agents in economic theory. American Economic Review, 81(2), 365–370.
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. Journal of Artificial Societies and Social Simulation, 10(1). http://jasss.soc.surrey.ac.uk/10/1/10.html
Imhof, L. A., Fudenberg, D., & Nowak, M. A. (2005). Evolutionary cycles of cooperation and defection. Proceedings of the National Academy of Sciences of the United States of America, 102(31), 10797–10800.
Izquierdo, L. R., Galán, J. M., Santos, J. I., & Olmo, R. (2008). Modelado de sistemas complejos mediante simulación basada en agentes y mediante dinámica de sistemas. Empiria, 16, 85–112.
Izquierdo, L. R., Izquierdo, S. S., Galán, J. M., & Santos, J. I. (2009). Techniques to understand computer simulations: Markov chain analysis. Journal of Artificial Societies and Social Simulation, 12(1). http://jasss.soc.surrey.ac.uk/12/1/6.html
Izquierdo, L. R., Izquierdo, S. S., Gotts, N. M., & Polhill, J. G. (2007). Transient and asymptotic dynamics of reinforcement learning in games. Games and Economic Behavior, 61(2), 259–276.
Izquierdo, L. R., & Polhill, J. G. (2006). Is your model susceptible to floating point errors? Journal of Artificial Societies and Social Simulation, 9(4). http://jasss.soc.surrey.ac.uk/9/4/4.html
Izquierdo, S. S., & Izquierdo, L. R. (2006). On the structural robustness of evolutionary models of cooperation. In E. Corchado, H. Yin, V. J. Botti, & C. Fyfe (Eds.), Intelligent data engineering and automated learning - IDEAL 2006, Lecture notes in computer science (Vol. 4224, pp. 172–182). Berlin: Springer.
Izquierdo, S. S., & Izquierdo, L. R. (2007). The impact on market efficiency of quality uncertainty without asymmetric information. Journal of Business Research, 60(8), 858–867.
Izquierdo, S. S., Izquierdo, L. R., & Gotts, N. M. (2008). Reinforcement learning dynamics in social dilemmas. Journal of Artificial Societies and Social Simulation, 11(2). http://jasss.soc.surrey.ac.uk/11/2/1.html
Janssen, J., & Manca, R. (2006). Applied semi-markov processes. New York, NY: Springer.
Karr, A. F. (1990). Markov processes. In D. P. Heyman & M. J. Sobel (Eds.), Stochastic models, Handbooks in operations research and management science (Vol. 2, pp. 95–123). Amsterdam: Elsevier.
Klemm, K., Eguíluz, V. M., Toral, R., & San Miguel, M. (2003a). Nonequilibrium transitions in complex networks: A model of social interaction. Physical Review E, 67(2), 026120.
Klemm, K., Eguíluz, V. M., Toral, R., & San Miguel, M. (2003b). Role of dimensionality in Axelrod’s model for the dissemination of culture. Physica A, 327(1–2), 1–5.
Klemm, K., Eguíluz, V. M., Toral, R., & San Miguel, M. (2003c). Global culture: A noise-induced transition in finite systems. Physical Review E, 67(4), 045101.
Klemm, K., Eguíluz, V. M., Toral, R., & San Miguel, M. (2005). Globalization, polarization and cultural drift. Journal of Economic Dynamics and Control, 29(1–2), 321–334.
Kulkarni, V. G. (1995). Modeling and analysis of stochastic systems. Boca Raton, FL: Chapman & Hall/CRC.
Kulkarni, V. G. (1999). Modeling, analysis, design, and control of stochastic systems. New York: Springer.
Kushner, H. J., & Yin, G. G. (1997). Stochastic approximation algorithms and applications. New York, NY: Springer.
Lebaron, B., Arthur, W. B., & Palmer, R. (1999). Time series properties of an artificial stock market. Journal of Economic Dynamics & Control, 23(9–10), 1487–1516.
Leombruni, R., & Richiardi, M. (2005). Why are economists sceptical about agent-based simulations? Physica A, 355(1), 103–109.
Lieberman, E., Havlin, S., & Nowak, M. A. (2009). Evolutionary dynamics on graphs. Nature, 433(7023), 312–316.
Mabrouk, N., Deffuant, G., & Lobry, C. (2007, March 15–16). Confronting macro, meso and micro scale modelling of bacteria dynamics. In M2M 2007: Third international model-to-model workshop, Marseille, France. http://m2m2007.macaulay.ac.uk/M2M2007-Mabrouk.pdf
Macy, M. W., & Flache, A. (2002). Learning dynamics in social dilemmas. Proceedings of the National Academy of Sciences of the United States of America, 99(3), 7229–7236.
Miller, J. H., & Page, S. E. (2004). The standing ovation problem. Complexity, 9(5), 8–16.
Nowak, M. A., & May, R. M. (1992). Evolutionary games and spatial chaos. Nature, 359(6398), 826–829.
Nowak, M. A., & Sigmund, K. (1992). Tit for tat in heterogeneous populations. Nature, 355(6357), 250–253.
Nowak, M. A., & 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.
Ostrom, T. (1988). Computer simulation: The third symbol system. Journal of Experimental Social Psychology, 24(5), 381–392.
Polhill, J. G., Izquierdo, L. R., & Gotts, N. M. (2006). What every agent based modeller should know about floating point arithmetic. Environmental Modelling & Software, 21(3), 283–309.
Richiardi, M., Leombruni, R., Saam, N. J., & Sonnessa, M. (2006). A common protocol for agent-based social simulation. Journal of Artificial Societies and Social Simulation, 9(1). http://jasss.soc.surrey.ac.uk/9/1/15.html
Santos, F. C., Pacheco, J. M., & Lenaerts, T. (2006). Evolutionary dynamics of social dilemmas in structured heterogeneous populations. Proceedings of the National Academy of Sciences of the United States of America, 103(9), 3490–3494.
Suber, P. (2002). Formal systems and machines: An isomorphism. Electronic hand-out for the course “Logical Systems”. Richmond, IN: Earlham College. http://www.earlham.edu/~peters/courses/logsys/machines.htm
Takadama, K., Suematsu, Y. L., Sugimoto, N., Nawa, N. E., & Shimohara, K. (2003). Cross-element validation in multiagent-based simulation: Switching learning mechanisms in agents. Journal of Artificial Societies and Social Simulation, 6(4). http://jasss.soc.surrey.ac.uk/6/4/6.html
Takahashi, N. (2000). The emergence of generalized exchange. American Journal of Sociology, 10(4), 1105–1134.
Traulsen, A., Nowak, M. A., & Pacheco, J. M. (2006). Stochastic dynamics of invasion and fixation. Physical Review E, 74(1), 011909.
Vilà, X. (2008). A model-to-model analysis of bertrand competition. Journal of Artificial Societies and Social Simulation, 11(2). http://jasss.soc.surrey.ac.uk/11/2/11.html
Wikipedia. (2007). Structured program theorem. http://en.wikipedia.org/w/index.php?title=Structured_program_theorem&oldid=112885072
Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo
Acknowledgements
The authors have benefited from the financial support of the Spanish Ministry of Education and Science (projects DPI2005-05676 and TIN2008-06464-C03-02) and of the JCyL (projects VA006B09 and BU034A08). We are also very grateful to Nick Gotts, Bruce Edmonds and Gary Polhill for many extremely useful discussions.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Further Reading
Further Reading
Firstly, we suggest three things to read to learn more about Markov chain models. Grinstead and Snell (1997) provide an excellent introduction to the theory of finite Markov chains, with many examples and exercises. Häggström (2002) gives a clear and concise introduction to probability theory and Markov chain theory and then illustrates the usefulness of these theories by studying a range of stochastic algorithms with important applications in optimisation and other problems in computing. One of the algorithms covered is the Markov chain Monte Carlo method. Finally, Kulkarni (1995) provides a rigorous analysis of many types of useful stochastic processes, e.g. discrete and continuous time Markov chains, renewal processes, regenerative processes and Markov regenerative processes.
The reader may find three other papers helpful. Izquierdo et al. (2009) analyse the dynamics of ten well-known models in the social simulation literature using the theory of Markov chains, which is thus a good illustration of the approach in practice within the context of social simulation.Footnote 15 Epstein (2006) is a more general discussion, treating a variety of foundational and epistemological issues surrounding generative explanation in the social sciences and discussing the role of agent-based computational models in generative social science. Finally, Leombruni and Richiardi (2005) usefully discuss several issues surrounding the interpretation of simulation dynamics and the generalisation of the simulation results. For a different approach to analysing the dynamics of a simulation model, we refer the interested reader to Chap. 10 in this volume (Evans et al. 2017).
Rights and permissions
Copyright information
© 2017 Springer International Publishing AG
About this chapter
Cite this chapter
Izquierdo, L.R., Izquierdo, S.S., Galán, J.M., Santos, J.I. (2017). Combining Mathematical and Simulation Approaches to Understand the Dynamics of Computer Models. In: Edmonds, B., Meyer, R. (eds) Simulating Social Complexity. Understanding Complex Systems. Springer, Cham. https://doi.org/10.1007/978-3-319-66948-9_13
Download citation
DOI: https://doi.org/10.1007/978-3-319-66948-9_13
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-66947-2
Online ISBN: 978-3-319-66948-9
eBook Packages: Computer ScienceComputer Science (R0)