Skip to main content

OG-ETH

Org United Nations DESA PSL cataloged OS License: CC0-1.0 Jupyter Book Badge
Package Python 3.12 Python 3.13 PyPI Latest Release PyPI Downloads Ruff
Testing example event parameter example event parameter example event parameter Codecov

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.

Using and contributing to 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.)

Installation

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.

Before you start: 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 easy way: the universal installer

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

Manual install

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

What happens

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).

Installing for development or contributing

  • 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 dev to create a local .venv and install OG-ETH with its development dependencies (uv downloads 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 with source .venv/bin/activate (macOS/Linux) or .\.venv\Scripts\Activate.ps1 (Windows).

Run an example of the model

  • 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.py by modifying model parameters specified in the dictionary passed to the p.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.py for 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.py for 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.py for what is in the dictionary object in this pickle file
    • An analogous set of files in the ./examples/OG-ETH-Example/OUTPUT_REFORM directory, 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']})

Disclaimer

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.

Core Maintainers

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.

Citing OG-ETH

OG-ETH (Version #.#.#)[Source code], https://github.com/EAPD-DRB/OG-ETH.

Metadata

Release files for ogeth 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ogeth 0.3.0
File Size Uploaded
ogeth-0.3.0.tar.gz 2.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for ogeth 0.3.0
File Interpreter ABI Platform
ogeth-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.1 MB

Release files / ogeth-0.3.0.tar.gz

Download URL ogeth-0.3.0.tar.gz
Size 2.9 MB
Tags Source
SHA-256 checksum
How to use checksums
f9013881dffe919ea4df2f7df906684bc2abf0bd70e000029b234c74671389de
BLAKE2b-256 checksum
How to use checksums
97b3f489f3bb4aaea378eec9de6df71945cf5ac7b2711e5342619f9564055e8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / ogeth-0.3.0-py3-none-any.whl

Download URL ogeth-0.3.0-py3-none-any.whl
Size 3.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
c1a3bb5a0f1cbd777f841cfb08f108851ccd39a9bebe87d27c9b9068b8e8d13a
BLAKE2b-256 checksum
How to use checksums
6e146db20e22b7c8297a1279903e73868eb1f0c981cafec9feed2c408ed871f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page