This repository stores all code related to the paper An agent-based model of wealth inequality in the US supported with an Ensemble Kalman Filter. (in preparation/review).
All relevant output figures for this paper are produced in Jupyter notebooks. These notebooks employ the classes that represent the actual model, which are Python files.
- model1_class.py - Defines model #1
- model2_class.py - Defines model #2
- agent1_class - Defines agent type 1 belonging to model #1
- agent2_class - Defines agent type 2 belonging to model #2
- enkf_yo - Defines the Ensemble Kalman Filter (ENKF) used in combination with both models
- inequality_metrics - Bundle of functions to compute the inequality measures e.g. the wealth groups aggregated from the agent-based model
- exponential_pareto_avg_distr - Functions to compute the distributional model to calibrate the agents
- calibration_weighted_avg.ipynb - Calibration of agent initial distribution to empirical wealth distribution
- run_both_models_n_times_and_compute_error_jupyter.ipynb - Ensemble model runs without filter necessary for Figure 2 in the paper
- experiment1_jupyter.ipynb
- experiment2_jupyter.ipynb
- experiment3_jupyter.ipynb
- experiment4_jupyter.ipynb
- experiment5_jupyter.ipynb
- wealth_data_for_import.csv - contains the wealth inequality data for four wealth groups as taken from https://realtimeinequality.org/
- average_wealth_for_every_year - contains the avg. wealth for every year so the correct scale factor can be chosen, applied to the exponential-pareto distribution, in order to initialise the agents with their wealth
To set up the environment for this project, you can use the environment.yml file. This file contains all the necessary dependencies and configurations to get you started quickly.
Prerequisites Ensure you have conda installed on your machine.
-
Clone the repository:
git clone https://github.com/yannickoswald/real_time_ineq_abm.git
-
Navigate to the repository:
cd global-convergence-incomes
-
Run the notebooks:
Open any of the Jupyter notebooks using Jupyter Lab or Jupyter Notebook interface.
jupyter lab
or
jupyter notebook
Reporting Issues
If you encounter any issues, please open an issue in the issue tracker. Provide a detailed description of the problem, including steps to reproduce the issue, and any relevant error messages or logs. This will help us address the problem more effectively.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contact