Package: ogcore
OG-CoreOrgPackageTestingOG-Core is an overlapping-generations (OG) model core theory, logic, and solution method algorithms that allow for dynamic general equilibrium analysis of fiscal policy. OG-Core provides a general framework and is a dependency of several country-specific OG models, such asOG-USAandOG-UK. 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 availablehere.DisclaimerThe model is constantly under development, and model components could change significantly. The package will have released versions, which will be checked against existing code prior to release. Stay tuned for an upcoming release!Using/contributing to OG-CoreThere are two primary methods for installing and running OG-Core on your computer locally. The first and simplest method is to download the most recentogcorePython package from the Python Package Index (PyPI.org). A second option is to fork and clone the most recent version of OG-Core from its GitHub repository and create the conda environment for theogcorepackage. We detail both of these methods below.Installing and Running OG-Core from Python Package Index (PyPI.org)Open your terminal (or Conda command prompt), and make sure you have the most recent version ofpip(the Python Index Package manager) by typing on a Unix/macOS machinepython3 -m pip install --upgrade pipor on a Windows machinepy -m pip install --upgrade pip.Install theogcorepackage from the Python Package Index by typingpip install ogcore.Navigate to a folder./YourFolderName/where you want to save scripts to run OG-Core and output from the simulations in those scripts.Save the python scriptrun_ogcore_example.pyfrom the OG-Core GitHub repository in the folder where you are working on your local machine./YourFolderName/run_ogcore_example.py.Run the model with an example reform from terminal/command prompt by typingpython run_ogcore_example.pyYou can adjust therun_ogcore_example.pyscript by modifying model parameters specified in theog_specdictionary.Model outputs will be saved in the following files:./run_example_plotsThis folder will contain a number of plots generated from OG-Core to help you visualize the output from your run./ogcore_example_output.csvThis is a summary of the percentage changes in macro variables over the first ten years and in the steady-state../OUTPUT_BASELINE/model_params.pklModel parameters used in the baseline runSeeexecute.pyin the OG-Core repository for items in the dictionary object in this pickle file./OUTPUT_BASELINE/SS/SS_vars.pklOutputs from the model steady state solution under the baseline policySeeSS.pyin the OG-Core repository for what is in the dictionary object in this pickle file./OUTPUT_BASELINE/TPI/TPI_vars.pklOutputs from the model timepath solution under the baseline policySeeTPI.pyin the OG-Core repository for what is in the dictionary object in this pickle fileAn analogous set of files in the./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 more than two hours of compute time.If you run into errors running the example script, please open a new issue in the OG-Core repo with a description of the issue and any relevant tracebacks you receive.The CSV output file./ogcore_example_output.csvcan be compared to the./run_examples/expected_ogcore_example_output.csvfile in the OG-Core repository to confirm that you are generating the expected output. The easiest way to do this is to copy theexample-diffsandexample-diffs.batfiles from the OG-Core repository and use thesh example-diffscommand (orexample-diffson Windows) from therun_examplesdirectory. If you run into errors running the example script, please open a new issue in the OG-Core repo with a description of the issue and any relevant tracebacks you receive.Installing and Running OG-Core from GitHub repositoryInstall theAnaconda distributionof PythonClone this repository to a directory on your computerFrom the terminal (or Conda command prompt), navigate to the directory to which you cloned this repository and runconda env create -f environment.ymlThen,conda activate ogcore-devThen install bypip install -e .Navigate to./run_examplesRun the model with an example reform from terminal/command prompt by typingpython run_ogcore_example.pyYou can adjust the./run_examples/run_ogcore_example.pyscript by modifying model parameters specified in theog_specdictionary.Model outputs will be saved in the following files:./run_examples/run_example_plotsThis folder will contain a number of plots generated from OG-Core to help you visualize the output from your run./run_examples/ogcore_example_output.csvThis is a summary of the percentage changes in macro variables over the first ten years and in the steady-state../run_examples/OUTPUT_BASELINE/model_params.pklModel parameters used in the baseline runSeeexecute.pyfor items in the dictionary object in this pickle file./run_examples/OUTPUT_BASELINE/SS/SS_vars.pklOutputs from the model steady state solution under the baseline policySeeSS.pyfor what is in the dictionary object in this pickle file./run_examples/OUTPUT_BASELINE/TPI/TPI_vars.pklOutputs from the model timepath solution under the baseline policySeeTPI.pyfor what is in the dictionary object in this pickle fileAn analogous set of files in the./run_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 more than two hours of compute time.If you run into errors running the example script, please open a new issue in the OG-Core repo with a description of the issue and any relevant tracebacks you receive.The CSV output file./run_examples/ogcore_example_output.csvcan be compared to the./run_examples/expected_ogcore_example_output.csvfile that is checked into the repository to confirm that you are generating the expected output. The easiest way to do this is to use thesh example-diffscommand (orexample-diffson Windows) from therun_examplesdirectory. If you run into errors running the example script, please open a new issue in the OG-Core repo with a description of the issue and any relevant tracebacks you receive.Core MaintainersThe core maintainers of the OG-Core repository are:Jason DeBacker(GitHub handle:jdebacker), Associate Professor, Department of Economics, Darla Moore School of Business, University of South Carolina; President, PSL Foundation; Vice President of Research and Co-founder, Open Research Group, Inc.Richard W. Evans(GitHub handle:rickecon), Advisory Board Visiting Fellow, Center for Public Finance, Baker Institute for Public Policy at Rice University; President, Open Research Group, Inc.; Director, Open Source Economics LaboratoryCiting OG-CoreOG-Core (Version #.#.#)[Source code],https://github.com/PSLmodels/OG-Core