This small project presents a python interface for the simple Mark-0 Agent-based Model. The model is based on the work of Stanislao Gualdi, Jean-Philippe Bouchaud, Marco Tarzia, Francesco Zamponi, and Dhruv Sharma. The relevant references are given below.
The model is written using C++, and the code was initially developed by Stanislao Gualdi, and extended by Dhruv Sharma. This version of the code has made some additional modifications relating to the reading of parameters (from Python) as well as the exporting of the resulting outputs. Furthermore, the Python interface allows for easy parallelization using the multiprocessing module. Further expansions in this direction are planned for a future project.
References
- Gualdi et al. (2015) _Tipping Points in Macroeconomic Agent-based Models
- Gualdi et al. (2017) Monetary policy and dark corners in a stylized agent-based model
- Bouchaud et al. (2018) Optimal inflation target: insights from an agent-based model
- Sharma et al. (2020) V-, U-, L-, or W-shaped recovery after COVID? Insights from an Agent Based Model
- Compilation: To be able to use the C++ code underlying Mark-0, it will need to be compiled. The C++ code does make use of the
libgsllibrary. A sample compile statement on the linux machine would involve entering the directory with the mark0 cpp file and executing:g++ mark0_covid.cpp -l:libgsl.so.23.1.0 -o mark0_covid. - Using the model: The model, once compiled, can be accessed using
from mark0_covid import Mark0_COVID, where the Mark0_COVID object has functions to simulate and classify phases. An example of this is provided in the jupyter noteboo, where the Mark0_COVID object has functions to simulate and classify phases. An example of this is provided in the jupyter notebook. - Requirements: the python environment requires
pandas, andyaml
Distributed under the MIT License. See LICENSE.txt for more information.
Karl Naumann-Woleske - @KNaumannWoleske - karl [at] karlnaumann.com
Project Link: https://github.com/KarlNaumann/Mark0