This repository contains a Python-based implementation and extension of the international agent-based model (ABM) originally proposed by Llerena & Lorentz (2004). The model simulates endogenous growth and trade across multiple economies, focusing on innovation, firm-level competition, exchange rate dynamics, and now — trade tariffs and policy regimes.
- Replicate the baseline evolutionary ABM.
- Introduce FX dynamics and tariff regimes to explore trade competitiveness.
- Quantitatively assess the persistence of economic leadership, path-dependence, and regime-lock in.
- Evaluate empirical outcomes across 1,000 simulations with and without tariff intervention.
sim_models.py: All simulation model logic and analysis functions.notebook.ipynb: Full simulation setup, results, visualizations, and interpretations.README.md: This file.requirements.txt: List of Python dependencies.
- Clone the repository
git clone https://github.com/Stef-creator/agent-based-trade-model.git cd agent-based-trade-model - Create and activate virtual environment
python3 -m venv .venv source .venv/bin/activate - Install dependencies
pip install -r requirements.txt
- Launch Jupyter Notebook jupyter notebook notebook.ipynb
-
Dynamic Exchange Rates
Modeled based on export growth differential and random shocks. -
Tariff Module
Tariff-imposing economy penalizes import competitiveness via a user-defined tariff rate. -
Leadership Tracking & Statistics
Tracks:- Who leads initially
- Whether they remain leader
- Number of leadership transitions
- Final GDP and export gaps
-
Visualization Dashboard
Distribution plots for:- Final leader identity
- Regime persistence
- GDP & export divergence
- Leadership churn
Plots include:
- Final leader frequency (by economy)
- Persistent leadership share
- GDP and export dominance (boxplots)
- Number of leadership transitions (histogram)
- Add entry and exit dynamics for firms.
- Implement endogenous tariff retaliation strategies.
- Introduce heterogeneous firm sizes, credit constraints, or sectoral shocks.
- Calibrate model to real-world trade data (e.g., WTO, IMF).
- Visualize agent-level heterogeneity (e.g., productivity dispersion).
If you use or adapt this work, please cite the original paper:
Llerena, P. & Lorentz, A. (2004). Cumulative Causation and Evolutionary Micro-Founded Technical Change.
Created by Stefan Pilegaard Pedersen
MIT License. See LICENSE file for details.