USA calibration for OG-Core
Project description
OG-USA
| Org | |
| Package | |
| Testing |
OG-USA is an overlapping-generations (OG) model that allows for dynamic general equilibrium analysis of fiscal policy for the United States. OG-USA 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 United States calibration of the model is available at https://pslmodels.github.io/OG-USA.
Disclaimer
The 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-USA
There are two primary methods for installing and running OG-USA on your computer locally. The first and simplest method is to download the most recent ogusa Python package from the Python Package Index (PyPI.org). The second option is to fork and clone the most recent version of OG-USA from its GitHub repository and install the ogusa package with its development dependencies using uv. Both methods are detailed below.
Installing and Running OG-USA from PyPI
- On macOS, first install Xcode Command Line Tools (in Terminal:
xcode-select --install). - Open your terminal and install the
ogusapackage from the Python Package Index by typingpip install ogusa. - Navigate to a folder
./YourFolderName/where you want to save scripts to run OG-USA and output from the simulations in those scripts. - Copy the python script
run_og_usa.pyfrom the OG-USA GitHub repository into your folder as./YourFolderName/run_og_usa.py. - Run the model with an example reform from terminal/command prompt by typing
python run_og_usa.py.
Installing and Running OG-USA from the GitHub repository
- On macOS, first install Xcode Command Line Tools (in Terminal:
xcode-select --install). - Install
uvby following the installation instructions for your platform (or simply runpip install uv). - Fork this repository and clone your fork to a directory on your computer.
- From the terminal, navigate to the cloned directory and run
uv sync --extra devto create a local.venvand install OG-USA with its development dependencies.uvwill also download a compatible Python interpreter if you don't already have one. - For docs/Jupyter Book work, also run
uv sync --extra dev --extra docs.
Run an example of the model
- Install
uvby following the installation instructions for your platform, or by runningpip install uv. - Clone this repository to a directory on your computer
- From the terminal, navigate to the directory to which you cloned this
repository and run
uv sync --extra dev. - Navigate to
./examples - Run the model with an example reform from terminal/command prompt by
typing
uv run python run_ogusa.py - You can adjust the
./examples/run_ogusa.pyby modifying model parameters specified in the dictionary passed to thep.update_specifications()calls. - Model outputs will be saved in the following files:
./examples/Example/: This folder will contain all of the output from therun_ogusa.pyrun script../examples/Example/example_plots_tables: This folder will contain a number of plots and tables generated from therun_ogusa.pyrun script to help you visualize the output../examples/Example/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/Example/OUTPUT_BASELINE/: This folder contains all of the inputs to and outputs from the baseline equilibrium computation fromrun_ogusa.py./examples/Example/OUTPUT_BASELINE/model_params.pkl: Pickle binary file of ParamTools object of model parameters used in the baseline run./examples/Example/OUTPUT_BASELINE/SS/SS_vars.pkl: Pickle binary file of Python dictionary of outputs from the model steady state solution under the baseline policy. Seeogcore.SS.pyfor what is in the dictionary object in this pickle file./examples/Example/OUTPUT_BASELINE/TPI/TPI_vars.pkl: Pickle binary file of Python dictionary of outputs from the model timepath solution under the baseline policy. Seeogcore.TPI.pyfor what is in the dictionary object in this pickle file
- An analogous set of files in the
./examples/OUTPUT_REFORMdirectory, 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 more than two hours of compute time.
If you run into errors running the example script, please open a new issue in the OG-USA 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 ogusa.calibrate import Calibration
p = Specifications()
c = Calibration(p)
updated_params = c.get_dict()
p.update_specifications({'initial_debt_ratio': updated_params['initial_debt_ratio']})
Core Maintainers
The 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), Senior Economist, Abundance Institute; President, Open Research Group, Inc.; Director, Open Source Economics Laboratory.
Citing OG-USA
OG-USA (Version #.#.#)[Source code], https://github.com/PSLmodels/OG-USA.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ogusa-0.4.0.tar.gz.
File metadata
- Download URL: ogusa-0.4.0.tar.gz
- Upload date:
- Size: 24.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1dfca1ccdb4edc4f03d344afd672ecef582094e2502f3f62cf74ed8681444e67
|
|
| MD5 |
c97ef7627e18ece751d1d28fa3ef1636
|
|
| BLAKE2b-256 |
de3b2c40da507f431f72bd54fb37e609f62376b6355d243b95d3125bf4f57406
|
File details
Details for the file ogusa-0.4.0-py3-none-any.whl.
File metadata
- Download URL: ogusa-0.4.0-py3-none-any.whl
- Upload date:
- Size: 24.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cbe6bd5f82cd9e340f51be23e664d6934c94b1f21a3107d25ffa17feeabbf0a7
|
|
| MD5 |
9caa253619f3f87c4ef34966763a0e53
|
|
| BLAKE2b-256 |
17eb221c4a68057f4fdb92135ecb3492ae2fab6fba6f9dec20a073db7e00dbde
|