Skip to main content

Agent-Based Computational Demography and Microsimulation Using JAS-mine

  • Chapter
  • First Online:
Agent-Based Modelling in Population Studies

Abstract

In this chapter we provide a hands-on guide on how to build a microsimulation using JAS-mine, a Java-based platform that provides unique simulation tools for discrete-event simulations, including both agent-based and microsimulation models. After presenting the rationale for the recent developments of the JAS-mine project and the main architectural choices made, we illustrate a step-by-step implementation of a rich dynamic microsimulation, which includes demographic processes (birth, death, household formation and dissolution) and other life course events (educational choices, labour market participation and employment outcomes).

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 139.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 179.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 179.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    The model and the supporting documentation can be downloaded from the demo section of the JAS-mine website (www.jas-mine.net/demo/demo07).

  2. 2.

    Structural models often include unobservable parameters that help describe individual behaviour at a deep level (say, in terms of utility maximisation); reduced-form models aim more simply at identifying statistical relationships between observable characteristics.

  3. 3.

    The performances of JAS-mine with respect to speed of execution, though, are noteworthy. An exercise aimed at testing the performance of the simulation platform with respect to scaling involved the implementation in JAS-mine of a complex mixed AB-microsimulation model of the two-way relationship between health and economic inequality, calibrated on both US and Canadian cities. The JAS-mine implementation can run five million agents with a time-step equivalent to 1 day for 500 years (182,500 time-steps) in 50 min on a standard laptop (using less than 4GB of RAM).

  4. 4.

    ORM is a programming technique for converting data between incompatible type systems in object-oriented programming languages. This creates, in effect, a “virtual object database” that can be used from within the programming language.

  5. 5.

    Discrete-event simulations can be organized into two categories, depending on how time is treated. Discrete-time simulations break up time into regular time slices (∆t), while the simulator calculates the variation of state variables for all the elements of the simulated model between one point in time and the next. Nothing is known about the order of the events that happen within each time period: discrete events (marriage, job loss, etc.) could have happened at any moment in ∆t while inherently continuous events (aging, wealth accumulation, etc.) are often thought to progress smoothly between one point in time and the next. By contrast, continuous-time simulations are characterized by irregular timeframes that are punctuated by the occurrence of the events. What is modelled is not whether an event occurs or not in the reference period, but rather the time elapsed before its occurrence (duration models). Between consecutive events, no change in the system is assumed to occur; thus the simulation can directly jump in time from one event to the next. Inherently continuous events must therefore be discretised (Keller etal. 1993).

  6. 6.

    Eclipse Integrated Development Environment is a software application that provides support to aid software development. A description of how to start using Eclipse and the JAS-mine plugin can be found at http://www.jas-mine.net/how-to-create-and-run-a-new-jas-project-using-eclipse.

  7. 7.

    Technically, the scheduler is a “singleton”. In software engineering, the singleton pattern is a design pattern that restricts the instantiation of a class to one object.

  8. 8.

    Enumerations specify a set of predefined values that a property can assume. These values might be categorical (strings, e.g. gender), quantitative (discrete numbers, e.g. age) or even objects with their set of characteristics and properties (e.g. a predefined set of banks to which a firm can be linked). The ORM detects that a value is an enumeration when the property is declared with the annotation @Enumerated (see Sect. 4.6.3.1). Through enumerations the ORM automatically manages reading/writing operations in both text and numerical format.

  9. 9.

    The folder name can be modified dynamically through labels set by the user.

  10. 10.

    A JDBC driver is a software component enabling a Java application to interact with a database.

  11. 11.

    The model differs from the LIAM2 version in that it collapses the work states of unemployment and inactivity into a single non-employment state. This is done by removing the unemployment module from the corresponding LIAM2 simulation, with everything else staying the same. The change is motivated by the fact that the distinction between unemployment and inactivity was implemented in a very unnatural way in LIAM2, and did not affect any subsequent choice on the part of the agents.

  12. 12.

    The interested reader will find a JAS-mine implementation of the Schelling Segregation Model, with added microsimulation features for illustrative purposes (a dynamic population, with birth, ageing and death processes) in the demo section of the JAS-mine website (www.jas-mine.net/demo/extended-schelling).

  13. 13.

    This implies that each JAS-mine project has its own copy of all the libraries used, ensuring that the project is self-contained and that it keeps working exactly as intended even when new versions of the libraries are released (and even if backward compatibility is not respected).

  14. 14.

    It is also possible to load the parameters from a table in the input database. See the online documentation for further details.

  15. 15.

    The @Override annotation is used by the Java interpreter to ensure that the programmer is aware that the method declared is overriding the same method declared in the superclass.

  16. 16.

    This method is absent in the LIAM2 implementation, which does not get rid of all the errors in the initial database.

  17. 17.

    This requires the method – ageing() in this case – to be declared public.

  18. 18.

    See Sect. 4.6.3.3.

  19. 19.

    Technically, a closure is a function that refers to free variables in their lexical context. A free variable is an identifier (the identity of the person which is included in the evaluation set, in our example) that has a definition outside the closure: it is not defined by the closure, but it is used by the closure. In other words, these free variables inside the closure have the same meaning they would have had outside the closure.

  20. 20.

    The ranking involves a stochastic component (the random number that is subtracted from the divorce probability score) in order to give individuals with a low predicted probability some chance to experience the event. As we have already noted, the SBD algorithm is quite distortive and its use is deprecated in JAS-mine; it is employed here only for consistency with the LIAM2 implementation.

  21. 21.

    As such, it is also used by JAS-mine distribution plots, see Sect. 4.6.6.

  22. 22.

    Regression classes also have a method to read directly the values of the variables from the agent class, without the need of implementing the IDoubleSource interface. However, this requires that all the variables used by a regression model are defined as (possibly transient) properties in the class. This is particularly tedious when the covariates refer to another agent (such as a potential partner, or the spouse), as is common in our case.

  23. 23.

    The change in specification is instead achieved by updating the regression coefficient input files (e.g. reg_inwork.xls).

  24. 24.

    Because updating is a common activity, it is also defined as a CommonEventType Enum in the JAS-mine event library (together with saving). Passing the scheduler this Enum does not require implementing the EventListener interface. An example of this approach is implemented in the Observer.

