Skip to main content

OG-Core

Org PSL cataloged OS License: CCO-1.0 Jupyter Book Badge
Package Python 3.12 Python 3.13 Python 3.14 Python 3.15 PyPI Latest Release PyPI Downloads Ruff
Testing example event parameter example event parameter example event parameter Codecov

OG-Core is an overlapping-generations (OG) model core theory, logic, and solution method algorithms that allow for dynamic general equilibrium analysis of fiscal policy. OG-Core provides a general framework and is a dependency of several country-specific OG model caliibrations, as listed in the table belowsuch as OG-USA and OG-UK. 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 here.

Country calibrations of OG-Core

United States, OG-USA United Kingdom, OG-UK Phillipines, OG-PHL
South Africa, OG-ZAF Indonesia, OG-IDN Ethiopia, OG-ETH
India, OG-IND Malaysia, OG-MYS

Disclaimer

The model is constantly under development, and model components could change significantly. The package will have released versions, which will be checked against existing code prior to release. Stay tuned for an upcoming release!

Using/contributing to OG-Core

There are two primary methods for installing and running OG-Core on your computer locally. The first and simplest method is to download the most recent ogcore Python package from the Python Package Index (PyPI.org). A second option is to fork and clone the most recent version of OG-Core from its GitHub repository and install the ogcore package with its development dependencies using uv. We detail both of these methods below.

Optional pyGAM tax-function fitting

The base installation does not require pyGAM. To estimate mono2D tax functions or use monotone_spline(method="pygam"), install the optional dependency with pip install "ogcore[pygam]" or, from a source checkout, uv sync --extra pygam. This extra is available on Python 3.12--3.14; the current pyGAM release does not support Python 3.15. Existing saved tax estimates containing pyGAM models also require this extra when loaded.

Installing and Running OG-Core from Python Package Index (PyPI.org)

  • Open your terminal and install the ogcore package from the Python Package Index by typing pip install ogcore.
  • Navigate to a folder ./YourFolderName/ where you want to save scripts to run OG-Core and output from the simulations in those scripts.
  • Save the python script run_ogcore_example.py from the OG-Core GitHub repository in the folder where you are working on your local machine ./YourFolderName/run_ogcore_example.py.
  • Run the model with an example reform from terminal/command prompt by typing python run_ogcore_example.py
  • You can adjust the run_ogcore_example.py script by modifying model parameters specified in the og_spec dictionary.
  • Model outputs will be saved in the following files:
    • ./run_example_plots
      • This folder will contain a number of plots generated from OG-Core to help you visualize the output from your run
    • ./ogcore_example_output.csv
      • This is a summary of the percentage changes in macro variables over the first ten years and in the steady-state.
    • ./OUTPUT_BASELINE/model_params.pkl
      • Model parameters used in the baseline run
      • See execute.py in the OG-Core repository for items in the dictionary object in this pickle file
    • ./OUTPUT_BASELINE/SS/SS_vars.pkl
      • Outputs from the model steady state solution under the baseline policy
      • See SS.py in the OG-Core repository for what is in the dictionary object in this pickle file
    • ./OUTPUT_BASELINE/TPI/TPI_vars.pkl
      • Outputs from the model timepath solution under the baseline policy
      • See TPI.py in the OG-Core repository for what is in the dictionary object in this pickle file
    • An analogous set of files in the ./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 more than two hours of compute time.

If you run into errors running the example script, please open a new issue in the OG-Core repo with a description of the issue and any relevant tracebacks you receive.

The CSV output file ./ogcore_example_output.csv can be compared to the ./run_examples/expected_ogcore_example_output.csv file in the OG-Core repository to confirm that you are generating the expected output. The easiest way to do this is to copy the example-diffs and example-diffs.bat files from the OG-Core repository and use the sh example-diffs command (or example-diffs on Windows) from the run_examples directory. If you run into errors running the example script, please open a new issue in the OG-Core repo with a description of the issue and any relevant tracebacks you receive.

