Code Monkey home page Code Monkey logo

og-phl's Introduction

OG-PHL

Org United Nations DESA PSL cataloged OS License: CC0-1.0
Package Python 3.10 Python 3.11 PyPI Latest Release PyPI Downloads
Testing example event parameter example event parameter example event parameter Codecov

OG-PHL is an overlapping-generations (OG) model that allows for dynamic general equilibrium analysis of fiscal policy for the Philippines. OG-PHL 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 Philippines calibration of the model will be available soon.

Using and contributing to OG-PHL

  • If you are installing on a Mac computer, install XCode Tools. In Terminal: xcode-select —install
  • Download and install the appropriate Anaconda distribution of Python. Select the correct version for you platform (Windows, Intel Mac, or M1 Mac).
  • In Terminal:
    • Make sure the conda package manager is up-to-date: conda update conda.
    • Make sure the Anaconda distribution of Python is up-to-date: conda update anaconda.
  • Fork this repository and clone your fork of this repository to a directory on your computer.
  • From the terminal (or Anaconda command prompt), navigate to the directory to which you cloned this repository and run conda env create -f environment.yml. The process of creating the ogphl-dev conda environment should not take more than five minutes.
  • Then, conda activate ogphl-dev
  • Then install by pip install -e .

Run an example of the model

  • Navigate to ./examples
  • Run the model with an example reform from terminal/command prompt by typing python run_og_zaf.py
  • You can adjust the ./examples/run_og_zaf.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-PHL_example_plots
      • This folder will contain a number of plots generated from OG-Core to help you visualize the output from your run
    • ./examples/ogphl_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-PHL-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-PHL-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-PHL-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/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-PHL 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 ogphl.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-PHL/examples/run_og_zaf.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-PHL 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 Research Fellow and Director of Open Policy, Center for Growth and Opportunity at Utah State University; 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-PHL

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

og-phl's People

Contributors

jdebacker avatar rickecon avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

og-phl's Issues

Income distribution in PHL

The gini coefficient (and other earnings distribution moments) should be updated in income.py to reflect IDN.

SAM file for PHL

Find a source for a SAM file for IDN and replace the link in input_output.py to point to this.

Note that one may also need to updates constants.py to define the consumption and production goods from this new SAM file.

Calibrate tax rates for PHL

For this, we'll need to update

  • Consumption tax rates, tau_c
  • Corporate income tax rate, cit_rate
  • Personal income taxes(including pension contributions) (assume linear tax functions if we can't find taxes by income group)
    • Effective tax rates, etr_params
    • Marginal tax rates on capital and labor income, mtrx_params and mtry_params

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.