References

  • Baekgaard, H. (2002). Micro-macro linkage and the alignment of transition processes: Some issues, techniques and examples. National Centre for Social and Economic Modelling (NATSEM) Technical paper No. 25.

    Google Scholar 

  • Billari, F., & Prskawetz, A. (2003). Agent-based computational demography. Berlin: Springer.

    Book  Google Scholar 

  • De Menten, G., Dekkers, G., Bryon, G., Liègeois, P., & O’Donoghue, C. (2014). LIAM2: A new open source development tool for discrete-time dynamic microsimulation models. Journal of Artificial Societies and Social Simulation, 17(3), art. 9.

    Article  Google Scholar 

  • Gilbert, N., & Terna, P. (2000). How to build and use agent-based models in social science. Mind & Society, 1(1), 57–72.

    Article  Google Scholar 

  • Gilbert, N., & Troitszsch, K. (2005). Simulation for the social scientist (2nd ed.). Maidenhead: Open University Press.

    Google Scholar 

  • Keller, A.M., Agarwal, S., & Jensen, R. (1993). Enabling the integration of object applications with relational databases. ACM SIGMOD Proceedings.

    Google Scholar 

  • Klevmarken, A. (2002). Statistical inference in micro-simulation models: Incorporating external information. Mathematics and Computers in Simulation, 59(1–3), 255–265.

    Article  Google Scholar 

  • Li, J., & O’Donoghue, C. (2012). Simulating histories within dynamic microsimulation model. International Journal of Microsimulation, 5(1), 52–76.

    Google Scholar 

  • Li, J., & O’Donoghue, C. (2014). Evaluating binary alignment methods in microsimulation models. Journal of Artificial Societies and Social Simulation, 17(1), art. 15.

    Google Scholar 

  • Luke, S., Cioffi-Revilla, C., Panait, L., Sullivan, K., & Balan, G. (2005). MASON: A multiagent simulation environment. Simulation, 81(7), 517–527.

    Article  Google Scholar 

  • Luna, F., & Stefansson, B. (2000). Economic simulations in Swarm: Agent-based modelling and object oriented programming. Dordrecht: Kluwer.

    Book  Google Scholar 

  • Mannion, O., Lay-Yee, R., Wrapson, W., Davis, P., & Pearson, J. (2012). JAMSIM: A microsimulation modelling policy tool. Journal of Artificial Societies and Social Simulation, 15(1), art. 8.

    Article  Google Scholar 

  • Minar, N., Burkhart, R., Langton, C., & Askenazi, M. (1996). The Swarm simulation system: A toolkit for building multi-agent simulations. Santa Fe Institute Working Paper, 96-06-042, Santa Fe.

    Google Scholar 

  • North, M. J., Collier, N. T., Ozik, J., Tatara, E., Altaweel, M., Macal, C. M., Bragen, M., & Sydelko, P. (2013). Complex adaptive systems modeling with repast simphony. Complex Adaptive Systems Modeling, 1, 1–26.

    Article  Google Scholar 

  • Richiardi, M. (2012). Agent-based computational economics. A short introduction. The Knowledge Engineering Review, 27(2), 137–149.

    Article  Google Scholar 

  • Richiardi, M. (2013). The missing link: AB models and dynamic microsimulation. In S. Leitner & F. Wall (Eds.), Artificial economics and self organization (Lecture notes in economics and mathematical systems, Vol. 669). Berlin: Springer.

    Google Scholar 

  • Statistics Canada (2009). Modgen version 10.1.0 developer’s guide. http://www.statcan.gc.ca/eng/microsimulation/modgen/doc/devguide/dev. Accessed 17 Dec 2014.

  • Stephensen, P. (2014). An information-loss-minimizing approach to multinominal alignment in microsimulation models. DREAM Working Paper, 2014:4.

    Google Scholar 

  • Wilensky, U. (1999). NetLogo user manual. https://ccl.northwestern.edu/netlogo/docs. Accessed 10 Apr 2015.

Download references

Acknowledgments

Matteo Richiardi has benefited from support by Piedmont Region (research project: “From work to health and back: The right to a healthy working life in a changing society”) and Collegio Carlo Alberto (research project: “Causes, Processes and Consequences of Flexsecurity Reform in the EU: Lessons from Bismarkian Countries”), as well as from support by a Marie Curie Intra European Fellowship within the 7th European Community Framework Programme.

We are grateful to Michele Sonnessa, who developed an earlier version of the platform and has contributed to the coding of the microsimulation model.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Matteo Richiardi .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2017 Springer International Publishing Switzerland

About this chapter

Cite this chapter

Richiardi, M., Richardson, R.E. (2017). Agent-Based Computational Demography and Microsimulation Using JAS-mine. In: Grow, A., Van Bavel, J. (eds) Agent-Based Modelling in Population Studies. The Springer Series on Demographic Methods and Population Analysis, vol 41. Springer, Cham. https://doi.org/10.1007/978-3-319-32283-4_4

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-32283-4_4

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-32281-0

  • Online ISBN: 978-3-319-32283-4

  • eBook Packages: Social SciencesSocial Sciences (R0)

Publish with us

Policies and ethics