ogzaf


Nameogzaf JSON
Version 0.0.3 PyPI version JSON
download
home_pagehttps://github.com/EAPD-DRB/OG-ZAF/
SummarySouth Africa Calibration for OG-Core
upload_time2024-07-26 10:03:13
maintainerNone
docs_urlNone
authorMarcelo LaFleur, Richard W. Evans, and Jason DeBacker
requires_python<3.12,>=3.7.7
licenseCC0 1.0 Universal (CC0 1.0) Public Domain Dedication
keywords zaf south africa calibration of large scale overlapping generations model of fiscal policy
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # OG-ZAF

| | |
| --- | --- |
| Org | [![United Nations DESA](https://img.shields.io/badge/United%20Nations%20DESA-blue)](https://www.un.org/en/desa) [![PSL cataloged](https://img.shields.io/badge/PSL-cataloged-a0a0a0.svg)](https://www.PSLmodels.org) [![OS License: CC0-1.0](https://img.shields.io/badge/OS%20License-CC0%201.0-yellow)](https://github.com/EAPD-DRB/OG-ZAF/blob/main/LICENSE) |
| Package | [![Python 3.10](https://img.shields.io/badge/python-3.10-blue.svg)](https://www.python.org/downloads/release/python-31013/) [![Python 3.11](https://img.shields.io/badge/python-3.11-blue.svg)](https://www.python.org/downloads/release/python-3116/) [![PyPI Latest Release](https://img.shields.io/pypi/v/ogzaf.svg)](https://pypi.org/project/ogzaf/) [![PyPI Downloads](https://img.shields.io/pypi/dm/ogzaf.svg?label=PyPI%20downloads)](https://pypi.org/project/ogzaf/) |
| Testing | ![example event parameter](https://github.com/EAPD-DRB/OG-ZAF/actions/workflows/build_and_test.yml/badge.svg?branch=main) ![example event parameter](https://github.com/EAPD-DRB/OG-ZAF/actions/workflows/deploy_docs.yml/badge.svg?branch=main) ![example event parameter](https://github.com/EAPD-DRB/OG-ZAF/actions/workflows/check_format.yml/badge.svg?branch=main) [![Codecov](https://codecov.io/gh/EAPD-DRB/OG-ZAF/branch/main/graph/badge.svg)](https://codecov.io/gh/EAPD-DRB/OG-ZAF) |

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


## Using and contributing to OG-ZAF

* If you are installing on a Mac computer, install XCode Tools. In Terminal: `xcode-select —install`
* Download and install the appropriate [Anaconda distribution](https://www.anaconda.com/products/distribution#Downloads) 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 `ogzaf-dev` conda environment should not take more than five minutes.
* Then, `conda activate ogzaf-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-ZAF_example_plots`
    * This folder will contain a number of plots generated from OG-Core to help you visualize the output from your run
  * `./examples/ogzaf_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-ZAF-Example/OUTPUT_BASELINE/model_params.pkl`
    * Model parameters used in the baseline run
    * See [`ogcore.execute.py`](https://github.com/PSLmodels/OG-Core/blob/master/ogcore/execute.py) for items in the dictionary object in this pickle file
  * `./examples/OG-ZAF-Example/OUTPUT_BASELINE/SS/SS_vars.pkl`
    * Outputs from the model steady state solution under the baseline policy
    * See [`ogcore.SS.py`](https://github.com/PSLmodels/OG-Core/blob/master/ogcore/SS.py) for what is in the dictionary object in this pickle file
  * `./examples/OG-ZAF-Example/OUTPUT_BASELINE/TPI/TPI_vars.pkl`
    * Outputs from the model timepath solution under the baseline policy
    * See [`ogcore.TPI.py`](https://github.com/PSLmodels/OG-Core/blob/master/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-ZAF 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 ogzaf.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-ZAF/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-ZAF repository are:

* Marcelo LaFleur (GitHub handle: [@SeaCelo](https://github.com/SeaCelo)), Senior Economist, Department of Economic and Social Affairs (DESA), United Nations
* [Richard W. Evans](https://sites.google.com/site/rickecon/) (GitHub handle: [@rickecon](https://github.com/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](https://jasondebacker.com) (GitHub handle: [@jdebacker](https://github.com/jdebacker)), Associate Professor, University of South Carolina; Vice President of Research, Open Research Group, Inc.

## Citing OG-ZAF

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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/EAPD-DRB/OG-ZAF/",
    "name": "ogzaf",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.12,>=3.7.7",
    "maintainer_email": null,
    "keywords": "ZAF South Africa calibration of large scale overlapping generations model of fiscal policy",
    "author": "Marcelo LaFleur, Richard W. Evans, and Jason DeBacker",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/24/b8/73eb4a5817453aea520a25135884e72eb5ef6a6344cb8a600c5f2de87357/ogzaf-0.0.3.tar.gz",
    "platform": null,
    "description": "# OG-ZAF\n\n| | |\n| --- | --- |\n| Org | [![United Nations DESA](https://img.shields.io/badge/United%20Nations%20DESA-blue)](https://www.un.org/en/desa) [![PSL cataloged](https://img.shields.io/badge/PSL-cataloged-a0a0a0.svg)](https://www.PSLmodels.org) [![OS License: CC0-1.0](https://img.shields.io/badge/OS%20License-CC0%201.0-yellow)](https://github.com/EAPD-DRB/OG-ZAF/blob/main/LICENSE) |\n| Package | [![Python 3.10](https://img.shields.io/badge/python-3.10-blue.svg)](https://www.python.org/downloads/release/python-31013/) [![Python 3.11](https://img.shields.io/badge/python-3.11-blue.svg)](https://www.python.org/downloads/release/python-3116/) [![PyPI Latest Release](https://img.shields.io/pypi/v/ogzaf.svg)](https://pypi.org/project/ogzaf/) [![PyPI Downloads](https://img.shields.io/pypi/dm/ogzaf.svg?label=PyPI%20downloads)](https://pypi.org/project/ogzaf/) |\n| Testing | ![example event parameter](https://github.com/EAPD-DRB/OG-ZAF/actions/workflows/build_and_test.yml/badge.svg?branch=main) ![example event parameter](https://github.com/EAPD-DRB/OG-ZAF/actions/workflows/deploy_docs.yml/badge.svg?branch=main) ![example event parameter](https://github.com/EAPD-DRB/OG-ZAF/actions/workflows/check_format.yml/badge.svg?branch=main) [![Codecov](https://codecov.io/gh/EAPD-DRB/OG-ZAF/branch/main/graph/badge.svg)](https://codecov.io/gh/EAPD-DRB/OG-ZAF) |\n\nOG-ZAF is an overlapping-generations (OG) model that allows for dynamic general equilibrium analysis of fiscal policy for South Africa. OG-ZAF 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 South African calibration of the model will be available soon.\n\n\n## Using and contributing to OG-ZAF\n\n* If you are installing on a Mac computer, install XCode Tools. In Terminal: `xcode-select \u2014install`\n* Download and install the appropriate [Anaconda distribution](https://www.anaconda.com/products/distribution#Downloads) of Python. Select the correct version for you platform (Windows, Intel Mac, or M1 Mac).\n* In Terminal:\n  * Make sure the `conda` package manager is up-to-date: `conda update conda`.\n  * Make sure the Anaconda distribution of Python is up-to-date: `conda update anaconda`.\n* Fork this repository and clone your fork of this repository to a directory on your computer.\n* 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 `ogzaf-dev` conda environment should not take more than five minutes.\n* Then, `conda activate ogzaf-dev`\n* Then install by `pip install -e .`\n### Run an example of the model\n* Navigate to `./examples`\n* Run the model with an example reform from terminal/command prompt by typing `python run_og_zaf.py`\n* You can adjust the `./examples/run_og_zaf.py` by modifying model parameters specified in the dictionary passed to the `p.update_specifications()` calls.\n* Model outputs will be saved in the following files:\n  * `./examples/OG-ZAF_example_plots`\n    * This folder will contain a number of plots generated from OG-Core to help you visualize the output from your run\n  * `./examples/ogzaf_example_output.csv`\n    * This is a summary of the percentage changes in macro variables over the first ten years and in the steady-state.\n  * `./examples/OG-ZAF-Example/OUTPUT_BASELINE/model_params.pkl`\n    * Model parameters used in the baseline run\n    * See [`ogcore.execute.py`](https://github.com/PSLmodels/OG-Core/blob/master/ogcore/execute.py) for items in the dictionary object in this pickle file\n  * `./examples/OG-ZAF-Example/OUTPUT_BASELINE/SS/SS_vars.pkl`\n    * Outputs from the model steady state solution under the baseline policy\n    * See [`ogcore.SS.py`](https://github.com/PSLmodels/OG-Core/blob/master/ogcore/SS.py) for what is in the dictionary object in this pickle file\n  * `./examples/OG-ZAF-Example/OUTPUT_BASELINE/TPI/TPI_vars.pkl`\n    * Outputs from the model timepath solution under the baseline policy\n    * See [`ogcore.TPI.py`](https://github.com/PSLmodels/OG-Core/blob/master/ogcore/TPI.py) for what is in the dictionary object in this pickle file\n  * An analogous set of files in the `./examples/OUTPUT_REFORM` directory, which represent objects from the simulation of the reform policy\n\nNote 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.\n\nIf you run into errors running the example script, please open a new issue in the OG-ZAF repo with a description of the issue and any relevant tracebacks you receive.\n\nOnce the package is installed, one can adjust parameters in the OG-Core `Specifications` object using the `Calibration` class as follows:\n\n```\nfrom ogcore.parameters import Specifications\nfrom ogzaf.calibrate import Calibration\np = Specifications()\nc = Calibration(p)\nupdated_params = c.get_dict()\np.update_specifications({'initial_debt_ratio': updated_params['initial_debt_ratio']})\n```\n\n## Disclaimer\nThe organization of this repository will be changing rapidly, but the `OG-ZAF/examples/run_og_zaf.py` script will be kept up to date to run with the master branch of this repo.\n\n## Core Maintainers\n\nThe core maintainers of the OG-ZAF repository are:\n\n* Marcelo LaFleur (GitHub handle: [@SeaCelo](https://github.com/SeaCelo)), Senior Economist, Department of Economic and Social Affairs (DESA), United Nations\n* [Richard W. Evans](https://sites.google.com/site/rickecon/) (GitHub handle: [@rickecon](https://github.com/rickecon)), Senior Research Fellow and Director of Open Policy, Center for Growth and Opportunity at Utah State University; President, Open Research Group, Inc.\n* [Jason DeBacker](https://jasondebacker.com) (GitHub handle: [@jdebacker](https://github.com/jdebacker)), Associate Professor, University of South Carolina; Vice President of Research, Open Research Group, Inc.\n\n## Citing OG-ZAF\n\nOG-ZAF (Version #.#.#)[Source code], https://github.com/EAPD-DRB/OG-ZAF\n",
    "bugtrack_url": null,
    "license": "CC0 1.0 Universal (CC0 1.0) Public Domain Dedication",
    "summary": "South Africa Calibration for OG-Core",
    "version": "0.0.3",
    "project_urls": {
        "Download": "https://github.com/EAPD-DRB/OG-ZAF/",
        "Homepage": "https://github.com/EAPD-DRB/OG-ZAF/",
        "Issue Tracker": "https://github.com/EAPD-DRB/OG-ZAF/issues"
    },
    "split_keywords": [
        "zaf",
        "south",
        "africa",
        "calibration",
        "of",
        "large",
        "scale",
        "overlapping",
        "generations",
        "model",
        "of",
        "fiscal",
        "policy"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f5655f93931e6f0c8861074c525e1fbec2b1fbe1fd1f7e7f4baf29cf49537b98",
                "md5": "8186584925a306960bb2b032d48900ea",
                "sha256": "53661a541c447f719b5c532384ed063bc757e540df2fbcd7340aa3caf1a7f4dc"
            },
            "downloads": -1,
            "filename": "ogzaf-0.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8186584925a306960bb2b032d48900ea",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.12,>=3.7.7",
            "size": 310082,
            "upload_time": "2024-07-26T10:03:12",
            "upload_time_iso_8601": "2024-07-26T10:03:12.639517Z",
            "url": "https://files.pythonhosted.org/packages/f5/65/5f93931e6f0c8861074c525e1fbec2b1fbe1fd1f7e7f4baf29cf49537b98/ogzaf-0.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "24b873eb4a5817453aea520a25135884e72eb5ef6a6344cb8a600c5f2de87357",
                "md5": "8f03baec5694c9b1a9b2e7d7bd87ccaa",
                "sha256": "2a19ac5af4063c833ac37a7d80fd655ce678fe98f06ee28a5b86414baeb68ecd"
            },
            "downloads": -1,
            "filename": "ogzaf-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "8f03baec5694c9b1a9b2e7d7bd87ccaa",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.12,>=3.7.7",
            "size": 310011,
            "upload_time": "2024-07-26T10:03:13",
            "upload_time_iso_8601": "2024-07-26T10:03:13.893443Z",
            "url": "https://files.pythonhosted.org/packages/24/b8/73eb4a5817453aea520a25135884e72eb5ef6a6344cb8a600c5f2de87357/ogzaf-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-26 10:03:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "EAPD-DRB",
    "github_project": "OG-ZAF",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "ogzaf"
}
        
Elapsed time: 0.30607s