Package: ogzaf
OG-ZAFOrgPackageTestingOG-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 athttps://pslmodels.github.io/OG-Coreand documentation of the specific South African calibration of the model will be available soon.Using and contributing to OG-ZAFIf you are installing on a Mac computer, install XCode Tools. In Terminal:xcode-select —installDownload and install the appropriateAnaconda distributionof Python. Select the correct version for you platform (Windows, Intel Mac, or M1 Mac).In Terminal:Make sure thecondapackage 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 runconda env create -f environment.yml. The process of creating theogzaf-devconda environment should not take more than five minutes.Then,conda activate ogzaf-devThen install bypip install -e .Run an example of the modelNavigate to./examplesRun the model with an example reform from terminal/command prompt by typingpython run_og_zaf.pyYou can adjust the./examples/run_og_zaf.pyby modifying model parameters specified in the dictionary passed to thep.update_specifications()calls.Model outputs will be saved in the following files:./examples/OG-ZAF_example_plotsThis folder will contain a number of plots generated from OG-Core to help you visualize the output from your run./examples/ogzaf_example_output.csvThis 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.pklModel parameters used in the baseline runSeeogcore.execute.pyfor items in the dictionary object in this pickle file./examples/OG-ZAF-Example/OUTPUT_BASELINE/SS/SS_vars.pklOutputs from the model steady state solution under the baseline policySeeogcore.SS.pyfor what is in the dictionary object in this pickle file./examples/OG-ZAF-Example/OUTPUT_BASELINE/TPI/TPI_vars.pklOutputs from the model timepath solution under the baseline policySeeogcore.TPI.pyfor what is in the dictionary object in this pickle fileAn analogous set of files in the./examples/OUTPUT_REFORMdirectory, which represent objects from the simulation of the reform policyNote 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-CoreSpecificationsobject using theCalibrationclass 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']})DisclaimerThe organization of this repository will be changing rapidly, but theOG-ZAF/examples/run_og_zaf.pyscript will be kept up to date to run with the master branch of this repo.Core MaintainersThe core maintainers of the OG-ZAF repository are:Marcelo LaFleur (GitHub handle:@SeaCelo), Senior Economist, Department of Economic and Social Affairs (DESA), United NationsRichard 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.Citing OG-ZAFOG-ZAF (Version #.#.#)[Source code],https://github.com/EAPD-DRB/OG-ZAF