ogzaf


Nameogzaf JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://github.com/EAPD-DRB/OG-ZAF/
SummarySouth Africa Calibration for OG-Core
upload_time2023-10-30 18:32:56
maintainer
docs_urlNone
authorMarcelo LaFleur, Richard W. Evans, and Jason DeBacker
requires_python>=3.7.7
licenseCC0 1.0 Universal (CC0 1.0) Public Domain Dedication
keywords 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.9](https://img.shields.io/badge/python-3.9-blue.svg)](https://www.python.org/downloads/release/python-3917/) [![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.

## 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": "",
    "docs_url": null,
    "requires_python": ">=3.7.7",
    "maintainer_email": "",
    "keywords": "South Africa calibration of large scale overlapping generations model of fiscal policy",
    "author": "Marcelo LaFleur, Richard W. Evans, and Jason DeBacker",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/8e/81/aa94885a70bdc48f0a1d013dc71f4d7b13e3e44ccf2ead55e725f0fc0163/ogzaf-0.0.1.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.9](https://img.shields.io/badge/python-3.9-blue.svg)](https://www.python.org/downloads/release/python-3917/) [![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\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.1",
    "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": [
        "south",
        "africa",
        "calibration",
        "of",
        "large",
        "scale",
        "overlapping",
        "generations",
        "model",
        "of",
        "fiscal",
        "policy"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "82b20eeb89279c7202173ab1bf9848b947a7128b052a6142a9d7b984c8c41eae",
                "md5": "1e983c9ccf14f4b161606d5c9bf2e2c0",
                "sha256": "8cf8a9c9e0e52cd8029017939d682e175625792878f67257197b3cdc0603df72"
            },
            "downloads": -1,
            "filename": "ogzaf-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1e983c9ccf14f4b161606d5c9bf2e2c0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7.7",
            "size": 34304,
            "upload_time": "2023-10-30T18:32:54",
            "upload_time_iso_8601": "2023-10-30T18:32:54.683576Z",
            "url": "https://files.pythonhosted.org/packages/82/b2/0eeb89279c7202173ab1bf9848b947a7128b052a6142a9d7b984c8c41eae/ogzaf-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8e81aa94885a70bdc48f0a1d013dc71f4d7b13e3e44ccf2ead55e725f0fc0163",
                "md5": "d011ade435a45d25720e2c3627a189bd",
                "sha256": "873978dafebe47f280cad5d129f62e66ef1de2e71e27230f6db6617f2059567a"
            },
            "downloads": -1,
            "filename": "ogzaf-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "d011ade435a45d25720e2c3627a189bd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7.7",
            "size": 52871,
            "upload_time": "2023-10-30T18:32:56",
            "upload_time_iso_8601": "2023-10-30T18:32:56.390265Z",
            "url": "https://files.pythonhosted.org/packages/8e/81/aa94885a70bdc48f0a1d013dc71f4d7b13e3e44ccf2ead55e725f0fc0163/ogzaf-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-30 18:32:56",
    "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.14143s