Skip to main content

Indonesia Calibration for OG-Core

Project description

OG-IDN

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-IDN is an overlapping-generations (OG) model that allows for dynamic general equilibrium analysis of fiscal policy for Indonesia. OG-IDN 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 Indonesian calibration of the model is available at https://eapd-drb.github.io/OG-IDN.

Using and contributing to OG-IDN

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

Installing and Running OG-IDN from PyPI

  • On macOS, first install Xcode Command Line Tools (in Terminal: xcode-select --install).
  • Open your terminal and install the ogidn package from the Python Package Index by typing pip install ogidn.
  • Navigate to a folder ./YourFolderName/ where you want to save scripts to run OG-IDN and output from the simulations in those scripts.
  • Copy the python script run_og_idn.py from the OG-IDN GitHub repository into your folder as ./YourFolderName/run_og_idn.py.
  • Run the model with an example reform from terminal/command prompt by typing python run_og_idn.py.

Installing and Running OG-IDN from the GitHub repository

  • On macOS, first install Xcode Command Line Tools (in Terminal: xcode-select --install).
  • Install uv by following the installation instructions for your platform (or simply run pip 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 dev to create a local .venv and install OG-IDN with its development dependencies. uv will 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.

Run an example of the model

  • Navigate to ./examples.
  • Run the model with an example reform: uv run python run_og_idn.py (or activate the venv first with source .venv/bin/activate on macOS/Linux or .\.venv\Scripts\Activate.ps1 on Windows, then python run_og_idn.py).
  • You can adjust the ./examples/run_og_idn.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-IDN-Example/OG-IDN_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-IDN-Example/OG-IDN_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-IDN-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-IDN-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-IDN-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-IDN-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-IDN 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 ogidn.calibrate import Calibration
p = Specifications()
c = Calibration(p, update_from_api=True)
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-IDN/examples/run_og_idn.py script will be kept up to date to run with the master branch of this repo.

Core Maintainers

The core maintainers of the OG-IDN 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-IDN

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ogidn-0.1.0.tar.gz (298.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ogidn-0.1.0-py3-none-any.whl (310.6 kB view details)

Uploaded Python 3

File details

Details for the file ogidn-0.1.0.tar.gz.

File metadata

  • Download URL: ogidn-0.1.0.tar.gz
  • Upload date:
  • Size: 298.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ogidn-0.1.0.tar.gz
Algorithm Hash digest
SHA256 06e88d39cf620247bf78286ae62b43610405ddaca6dfd8de755b2f8d7d90d599
MD5 96aa22013520b1746ec525f812e36a9c
BLAKE2b-256 7442fb2a50177dc9d4e9770890001fa128182a7f57eef3a66e07ad57666b01d0

See more details on using hashes here.

File details

Details for the file ogidn-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ogidn-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 310.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ogidn-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 05dfe1b1ddf18b14f65def9a9dad081703e07126dd9ee65d22004a68e8fc7d92
MD5 c1a7ad9c61eb34034030064e9d067e9d
BLAKE2b-256 6e48ade0aa25150c8aa850dbb96d77e03599c22e47e9de8c7689284cc70350cb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page