| 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.
Install and run OG-ETH by cloning this GitHub repository and installing the ogeth package with its dependencies using uv, as detailed below. (Installing the ogeth package from PyPI with pip is no longer the recommended path: on the Python versions many machines ship, pip either refuses the current release outright — as on the Python 3.9 built into macOS — or silently pairs it with an older ogcore than the model is tested against, and even on a supported Python the PyPI route does not pin the ogcore version the repository is tested against. The uv workflow installs the exact tested versions of every dependency, including a compatible Python interpreter.)
There are two ways to install OG-ETH: the easy way, using the OG model family's universal installer, and a manual install that runs the same steps one command at a time. Both start from a terminal, put the model in a new OG-ETH folder inside your current directory (a freshly opened terminal starts in your home folder), and need git.
On a Mac where you have never used git before, run this line first and accept the dialog that appears:
xcode-select --install
On Windows, install Git first (skip this if you already have it):
winget install --id Git.Git -e --source winget
The OG model family has a universal installer that installs the uv tool, downloads the model, builds its environment, and verifies it — for OG-ETH or any of its sibling country models.
On macOS and Linux, paste:
curl -fsSL https://raw.githubusercontent.com/PSLmodels/OG-Core/master/scripts/install.sh -o og-install.sh
bash og-install.sh --repo og-eth --yes
On Windows (PowerShell), paste:
$f = "$env:TEMP\og-install.ps1"; irm https://raw.githubusercontent.com/PSLmodels/OG-Core/master/scripts/install.ps1 -OutFile $f; powershell -ExecutionPolicy Bypass -File $f -Repo og-eth -Yes
When the installer finishes, run the example. On macOS and Linux, paste:
source $HOME/.local/bin/env
cd OG-ETH
uv run python examples/run_og_eth.py
On Windows, open a new PowerShell window (so the just-installed tools are found) and paste:
cd OG-ETH
uv run python examples/run_og_eth.py
The same setup as individual commands. On macOS and Linux, paste:
curl -LsSf https://astral.sh/uv/install.sh | sh
source $HOME/.local/bin/env
git clone https://github.com/EAPD-DRB/OG-ETH.git
cd OG-ETH
uv run python examples/run_og_eth.py
The second line makes the just-installed uv available in the current terminal; from your next terminal session it is available automatically.
On Windows (PowerShell), install uv:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Then open a new PowerShell window (so the just-installed tools are found) and paste:
git clone https://github.com/EAPD-DRB/OG-ETH.git
cd OG-ETH
uv run python examples/run_og_eth.py
The first uv run creates the project environment if it does not exist yet — downloading a compatible Python interpreter if needed and installing the exact locked dependencies — and then runs the example. Early in the run you may be asked for a UN API token; just press return, and the model reads the same population data from a public mirror and continues. A full baseline-plus-reform run takes from 35 minutes to more than two hours; when it finishes, its plots and tables are saved under ./examples/OG-ETH-Example/ (see the list of outputs below).
- 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 (uvdownloads a compatible Python if you don't already have one). - For docs/Jupyter Book work, also run
uv sync --extra dev --extra docs. - Run commands in the environment with
uv run <command>, or activate it first withsource .venv/bin/activate(macOS/Linux) or.\.venv\Scripts\Activate.ps1(Windows).
- From the repository root, run the model with an example reform:
uv run python examples/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.