diff --git a/.gitattributes b/.gitattributes index 94945712b..2a0a31fc8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -ogusa/_version.py export-subst +ogcore/_version.py export-subst diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 77f04d634..1e698020c 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -18,7 +18,7 @@ jobs: - name: Setup Miniconda using Python ${{ matrix.python-version }} uses: conda-incubator/setup-miniconda@v2 with: - activate-environment: ogusa-dev + activate-environment: ogcore-dev environment-file: environment.yml python-version: ${{ matrix.python-version }} auto-activate-base: false diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index a54b665b2..ad4dd80c5 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -5,7 +5,7 @@ on: - master jobs: build-and-deploy: - if: github.repository == 'PSLmodels/OG-USA' + if: github.repository == 'PSLmodels/OG-Core' runs-on: ubuntu-latest steps: - name: Checkout @@ -16,7 +16,7 @@ jobs: - name: Setup Miniconda uses: conda-incubator/setup-miniconda@v2 with: - activate-environment: ogusa-dev + activate-environment: ogcore-dev environment-file: environment.yml python-version: 3.7 auto-activate-base: false diff --git a/.github/workflows/docs_check.yml b/.github/workflows/docs_check.yml index 497110045..f5fe2f247 100644 --- a/.github/workflows/docs_check.yml +++ b/.github/workflows/docs_check.yml @@ -13,7 +13,7 @@ jobs: - name: Setup Miniconda uses: conda-incubator/setup-miniconda@v2 with: - activate-environment: ogusa-dev + activate-environment: ogcore-dev environment-file: environment.yml python-version: 3.7 auto-activate-base: false diff --git a/.gitignore b/.gitignore index f2befe2d6..d2471dff7 100644 --- a/.gitignore +++ b/.gitignore @@ -44,13 +44,13 @@ docs/build/* run_examples/run_example_plots/* run_examples/OUTPUT_BASELINE/* run_examples/OUTPUT_REFORM/* -run_examples/ogusa_example_output.csv -ogusa/tests/test_io_data/tax_func_loop_inputs_large.pkl -ogusa/tests/baseline/* -ogusa/tests/reform/* -ogusa/tests/OUTPUT/* -ogusa/tests/OUTPUT_BASELINE/* -ogusa/tests/OUTPUT_REFORM/* +run_examples/ogcore_example_output.csv +ogcore/tests/test_io_data/tax_func_loop_inputs_large.pkl +ogcore/tests/baseline/* +ogcore/tests/reform/* +ogcore/tests/OUTPUT/* +ogcore/tests/OUTPUT_BASELINE/* +ogcore/tests/OUTPUT_REFORM/* regression/OUTPUT_BASELINE/* regression/OUTPUT_REFORM* *default.profraw diff --git a/.jenkins_wrapper.sh b/.jenkins_wrapper.sh index 70d228038..4627e9dad 100644 --- a/.jenkins_wrapper.sh +++ b/.jenkins_wrapper.sh @@ -4,7 +4,7 @@ from_config(){ } from_config numpy_version from_config install_taxcalc_version -from_config compare_ogusa_version +from_config compare_ogcore_version from_config compare_taxcalc_version @@ -14,18 +14,18 @@ bash miniconda.sh -b -p $WORKSPACE/miniconda export PATH="$WORKSPACE/miniconda/bin:$PATH" conda config --set always_yes yes --set changeps1 no conda update conda -n root -conda env list | grep ogusa_env && conda env remove -n ogusa_env || echo Didnt have to remove env +conda env list | grep ogcore_env && conda env remove -n ogcore_env || echo Didnt have to remove env conda install nomkl -conda create --force -n ogusa_env python=2.7 nomkl +conda create --force -n ogcore_env python=2.7 nomkl -source activate ogusa_env +source activate ogcore_env conda install --force yaml llvmlite enum34 funcsigs singledispatch libgfortran libpng openblas numba pytz pytest six toolz dateutil cycler scipy numpy=$numpy_version pyparsing pandas=0.18.1 matplotlib nomkl conda remove mkl mkl-service || echo didnt have to remove mkl mkl-service conda install --no-deps -c ospc taxcalc=$install_taxcalc_version --force -if [ "$ogusainstallmethod" = "conda" ];then - conda install -c ospc ogusa=$ogusaversion +if [ "$ogcoreinstallmethod" = "conda" ];then + conda install -c ospc ogcore=$ogcoreversion fi -if [ "$ogusainstallmethod" = "git" ];then +if [ "$ogcoreinstallmethod" = "git" ];then python setup.py install fi @@ -40,4 +40,4 @@ stat puf.csv head -n 1 puf.csv md5sum puf.csv -python run_reforms.py $reform $ogusabranch +python run_reforms.py $reform $ogcorebranch diff --git a/.regression.txt b/.regression.txt index 7b5363480..7ce07dd6d 100644 --- a/.regression.txt +++ b/.regression.txt @@ -2,7 +2,7 @@ # (It is not a yaml because it is grepped by bash and used by Python) install_taxcalc_version 0.6.8 -compare_ogusa_version 0.5.5 +compare_ogcore_version 0.5.5 compare_taxcalc_version 0.6.6 diff True numpy_version 1.10 diff --git a/MANIFEST.in b/MANIFEST.in index df7503a4e..5d150f13c 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,6 @@ -include ogusa/data/ability/* -include ogusa/data/demographic/* -include ogusa/data/labor/* -include ogusa/data/tax_functions/* -include ogusa/default_parameters.json -include ogusa/OGUSAplots.mplstyle +include ogcore/data/ability/* +include ogcore/data/demographic/* +include ogcore/data/labor/* +include ogcore/data/tax_functions/* +include ogcore/default_parameters.json +include ogcore/ogcoreplots.mplstyle diff --git a/Makefile b/Makefile index 75cdc0ec8..8d1608e5d 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ # Development is typically conducted on Linux or Max OS X (with the Xcode # command-line tools installed), so this Makefile is designed # to work in that environment (and not on Windows). -# USAGE: OG-USA$ make [TARGET] +# USAGE: OG-Core$ make [TARGET] .PHONY=help help: @@ -28,18 +28,18 @@ clean: .PHONY=package package: - @pbrelease OG-USA ogusa 0.0.0 --local + @pbrelease OG-Core ogcore 0.0.0 --local .PHONY=pytest pytest: - @cd ogusa ; pytest -W ignore + @cd ogcore ; pytest -W ignore -OGUSA_JSON_FILES := $(shell ls -l ./ogusa/*json | awk '{print $$9}') +ogcore_JSON_FILES := $(shell ls -l ./ogcore/*json | awk '{print $$9}') .PHONY=cstest cstest: - -pycodestyle ogusa - -pycodestyle --ignore=E501,E121 $(OGUSA_JSON_FILES) + -pycodestyle ogcore + -pycodestyle --ignore=E501,E121 $(ogcore_JSON_FILES) define coverage-cleanup rm -f .coverage htmlcov/* diff --git a/codecov.yml b/codecov.yml index 95d691d39..3d35e1838 100644 --- a/codecov.yml +++ b/codecov.yml @@ -21,8 +21,8 @@ comment: ignore: - "setup.py" - - "./ogusa/_version.py" + - "./ogcore/_version.py" - "./cs-config/**/*" # ignore folders and all its contents - - "./ogusa/tests/" # ignore folders and all its contents + - "./ogcore/tests/" # ignore folders and all its contents - "./regression/**/*" # ignore folders and all its contents - + diff --git a/conda.recipe/meta.yaml b/conda.recipe/meta.yaml index 4aab19052..1c3e4be37 100755 --- a/conda.recipe/meta.yaml +++ b/conda.recipe/meta.yaml @@ -1,5 +1,5 @@ package: - name: ogusa + name: ogcore version: 0.5.13 source: @@ -29,29 +29,29 @@ requirements: -requests about: - home: https://github.com/PSLmodels/OG-USA/ + home: https://github.com/PSLmodels/OG-Core/ test: imports: - - ogusa - - ogusa.SS - - ogusa.TPI - - ogusa.aggregates - - ogusa.constants - - ogusa.demographics - - ogusa.elliptical_u_est - - ogusa.execute - - ogusa.firm - - ogusa.fiscal - - ogusa.get_micro_data - - ogusa.household - - ogusa.income - - ogusa.output_plots - - ogusa.output_tables - - ogusa.parameter_plots - - ogusa.parameter_tables - - ogusa.parameters - - ogusa.tax - - ogusa.txfunc - - ogusa.utils - - ogusa.wealth + - ogcore + - ogcore.SS + - ogcore.TPI + - ogcore.aggregates + - ogcore.constants + - ogcore.demographics + - ogcore.elliptical_u_est + - ogcore.execute + - ogcore.firm + - ogcore.fiscal + - ogcore.get_micro_data + - ogcore.household + - ogcore.income + - ogcore.output_plots + - ogcore.output_tables + - ogcore.parameter_plots + - ogcore.parameter_tables + - ogcore.parameters + - ogcore.tax + - ogcore.txfunc + - ogcore.utils + - ogcore.wealth diff --git a/cs-config/cs_config/functions.py b/cs-config/cs_config/functions.py index 437c89299..65b6f2e2a 100644 --- a/cs-config/cs_config/functions.py +++ b/cs-config/cs_config/functions.py @@ -1,9 +1,9 @@ -import ogusa -from ogusa.parameters import Specifications -from ogusa.constants import REFORM_DIR, BASELINE_DIR, DEFAULT_START_YEAR -from ogusa import output_plots as op -from ogusa import output_tables as ot -from ogusa import SS, TPI, utils +import ogcore +from ogcore.parameters import Specifications +from ogcore.constants import REFORM_DIR, BASELINE_DIR, DEFAULT_START_YEAR +from ogcore import output_plots as op +from ogcore import output_tables as ot +from ogcore import SS, TPI, utils import os import io import pickle @@ -72,21 +72,21 @@ def get_version(): def get_inputs(meta_param_dict): meta_params = MetaParams() meta_params.adjust(meta_param_dict) - # Set default OG-USA parameters - ogusa_params = Specifications() - ogusa_params.start_year = meta_params.year - filtered_ogusa_params = OrderedDict() + # Set default OG-Core parameters + ogcore_params = Specifications() + ogcore_params.start_year = meta_params.year + filtered_ogcore_params = OrderedDict() filter_list = [ 'chi_n_80', 'chi_b', 'eta', 'zeta', 'constant_demographics', 'ltilde', 'use_zeta', 'constant_rates', 'zero_taxes', 'analytical_mtrs', 'age_specific', 'gamma', 'epsilon', 'start_year'] - for k, v in ogusa_params.dump().items(): + for k, v in ogcore_params.dump().items(): if ((k not in filter_list) and (v.get("section_1", False) != "Model Solution Parameters") and (v.get("section_2", False) != "Model Dimensions")): - filtered_ogusa_params[k] = v - print('filtered ogusa = ', k) + filtered_ogcore_params[k] = v + print('filtered ogcore = ', k) # Set default TC params iit_params = TCParams() iit_params.set_state(year=meta_params.year.tolist()) @@ -96,7 +96,7 @@ def get_inputs(meta_param_dict): filtered_iit_params[k] = v default_params = { - "OG-USA Parameters": filtered_ogusa_params, + "OG-Core Parameters": filtered_ogcore_params, "Tax-Calculator Parameters": filtered_iit_params } @@ -107,10 +107,10 @@ def get_inputs(meta_param_dict): def validate_inputs(meta_param_dict, adjustment, errors_warnings): - # ogusa doesn't look at meta_param_dict for validating inputs. + # ogcore doesn't look at meta_param_dict for validating inputs. params = Specifications() - params.adjust(adjustment["OG-USA Parameters"], raise_errors=False) - errors_warnings["OG-USA Parameters"]["errors"].update( + params.adjust(adjustment["OG-Core Parameters"], raise_errors=False) + errors_warnings["OG-Core Parameters"]["errors"].update( params.errors) # Validate TC parameter inputs pol_params = {} @@ -129,7 +129,7 @@ def validate_inputs(meta_param_dict, adjustment, errors_warnings): def run_model(meta_param_dict, adjustment): ''' - Initializes classes from OG-USA that compute the model under + Initializes classes from OG-Core that compute the model under different policies. Then calls function get output objects. ''' print('Meta_param_dict = ', meta_param_dict) @@ -167,19 +167,19 @@ def run_model(meta_param_dict, adjustment): run_micro = True time_path = meta_param_dict['time_path'][0]['value'] - # filter out OG-USA params that will not change between baseline and + # filter out OG-Core params that will not change between baseline and # reform runs (these are the non-policy parameters) - filtered_ogusa_params = {} + filtered_ogcore_params = {} constant_param_set = { 'frisch', 'beta_annual', 'sigma', 'g_y_annual', 'gamma', 'epsilon', 'Z', 'delta_annual', 'small_open', 'world_int_rate', 'initial_debt_ratio', 'initial_foreign_debt_ratio', 'zeta_D', 'zeta_K', 'tG1', 'tG2', 'rho_G', 'debt_ratio_ss', 'budget_balance'} - filtered_ogusa_params = OrderedDict() - for k, v in adjustment['OG-USA Parameters'].items(): + filtered_ogcore_params = OrderedDict() + for k, v in adjustment['OG-Core Parameters'].items(): if k in constant_param_set: - filtered_ogusa_params[k] = v + filtered_ogcore_params[k] = v # Solve baseline model start_year = meta_param_dict['year'][0]['value'] @@ -195,7 +195,7 @@ def run_model(meta_param_dict, adjustment): base_spec = { **{'start_year': start_year, 'tax_func_type': 'DEP', - 'age_specific': False}, **filtered_ogusa_params} + 'age_specific': False}, **filtered_ogcore_params} base_params = Specifications( run_micro=False, output_base=base_dir, baseline_dir=base_dir, test=False, time_path=False, baseline=True, iit_reform={}, @@ -218,7 +218,7 @@ def run_model(meta_param_dict, adjustment): # Solve reform model reform_spec = base_spec - reform_spec.update(adjustment["OG-USA Parameters"]) + reform_spec.update(adjustment["OG-Core Parameters"]) reform_params = Specifications( run_micro=False, output_base=reform_dir, baseline_dir=base_dir, test=False, time_path=time_path, diff --git a/cs-config/cs_config/helpers.py b/cs-config/cs_config/helpers.py index c1262b370..e4d2885ba 100644 --- a/cs-config/cs_config/helpers.py +++ b/cs-config/cs_config/helpers.py @@ -1,5 +1,5 @@ """ -Functions used to help OG-USA configure to COMP +Functions used to help OG-Core configure to COMP """ try: import boto3 diff --git a/cs-config/cs_config/tests/test_functions.py b/cs-config/cs_config/tests/test_functions.py index 8a0f40de2..64e4bdde0 100644 --- a/cs-config/cs_config/tests/test_functions.py +++ b/cs-config/cs_config/tests/test_functions.py @@ -9,15 +9,15 @@ class TestFunctions1(CoreTestFunctions): get_inputs = functions.get_inputs validate_inputs = functions.validate_inputs run_model = functions.run_model - ok_adjustment = {"OG-USA Parameters": {"frisch": 0.41}, + ok_adjustment = {"OG-Core Parameters": {"frisch": 0.41}, "Tax-Calculator Parameters": {}} - bad_adjustment = {"OG-USA Parameters": {"frisch": 1.5}, + bad_adjustment = {"OG-Core Parameters": {"frisch": 1.5}, "Tax-Calculator Parameters": {"STD": -1}} # Comment out until do tabular output # def test_param_effect(): -# adjustment = {"ogusa": {"frisch": 0.35}} +# adjustment = {"ogcore": {"frisch": 0.35}} # comp_dict = functions.run_model({}, adjustment) # df = pd.read_csv(io.StringIO(comp_dict['downloadable'][0]['data'])) # assert df.loc[0, 'Change from Baseline (pp)'] != 0 diff --git a/cs-config/install.sh b/cs-config/install.sh index 205fdcbc6..8b157187d 100644 --- a/cs-config/install.sh +++ b/cs-config/install.sh @@ -1,7 +1,7 @@ # bash commands for installing your package -git clone -b master --depth 1 https://github.com/PSLmodels/OG-USA -cd OG-USA +git clone -b master --depth 1 https://github.com/PSLmodels/OG-Core +cd OG-Core # Explicitly add channels for looking up dependencies outside of # taxcalc and paramtools. If the channels are not specified like this, diff --git a/cs-config/write_output.py b/cs-config/write_output.py index 943af6911..ab329b3a1 100644 --- a/cs-config/write_output.py +++ b/cs-config/write_output.py @@ -1,8 +1,8 @@ from cs_config import functions import cs_storage from cs_storage.screenshot import write_template -from ogusa import utils -from ogusa.parameters import Specifications +from ogcore import utils +from ogcore.parameters import Specifications import pickle import io @@ -46,16 +46,16 @@ def run_model(): meta_param_dict = {'year': [{'value': 2020}], 'data_source': [{'value': 'CPS'}], 'time_path': [{'value': True}]} - adjustment_dict = {'OG-USA Parameters': { + adjustment_dict = {'OG-Core Parameters': { 'frisch': 0.39, 'initial_debt_ratio': 1.1, 'g_y_annual': 0.029, 'tG1': 22}, 'Tax-Calculator Parameters': {}} comp_dict = functions.run_model(meta_param_dict, adjustment_dict) - pickle.dump(comp_dict, open('ogusa_cs_test_dict.pkl', 'wb')) + pickle.dump(comp_dict, open('ogcore_cs_test_dict.pkl', 'wb')) s = io.StringIO(comp_dict['downloadable'][0]['data']) - with open('ogusa_test_output.csv', 'w') as f: + with open('ogcore_test_output.csv', 'w') as f: for line in s: f.write(line) diff --git a/docs/README.md b/docs/README.md index a9fe99f1e..a8a3e601a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,9 +1,9 @@ -# Instructions for files in OG-USA/docs -The files in this directory `OG-USA/docs/` include images and all the files necessary for rendering the Jupyter Book documentation. One image [`OG-USA_logo_gitfig.png`](docs/OG-USA_logo_gitfig.png) is only used for the GitHub social preview image. GitHub suggests that this image should be 1280x640px for best display. The image we created [`OG-USA_logo_long.png`](docs/OG-USA_logo_long.png) is natively 2083x1334px. We do the following to resize the image. +# Instructions for files in OG-Core/docs +The files in this directory `OG-Core/docs/` include images and all the files necessary for rendering the Jupyter Book documentation. One image [`OG-Core_logo_gitfig.png`](docs/OG-Core_logo_gitfig.png) is only used for the GitHub social preview image. GitHub suggests that this image should be 1280x640px for best display. The image we created [`OG-Core_logo_long.png`](docs/OG-Core_logo_long.png) is natively 2083x1334px. We do the following to resize the image. 1. Open the image in Adobe Photoshop: **File** > **Open** 2. Open the **Image Size** dialogue: 3. Adjust the canvas size: **Image** > **Canvas Size**. Because the 2083x1334px image is taller than the optimal 1280x640px GitHub size, we first adjust the canvas size. We have to add some width. So here adjust the width to 2668px [`(1334 / 640) * 1280`] and keep the height at 1334px. 4. Adjust the image size: **Image** > **Image Size**. Now adjust the image size to the GitHub optimal 1280x640px. The dimesions will be correct and nothing will be stretched. -5. Save the image as [`OG-USA_logo_gitfig.png`](docs/OG-USA_logo_gitfig.png). -6. Upload the image [`OG-USA_logo_gitfig.png`](docs/OG-USA_logo_gitfig.png) as the GitHub social preview image by clicking on the [**Settings**](https://github.com/PSLmodels/OG-USA/settings) button in the upper-right of the main page of the repository and uploading the formatted image [`OG-USA_logo_gitfig.png`](docs/OG-USA_logo_gitfig.png) in the **Social preview** section. +5. Save the image as [`OG-Core_logo_gitfig.png`](docs/OG-Core_logo_gitfig.png). +6. Upload the image [`OG-Core_logo_gitfig.png`](docs/OG-Core_logo_gitfig.png) as the GitHub social preview image by clicking on the [**Settings**](https://github.com/PSLmodels/OG-Core/settings) button in the upper-right of the main page of the repository and uploading the formatted image [`OG-Core_logo_gitfig.png`](docs/OG-Core_logo_gitfig.png) in the **Social preview** section. diff --git a/docs/book/_config.yml b/docs/book/_config.yml index 4a1b7858e..294944c3f 100644 --- a/docs/book/_config.yml +++ b/docs/book/_config.yml @@ -1,9 +1,9 @@ #################################################### # Book settings -title : OG-USA +title : OG-Core author : Jason DeBacker and Richard W. Evans copyright : '2021' -logo : '..//OG-USA_logo.png' +logo : '..//OG-Core_logo.png' #################################################### # Execution settings @@ -40,7 +40,7 @@ launch_buttons: #################################################### # Information about where the book exists on the web repository: - url : https://github.com/PSLmodels/OG-USA + url : https://github.com/PSLmodels/OG-Core path_to_book : 'book' ####################################################################################### diff --git a/docs/book/_toc.yml b/docs/book/_toc.yml index 8e7c86855..e5d5b6a0e 100644 --- a/docs/book/_toc.yml +++ b/docs/book/_toc.yml @@ -1,10 +1,10 @@ format: jb-book root: content/intro/intro parts: -- caption: Contributing to OG-USA +- caption: Contributing to OG-Core chapters: - file: content/contributing/contributor_guide -- caption: OG-USA API +- caption: OG-Core API chapters: - file: content/api/public_api sections: @@ -26,7 +26,7 @@ parts: - file: content/api/txfunc - file: content/api/utils - file: content/api/wealth -- caption: OG-USA Theory +- caption: OG-Core Theory chapters: - file: content/theory/intro - file: content/theory/households @@ -52,6 +52,6 @@ parts: - caption: References chapters: - file: content/theory/references -- caption: Citations of OG-USA +- caption: Citations of OG-Core chapters: - file: content/citations diff --git a/docs/book/content/api/aggregates.rst b/docs/book/content/api/aggregates.rst index 51f9de37e..49e06e835 100644 --- a/docs/book/content/api/aggregates.rst +++ b/docs/book/content/api/aggregates.rst @@ -5,11 +5,11 @@ Aggregates Equations **Aggregates** -ogusa.aggregates +ogcore.aggregates ------------------------------------------ -.. currentmodule:: ogusa.aggregates +.. currentmodule:: ogcore.aggregates -.. automodule:: ogusa.aggregates +.. automodule:: ogcore.aggregates :members: get_L, get_I, get_B, get_BQ, get_C, revenue, get_r_hh, resource_constraint, get_K_splits diff --git a/docs/book/content/api/elliptical_u_est.rst b/docs/book/content/api/elliptical_u_est.rst index 6b65328a9..a45d63310 100644 --- a/docs/book/content/api/elliptical_u_est.rst +++ b/docs/book/content/api/elliptical_u_est.rst @@ -5,11 +5,11 @@ Elliptical Utility Function Estimation Functions **Elliptical Utility Estimation** -ogusa.elliptical_u_est +ogcore.elliptical_u_est ------------------------------------------ -.. currentmodule:: ogusa.elliptical_u_est +.. currentmodule:: ogcore.elliptical_u_est -.. automodule:: ogusa.elliptical_u_est +.. automodule:: ogcore.elliptical_u_est :members: CFE_u, CFE_mu, elliptical_u, elliptical_mu, sumsq, sumsq_MU, estimation diff --git a/docs/book/content/api/execute.rst b/docs/book/content/api/execute.rst index e9b7641a5..f234abf54 100644 --- a/docs/book/content/api/execute.rst +++ b/docs/book/content/api/execute.rst @@ -5,10 +5,10 @@ Model Execution Functions **Model Execution** -ogusa.execute +ogcore.execute ------------------------------------------ -.. currentmodule:: ogusa.execute +.. currentmodule:: ogcore.execute -.. automodule:: ogusa.execute +.. automodule:: ogcore.execute :members: runner diff --git a/docs/book/content/api/firm.rst b/docs/book/content/api/firm.rst index 4aae0f2b9..ee40bf4d9 100644 --- a/docs/book/content/api/firm.rst +++ b/docs/book/content/api/firm.rst @@ -5,11 +5,11 @@ Firm Equations **Firm** -ogusa.firm +ogcore.firm ------------------------------------------ -.. currentmodule:: ogusa.firm +.. currentmodule:: ogcore.firm -.. automodule:: ogusa.firm +.. automodule:: ogcore.firm :members: get_Y, get_r, get_w, get_KLratio_from_r, get_w_from_r, get_K, get_K_from_Y diff --git a/docs/book/content/api/fiscal.rst b/docs/book/content/api/fiscal.rst index ae54686e2..a78ec423b 100644 --- a/docs/book/content/api/fiscal.rst +++ b/docs/book/content/api/fiscal.rst @@ -5,10 +5,10 @@ Fiscal Functions **Government Budget Functions** -ogusa.fiscal +ogcore.fiscal ------------------------------------------ -.. currentmodule:: ogusa.fiscal +.. currentmodule:: ogcore.fiscal -.. automodule:: ogusa.fiscal +.. automodule:: ogcore.fiscal :members: D_G_path, get_D_ss, get_G_ss, get_debt_service_f, get_TR, get_r_gov diff --git a/docs/book/content/api/household.rst b/docs/book/content/api/household.rst index b2fd9bfac..579cea356 100644 --- a/docs/book/content/api/household.rst +++ b/docs/book/content/api/household.rst @@ -5,11 +5,11 @@ Household Functions **Household Functions** -ogusa.household +ogcore.household ------------------------------------------ -.. currentmodule:: ogusa.household +.. currentmodule:: ogcore.household -.. automodule:: ogusa.household +.. automodule:: ogcore.household :members: marg_ut_cons, marg_ut_labor, get_bq, get_tr, get_cons, FOC_savings, FOC_labor, get_y, constraint_checker_SS, constraint_checker_TPI diff --git a/docs/book/content/api/output_plots.rst b/docs/book/content/api/output_plots.rst index f38948b65..459f32981 100644 --- a/docs/book/content/api/output_plots.rst +++ b/docs/book/content/api/output_plots.rst @@ -1,15 +1,15 @@ .. _output_plots: -OG-USA Output Plotting Functions +OG-Core Output Plotting Functions ================================================= -**OG-USA Output Plotting Functions** +**OG-Core Output Plotting Functions** -ogusa.output_plots +ogcore.output_plots ------------------------------------------ -.. currentmodule:: ogusa.output_plots +.. currentmodule:: ogcore.output_plots -.. automodule:: ogusa.output_plots +.. automodule:: ogcore.output_plots :members: plot_aggregates, plot_gdp_ratio, ability_bar, ability_bar_ss, ss_profiles, tpi_profiles, plot_all diff --git a/docs/book/content/api/output_tables.rst b/docs/book/content/api/output_tables.rst index 46f404da4..67fff065b 100644 --- a/docs/book/content/api/output_tables.rst +++ b/docs/book/content/api/output_tables.rst @@ -1,15 +1,15 @@ .. _output_tables: -OG-USA Output Table Building Functions +OG-Core Output Table Building Functions ================================================= -**OG-USA Output Table Building Functions** +**OG-Core Output Table Building Functions** -ogusa.output_tables +ogcore.output_tables ------------------------------------------ -.. currentmodule:: ogusa.output_tables +.. currentmodule:: ogcore.output_tables -.. automodule:: ogusa.output_tables +.. automodule:: ogcore.output_tables :members: macro_table, macro_table_SS, ineq_table, gini_table, wealth_moments_table, tp_output_dump_table, dynamic_revenue_decomposition diff --git a/docs/book/content/api/parameter_plots.rst b/docs/book/content/api/parameter_plots.rst index 0def4fbfb..907bf988d 100644 --- a/docs/book/content/api/parameter_plots.rst +++ b/docs/book/content/api/parameter_plots.rst @@ -1,16 +1,16 @@ .. _parameter_plots: -OG-USA Parameter Plotting Functions +OG-Core Parameter Plotting Functions ================================================= -**OG-USA Parameter Plotting Functions** +**OG-Core Parameter Plotting Functions** -ogusa.parameter_plots +ogcore.parameter_plots ------------------------------------------ -.. currentmodule:: ogusa.parameter_plots +.. currentmodule:: ogcore.parameter_plots -.. automodule:: ogusa.parameter_plots +.. automodule:: ogcore.parameter_plots :members: plot_imm_rates, plot_mort_rates, plot_pop_growth, plot_ability_profiles, plot_elliptical_u, plot_chi_n, plot_fert_rates, plot_mort_rates_data, plot_omega_fixed, diff --git a/docs/book/content/api/parameter_tables.rst b/docs/book/content/api/parameter_tables.rst index 36fa51329..2a907e80d 100644 --- a/docs/book/content/api/parameter_tables.rst +++ b/docs/book/content/api/parameter_tables.rst @@ -1,14 +1,14 @@ .. _parameter_tables: -OG-USA Parameter Table Building Functions +OG-Core Parameter Table Building Functions ================================================= -**OG-USA Parameter Table Building Functions** +**OG-Core Parameter Table Building Functions** -ogusa.parameter_tables +ogcore.parameter_tables ------------------------------------------ -.. currentmodule:: ogusa.parameter_tables +.. currentmodule:: ogcore.parameter_tables -.. automodule:: ogusa.parameter_tables +.. automodule:: ogcore.parameter_tables :members: tax_rate_table, param_table diff --git a/docs/book/content/api/parameters.rst b/docs/book/content/api/parameters.rst index f3cdff19a..e0280f08b 100644 --- a/docs/book/content/api/parameters.rst +++ b/docs/book/content/api/parameters.rst @@ -1,16 +1,16 @@ .. _parameters: -OG-USA Parameters +OG-Core Parameters ================================================= -**OG-USA Parameters** +**OG-Core Parameters** -ogusa.parameters +ogcore.parameters ------------------------------------------ -.. currentmodule:: ogusa.parameters +.. currentmodule:: ogcore.parameters -.. automodule:: ogusa.parameters +.. automodule:: ogcore.parameters :members: reform_warnings_errors .. autoclass:: Specifications diff --git a/docs/book/content/api/public_api.rst b/docs/book/content/api/public_api.rst index b3ab60784..0843b9aaf 100644 --- a/docs/book/content/api/public_api.rst +++ b/docs/book/content/api/public_api.rst @@ -1,10 +1,10 @@ API ========================= -The source code for `OG-USA` is located in the OG-USA/ogusa directory tree. +The source code for `OG-Core` is located in the OG-Core/ogcore directory tree. -Here we provide a high-level view of the API of the `OG-USA` model, with links +Here we provide a high-level view of the API of the `OG-Core` model, with links to the source code. This high-level view is organized around the modules that -make up the `OG-USA` model. Below is a list of these modules (in alphabetical +make up the `OG-Core` model. Below is a list of these modules (in alphabetical order) with documentation about how to call each class method and function. There is also a link to the source code for each documented member. diff --git a/docs/book/content/api/tax.rst b/docs/book/content/api/tax.rst index fa582d223..23f897905 100644 --- a/docs/book/content/api/tax.rst +++ b/docs/book/content/api/tax.rst @@ -5,12 +5,12 @@ Tax Functions **Tax Functions** -ogusa.tax +ogcore.tax ------------------------------------------ -.. currentmodule:: ogusa.tax +.. currentmodule:: ogcore.tax -.. automodule:: ogusa.tax +.. automodule:: ogcore.tax :members: replacement_rate_vals, ETR_wealth, MTR_wealth, ETR_income, MTR_income, get_biz_tax, net_taxes, income_tax_liab, pension_amount, wealth_tax_liab, bequest_tax_liab diff --git a/docs/book/content/api/txfunc.rst b/docs/book/content/api/txfunc.rst index d07974638..639faa29b 100644 --- a/docs/book/content/api/txfunc.rst +++ b/docs/book/content/api/txfunc.rst @@ -5,12 +5,12 @@ Tax Function Estimation Functions **Tax Function Estimation Functions** -ogusa.txfunc +ogcore.txfunc ------------------------------------------ -.. currentmodule:: ogusa.txfunc +.. currentmodule:: ogcore.txfunc -.. automodule:: ogusa.txfunc +.. automodule:: ogcore.txfunc :members: gen_3Dscatters_hist, plot_txfunc_v_data, get_tax_rates, wsumsq, find_outliers, replace_outliers, txfunc_est, tax_func_loop, tax_func_estimate diff --git a/docs/book/content/api/utils.rst b/docs/book/content/api/utils.rst index cb93430c8..87d831d87 100644 --- a/docs/book/content/api/utils.rst +++ b/docs/book/content/api/utils.rst @@ -5,15 +5,15 @@ Utilities Functions **Utilities Functions** -ogusa.utils +ogcore.utils ------------------------------------------ -.. currentmodule:: ogusa.utils +.. currentmodule:: ogcore.utils .. autoclass:: Inequality :members: gini, var_of_logs, ratio_pct1_pct2, topshare -.. automodule:: ogusa.utils +.. automodule:: ogcore.utils :members: mkdirs, pct_diff_func, convex_combo, read_file, pickle_file_compare, comp_array, comp_scalar, dict_compare, to_timepath_shape, get_initial_path, safe_read_pickle, rate_conversion, save_return_table, Inequality, diff --git a/docs/book/content/api/wealth.rst b/docs/book/content/api/wealth.rst index 9ec68b12b..732ad3423 100644 --- a/docs/book/content/api/wealth.rst +++ b/docs/book/content/api/wealth.rst @@ -5,10 +5,10 @@ Wealth Functions **Wealth** -ogusa.wealth +ogcore.wealth ------------------------------------------ -.. currentmodule:: ogusa.wealth +.. currentmodule:: ogcore.wealth -.. automodule:: ogusa.wealth +.. automodule:: ogcore.wealth :members: get_wealth_data, compute_wealth_moments diff --git a/docs/book/content/calibration/UBI.md b/docs/book/content/calibration/UBI.md index 6e1a16b9f..8fb02de6d 100644 --- a/docs/book/content/calibration/UBI.md +++ b/docs/book/content/calibration/UBI.md @@ -3,15 +3,15 @@ [TODO: This section is far along but needs to be updated.] -We have included the modeling of a universal basic income (UBI) policy directly in the theory and code for `OG-USA`. We calculate the time series of a UBI matrix $ubi_{j,s,t}$ representing the UBI transfer to every household with head of household age $s$, lifetime income group $j$, in period $t$. We calculate the time series of this matrix from five parameters and some household composition data that we impose upon the existing demographics of `OG-USA`. +We have included the modeling of a universal basic income (UBI) policy directly in the theory and code for `OG-Core`. We calculate the time series of a UBI matrix $ubi_{j,s,t}$ representing the UBI transfer to every household with head of household age $s$, lifetime income group $j$, in period $t$. We calculate the time series of this matrix from five parameters and some household composition data that we impose upon the existing demographics of `OG-Core`. (SecUBIcalc)= ## Calculating UBI - We calculate the time series of UBI household transfers in model units $ubi_{j,s,t)}$ and the time series of total UBI expenditures in model units $UBI_t$ from five parameters described in the `OG-USA` API (`ubi_growthadj`, `ubi_nom_017`, `ubi_nom_1820`, `ubi_nom_2164`, `ubi_nom_65p`, and `ubi_nom_max`) interfaced with the `OG-USA` demographic dynamics over lifetime income groups $j$ and ages $s$, and multiplied by household composition matrices from the [OG-USA-calibration](https://github.com/PSLmodels/OG-USA-Calibration) repository. + We calculate the time series of UBI household transfers in model units $ubi_{j,s,t)}$ and the time series of total UBI expenditures in model units $UBI_t$ from five parameters described in the `OG-Core` API (`ubi_growthadj`, `ubi_nom_017`, `ubi_nom_1820`, `ubi_nom_2164`, `ubi_nom_65p`, and `ubi_nom_max`) interfaced with the `OG-Core` demographic dynamics over lifetime income groups $j$ and ages $s$, and multiplied by household composition matrices from the [OG-Core-calibration](https://github.com/PSLmodels/OG-Core-Calibration) repository. - From the [OG-USA-calibration](https://github.com/PSLmodels/OG-USA-Calibration) repository, we have four $S\times J$ matrices `ubi_num_017_mat`$_{j,s}$, `ubi_num_1820_mat`$_{j,s}$, `ubi_num_2164_mat`$_{j,s}$, and `ubi_num_65p_mat`$_{j,s}$ representing the number of children under age 0-17, number of adults ages 18-20, the number of adults between ages 21 and 64, and the number of seniors age 65 and over, respectively, by lifetime ability group $j$ and age $s$ of head of household. Because our demographic age data match up well with head-of-household data from other datasets, we do not have to adjust the values in these matrices.[^HOH_age_dist_note] + From the [OG-Core-calibration](https://github.com/PSLmodels/OG-Core-Calibration) repository, we have four $S\times J$ matrices `ubi_num_017_mat`$_{j,s}$, `ubi_num_1820_mat`$_{j,s}$, `ubi_num_2164_mat`$_{j,s}$, and `ubi_num_65p_mat`$_{j,s}$ representing the number of children under age 0-17, number of adults ages 18-20, the number of adults between ages 21 and 64, and the number of seniors age 65 and over, respectively, by lifetime ability group $j$ and age $s$ of head of household. Because our demographic age data match up well with head-of-household data from other datasets, we do not have to adjust the values in these matrices.[^HOH_age_dist_note] Now we can solve for the dollar-valued (as opposed to model-unit-valued) UBI transfer to each household in the first period $ubi^{\$}_{j,s,t=0}$ in the following way. Let the parameter `ubi_nom_017` be the dollar value of the UBI transfer to each household per dependent child age 17 and under. Let the parameter `ubi_nom_1820` be the dollar value of the UBI transfer to each household per dependent child between the ages of 18 and 20. Let `ubi_nom_2164` and `ubi_nom_65p` be the dollar value of UBI transfer to each household per adult between ages 21 and 64 and per senior 65 and over, respectively. And let `ubi_nom_max` be the maximum UBI benefit per household. @@ -58,6 +58,6 @@ We have included the modeling of a universal basic income (UBI) policy directly (SecUBIfootnotes)= ## Footnotes -[^HOH_age_dist_note]: DeBacker and Evans compared the `OG-USA` age demographics $\hat{\omega}_{s,t}$ with the respective age demographics in Tax Policy Center's microsimulation model and in [Tax-Calculator](https://github.com/PSLmodels/Tax-Calculator)'s microsimulation model. The latter two microsimulation models' age demographics are based on head of household tax filer age distributions, whereas `OG-USA`'s demographics are based on the population age distribution. +[^HOH_age_dist_note]: DeBacker and Evans compared the `OG-Core` age demographics $\hat{\omega}_{s,t}$ with the respective age demographics in Tax Policy Center's microsimulation model and in [Tax-Calculator](https://github.com/PSLmodels/Tax-Calculator)'s microsimulation model. The latter two microsimulation models' age demographics are based on head of household tax filer age distributions, whereas `OG-Core`'s demographics are based on the population age distribution. -[^GrowthAdj_note]: We impose this requirement of `ubi_growthadj = False` when `g_y_annual < 0` in the [`default_parameters.json`](https://github.com/PSLmodels/OG-USA/blob/master/ogusa/default_parameters.json) "validators" specification of the parameter. +[^GrowthAdj_note]: We impose this requirement of `ubi_growthadj = False` when `g_y_annual < 0` in the [`default_parameters.json`](https://github.com/PSLmodels/OG-Core/blob/master/ogcore/default_parameters.json) "validators" specification of the parameter. diff --git a/docs/book/content/calibration/demographics.md b/docs/book/content/calibration/demographics.md index cc3ec30b5..20ee80d22 100644 --- a/docs/book/content/calibration/demographics.md +++ b/docs/book/content/calibration/demographics.md @@ -8,7 +8,7 @@ jupytext: kernelspec: display_name: Python 3 language: python - name: ogusa-dev + name: ogcore-dev --- (glue)= @@ -16,9 +16,9 @@ kernelspec: (Chap_Demog)= # Demographics -We start the `OG-USA` section on modeling the household with a description of the demographics of the model. {cite}`Nishiyama:2015` and {cite}`DeBackerEtAl:2019` have recently shown that demographic dynamics are likely the biggest influence on macroeconomic time series, exhibiting more influence than fiscal variables or household preference parameters. +We start the `OG-Core` section on modeling the household with a description of the demographics of the model. {cite}`Nishiyama:2015` and {cite}`DeBackerEtAl:2019` have recently shown that demographic dynamics are likely the biggest influence on macroeconomic time series, exhibiting more influence than fiscal variables or household preference parameters. -In this chapter, we characterize the equations and parameters that govern the transition dynamics of the population distribution by age. In `OG-USA`, we take the approach of taking mortality rates and fertility rates from outside estimates. But we estimate our immigration rates as residuals using the mortality rates, fertility rates, and at least two consecutive periods of population distribution data. This approach makes sense if one modeling a country in which in one is not confident in the immigration rate data. If the country has good immigration data, then the immigration residual approach we describe below can be skipped. +In this chapter, we characterize the equations and parameters that govern the transition dynamics of the population distribution by age. In `OG-Core`, we take the approach of taking mortality rates and fertility rates from outside estimates. But we estimate our immigration rates as residuals using the mortality rates, fertility rates, and at least two consecutive periods of population distribution data. This approach makes sense if one modeling a country in which in one is not confident in the immigration rate data. If the country has good immigration data, then the immigration residual approach we describe below can be skipped. We define $\omega_{s,t}$ as the number of households of age $s$ alive at time $t$. A measure $\omega_{1,t}$ of households is born in each period $t$ and live for up to $E+S$ periods, with $S\geq 4$.[^calibage_note] Households are termed ``youth'', and do not participate in market activity during ages $1\leq s\leq E$. The households enter the workforce and economy in period $E+1$ and remain in the workforce until they unexpectedly die or live until age $s=E+S$. We model the population with households age $s\leq E$ outside of the workforce and economy in order most closely match the empirical population dynamics. @@ -56,7 +56,7 @@ We discuss the approach to estimating fertility rates $f_s$, mortality rates $\r (SecDemogFert)= ## Fertility rates - In `OG-USA`, we assume that the fertility rates for each age cohort $f_s$ are constant across time. However, this assumption is conceptually straightforward to relax. Our data for U.S. fertility rates by age come from {cite}`MartinEtAl:2015` National Vital Statistics Report, which is final fertility rate data for 2013. Figure {numref}`FigFertRates` shows the fertility-rate data and the estimated average fertility rates for $E+S=100$. + In `OG-Core`, we assume that the fertility rates for each age cohort $f_s$ are constant across time. However, this assumption is conceptually straightforward to relax. Our data for U.S. fertility rates by age come from {cite}`MartinEtAl:2015` National Vital Statistics Report, which is final fertility rate data for 2013. Figure {numref}`FigFertRates` shows the fertility-rate data and the estimated average fertility rates for $E+S=100$. ```{figure} ../theory/images/fert_rates.png --- @@ -84,11 +84,11 @@ We discuss the approach to estimating fertility rates $f_s$, mortality rates $\r ``` ## Income at the very top -In addition to lifecycle profiles of the seven percentile groups above, `OG-USA` has calibrations of income at the very top. This includes breaking out percentiles at fine as the top 0.01% of earners. The two alternative $\lambda$ vectors are $\lambda_{j}=[0.25, 0.25, 0.2, 0.1, 0.1, 0.09, 0.005, 0.004, 0.001]$ and $\lambda_{j}=[0.25, 0.25, 0.2, 0.1, 0.1, 0.09, 0.005, 0.004, 0.0009, 0.0001]$. +In addition to lifecycle profiles of the seven percentile groups above, `OG-Core` has calibrations of income at the very top. This includes breaking out percentiles at fine as the top 0.01% of earners. The two alternative $\lambda$ vectors are $\lambda_{j}=[0.25, 0.25, 0.2, 0.1, 0.1, 0.09, 0.005, 0.004, 0.001]$ and $\lambda_{j}=[0.25, 0.25, 0.2, 0.1, 0.1, 0.09, 0.005, 0.004, 0.0009, 0.0001]$. Because we do not have panel data that allow us to observe such top percentile groups, we make the following assumptions in calibrating income at the very top. First, we assume the shape of the lifecycle profile of these top earners is the same as the top 1% overall. Second, we 2018 estimates from the methodology of {cite}`PikettySaez:2003` to provide factors to scale earnings process we estimate for groups inside the top 1%.[^PS_note] diff --git a/docs/book/content/calibration/exogenous_parameters.md b/docs/book/content/calibration/exogenous_parameters.md index af1f87b1b..d49ec6059 100644 --- a/docs/book/content/calibration/exogenous_parameters.md +++ b/docs/book/content/calibration/exogenous_parameters.md @@ -8,7 +8,7 @@ jupytext: kernelspec: display_name: Python 3 language: python - name: ogusa-dev + name: ogcore-dev --- (glue)= @@ -17,14 +17,14 @@ kernelspec: [TODO: This chapter needs heavy updating. Would be nice to do something similar to API chapter. But it is also nice to have references and descriptions as in the table below.] - In this chapter, list the exogenous inputs to the model, options, and where the values come from (weak calibration vs. strong calibration). Point to the respective chapters for some of the inputs. Mention the code in [`default_parameters.json`](https://github.com/PSLmodels/OG-USA/blob/master/ogusa/default_parameters.json) and [`parameters.py`](https://github.com/PSLmodels/OG-USA/blob/master/ogusa/parameters.py). + In this chapter, list the exogenous inputs to the model, options, and where the values come from (weak calibration vs. strong calibration). Point to the respective chapters for some of the inputs. Mention the code in [`default_parameters.json`](https://github.com/PSLmodels/OG-Core/blob/master/ogcore/default_parameters.json) and [`parameters.py`](https://github.com/PSLmodels/OG-Core/blob/master/ogcore/parameters.py).