Installing and Running OG-Core from GitHub repository

  • Install uv by following the installation instructions for your platform (or simply run pip install uv)
  • Clone this repository to a directory on your computer
  • From the terminal, navigate to the directory to which you cloned this repository and run uv pip install -e ".[dev]" to install the package and all development dependencies
  • Navigate to ./run_examples
  • Run the model with an example reform from terminal/command prompt by typing uv run python run_ogcore_example.py
  • You can adjust the ./run_examples/run_ogcore_example.py script by modifying model parameters specified in the og_spec dictionary.
  • Model outputs will be saved in the following files:
    • ./run_examples/run_example_plots
      • This folder will contain a number of plots generated from OG-Core to help you visualize the output from your run
    • ./run_examples/ogcore_example_output.csv
      • This is a summary of the percentage changes in macro variables over the first ten years and in the steady-state.
    • ./run_examples/OUTPUT_BASELINE/model_params.pkl
      • Model parameters used in the baseline run
      • See execute.py for items in the dictionary object in this pickle file
    • ./run_examples/OUTPUT_BASELINE/SS/SS_vars.pkl
      • Outputs from the model steady state solution under the baseline policy
      • See SS.py for what is in the dictionary object in this pickle file
    • ./run_examples/OUTPUT_BASELINE/TPI/TPI_vars.pkl
      • Outputs from the model timepath solution under the baseline policy
      • See TPI.py for what is in the dictionary object in this pickle file
    • An analogous set of files in the ./run_examples/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 more than two hours of compute time.

If you run into errors running the example script, please open a new issue in the OG-Core repo with a description of the issue and any relevant tracebacks you receive.

The CSV output file ./run_examples/ogcore_example_output.csv can be compared to the ./run_examples/expected_ogcore_example_output.csv file that is checked into the repository to confirm that you are generating the expected output. The easiest way to do this is to use the sh example-diffs command (or example-diffs on Windows) from the run_examples directory. If you run into errors running the example script, please open a new issue in the OG-Core repo with a description of the issue and any relevant tracebacks you receive.

Core Maintainers

The core maintainers of the OG-Core repository are:

  • Jason DeBacker (GitHub handle: jdebacker), Associate Professor, Department of Economics, Darla Moore School of Business, University of South Carolina; President, PSL Foundation; Vice President of Research and Co-founder, Open Research Group, Inc.
  • Richard W. Evans (GitHub handle: rickecon), Advisory Board Visiting Fellow, Center for Public Finance, Baker Institute for Public Policy at Rice University; President, Open Research Group, Inc.; Director, Open Source Economics Laboratory

Citing OG-Core

OG-Core (Version #.#.#)[Source code], https://github.com/PSLmodels/OG-Core

Metadata

Release files for ogcore 0.24.3

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

Source distribution (sdist)

Source distribution for ogcore 0.24.3
File Size Uploaded Provenance Actions
ogcore-0.24.3.tar.gz 1.3 MB Without provenance Details for ogcore-0.24.3.tar.gz

Built distribution (wheel)

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

Total release size: 2.4 MB

Release files / ogcore-0.24.3.tar.gz

Download URL ogcore-0.24.3.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
3990889d0dd8382859bf5c0403ff4e0076f5deae7f05072d3f3c8fc6b6a11c54
BLAKE2b-256 checksum
How to use checksums
323098b3ee18cdc927871b67c789f8653db15f2fe697122ef2c782128522debc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / ogcore-0.24.3-py3-none-any.whl

Download URL ogcore-0.24.3-py3-none-any.whl
Size 1.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
6c63120799995fe47c123081f0820844b69becd90d93f83db1da0fddf50b585a
BLAKE2b-256 checksum
How to use checksums
f23fcbd2b9089b5ddf95be9fc5d0fd54d2fc28b8c49195d96e09ea8ab33fb30b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for ogcore 0.24.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.24.3 This release

2 release files No provenance

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