| Org | |
| Package | |
| Testing |
OG-ETH is an overlapping-generations (OG) model that allows for dynamic general equilibrium analysis of fiscal policy for Ethiopia. OG-ETH is built on the OG-Core framework. The model output includes changes in macroeconomic aggregates (GDP, investment, consumption), wages, interest rates, and the stream of tax revenues over time. Regularly updated documentation of the model theory--its output, and solution method--and the Python API is available at https://pslmodels.github.io/OG-Core and documentation of the specific Ethiopian calibration of the model is available at https://eapd-drb.github.io/OG-ETH.
There are two primary methods for installing and running OG-ETH on your computer locally. The first and simplest method is to download the most recent ogeth Python package from the Python Package Index (PyPI.org). The second option is to fork and clone the most recent version of OG-ETH from its GitHub repository and install the ogeth package with its development dependencies using uv. Both methods are detailed below.
- On macOS, first install Xcode Command Line Tools (in Terminal:
xcode-select --install). - Open your terminal and install the
ogethpackage from the Python Package Index by typingpip install ogeth. - Navigate to a folder
./YourFolderName/where you want to save scripts to run OG-ETH and output from the simulations in those scripts. - Copy the python script
run_og_eth.pyfrom the OG-ETH GitHub repository into your folder as./YourFolderName/run_og_eth.py. - Run the model with an example reform from terminal/command prompt by typing
python run_og_eth.py.
- On macOS, first install Xcode Command Line Tools (in Terminal:
xcode-select --install). - Install
uvby following the installation instructions for your platform (or simply runpip install uv). - Fork this repository and clone your fork to a directory on your computer.
- From the terminal, navigate to the cloned directory and run
uv sync --extra devto create a local.venvand install OG-ETH with its development dependencies.uvwill also download a compatible Python interpreter if you don't already have one. - For docs/Jupyter Book work, also run
uv sync --extra dev --extra docs.
- Navigate to
./examples. - Run the model with an example reform:
uv run python run_og_eth.py(or activate the venv first withsource .venv/bin/activateon macOS/Linux or.\.venv\Scripts\Activate.ps1on Windows, thenpython run_og_eth.py). - You can adjust the
./examples/run_og_eth.pyby modifying model parameters specified in the dictionary passed to thep.update_specifications()calls. - Model outputs will be saved in the following files:
./examples/OG-ETH-Example/OG-ETH_example_plots- This folder will contain a number of plots generated from OG-Core to help you visualize the output from your run
./examples/OG-ETH-Example/OG-ETH_example_output.csv- This is a summary of the percentage changes in macro variables over the first ten years and in the steady-state.
./examples/OG-ETH-Example/OUTPUT_BASELINE/model_params.pkl- Model parameters used in the baseline run
- See
ogcore.execute.pyfor items in the dictionary object in this pickle file
./examples/OG-ETH-Example/OUTPUT_BASELINE/SS/SS_vars.pkl- Outputs from the model steady state solution under the baseline policy
- See
ogcore.SS.pyfor what is in the dictionary object in this pickle file
./examples/OG-ETH-Example/OUTPUT_BASELINE/TPI/TPI_vars.pkl- Outputs from the model timepath solution under the baseline policy
- See
ogcore.TPI.pyfor what is in the dictionary object in this pickle file
- An analogous set of files in the
./examples/OG-ETH-Example/OUTPUT_REFORMdirectory, which represent objects from the simulation of the reform policy
Note that, depending on your machine, a full model run (solving for the full time path equilibrium for the baseline and reform policies) can take from 35 minutes to more than two hours of compute time.
If you run into errors running the example script, please open a new issue in the OG-ETH repo with a description of the issue and any relevant tracebacks you receive.
Once the package is installed, one can adjust parameters in the OG-Core Specifications object using the Calibration class as follows:
from ogcore.parameters import Specifications
from ogeth.calibrate import Calibration
p = Specifications()
c = Calibration(p)
updated_params = c.get_dict()
p.update_specifications({'initial_debt_ratio': updated_params['initial_debt_ratio']})
The organization of this repository will be changing rapidly, but the OG-ETH/examples/run_og_eth.py script will be kept up to date to run with the main branch of this repo.
The core maintainers of the OG-ETH repository are:
- Marcelo LaFleur (GitHub handle: @SeaCelo), Senior Economist, Department of Economic and Social Affairs (DESA), United Nations
- Richard W. Evans (GitHub handle: @rickecon), Senior Economist, Abundance Institute; President, Open Research Group, Inc.
- Jason DeBacker (GitHub handle: @jdebacker), Associate Professor, University of South Carolina; Vice President of Research, Open Research Group, Inc.
OG-ETH (Version #.#.#)[Source code], https://github.com/EAPD-DRB/OG-ETH.