diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ab9609de..0c37fbd6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.11.10] - 2024-06-17 01:00:00 + +### Added + +- Add HSV to list of valid tax functions in `default_parameters.json` + + ## [0.11.9] - 2024-06-12 01:00:00 ### Added @@ -246,6 +253,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Any earlier versions of OG-USA can be found in the [`OG-Core`](https://github.com/PSLmodels/OG-Core) repository [release history](https://github.com/PSLmodels/OG-Core/releases) from [v.0.6.4](https://github.com/PSLmodels/OG-Core/releases/tag/v0.6.4) (Jul. 20, 2021) or earlier. +[0.11.10]: https://github.com/PSLmodels/OG-Core/compare/v0.11.9...v0.11.10 [0.11.9]: https://github.com/PSLmodels/OG-Core/compare/v0.11.8...v0.11.9 [0.11.8]: https://github.com/PSLmodels/OG-Core/compare/v0.11.7...v0.11.8 [0.11.7]: https://github.com/PSLmodels/OG-Core/compare/v0.11.6...v0.11.7 diff --git a/docs/book/citations.bib b/docs/book/citations.bib index a748f5111..67c348bd9 100644 --- a/docs/book/citations.bib +++ b/docs/book/citations.bib @@ -7,21 +7,6 @@ @TECHREPORT{DeBackerEtAl:2017b month = {January}, } -@Article{DEP:2019, - author={Jason DeBacker and Richard W. Evans and Kerk L. Phillips}, - title={{Integrating Microsimulation Models of Tax Policy into a {DGE} Macroeconomic Model}}, - journal={Public Finance Review}, - year=2019, - volume={47}, - number={2}, - pages={207-275}, - month={March}, - keywords={microsimulation; effective tax rates; marginal tax rates; dynamic general equilibrium; dynamic scori}, - doi={}, - abstract={This article proposes a method for integrating individual effective tax rates and marginal tax rates computed from a microsimulation (partial equilibrium) model of tax policy with a dynamic general equilibrium model of tax policy that can provide macroeconomic analysis or dynamic scores of tax reforms. Our approach captures the rich heterogeneity, realistic demographics, and tax-code detail of the microsimulation model and allows this detail to inform a general equilibrium model with a relatively high degree of heterogeneity. In addition, we propose a functional form in which tax rates depend jointly on the levels of both capital income and labor income.}, - url={https://ideas.repec.org/a/sae/pubfin/v47y2019i2p207-275.html} -} - @TECHREPORT{Pomerleau2020b, AUTHOR = {Kyle Pomerleau}, TITLE = {An analysis of {J}oe {B}iden’s tax proposals, {O}ctober 2020 update}, diff --git a/docs/book/content/api/firm.rst b/docs/book/content/api/firm.rst index d55ae5e3e..6e53091ef 100644 --- a/docs/book/content/api/firm.rst +++ b/docs/book/content/api/firm.rst @@ -9,6 +9,6 @@ ogcore.firm ------------------------------------------ .. automodule:: ogcore.firm - :members: get_Y, get_r, get_w, get_KLratio_old, get_KLratio, get_MPx, - get_w_from_r, get_K, get_K_from_Y, get_L_from_Y, - get_K_from_Y_and_L, get_K_new, get_pm, solve_L, get_cost_of_capital + :members: get_Y, get_r, get_w, get_KLratio, get_MPx, + get_w_from_r, get_K, get_L_from_Y, + get_pm, solve_L, get_cost_of_capital diff --git a/docs/book/content/api/household.rst b/docs/book/content/api/household.rst index 57980dc33..26a6b24a0 100644 --- a/docs/book/content/api/household.rst +++ b/docs/book/content/api/household.rst @@ -9,6 +9,6 @@ ogcore.household ------------------------------------------ .. automodule:: ogcore.household - :members: marg_ut_cons, marg_ut_labor, get_bq, get_tr, get_cons, get_cm, + :members: marg_ut_cons, marg_ut_labor, get_bq, get_tr, get_cons, get_ci, FOC_savings, FOC_labor, get_y, constraint_checker_SS, constraint_checker_TPI diff --git a/docs/book/content/api/utils.rst b/docs/book/content/api/utils.rst index ce0f0c14c..2507dec81 100644 --- a/docs/book/content/api/utils.rst +++ b/docs/book/content/api/utils.rst @@ -11,7 +11,7 @@ ogcore.utils .. currentmodule:: ogcore.utils .. autoclass:: Inequality - :members: gini, var_of_logs, ratio_pct1_pct2, pct, topshare + :members: gini, var_of_logs, ratio_pct1_pct2, pct, top_share .. autoclass:: CustomHttpAdapter :members: init_poolmanager diff --git a/docs/book/content/contributing/contributor_guide.md b/docs/book/content/contributing/contributor_guide.md index 2cff18654..022b7e2c9 100644 --- a/docs/book/content/contributing/contributor_guide.md +++ b/docs/book/content/contributing/contributor_guide.md @@ -29,7 +29,7 @@ If you have already completed the {ref}`Sec_SetupPython` and {ref}`Sec_SetupGit` 6. Create a local repo by entering at the command line the text after the $.[^commandline_note] This step creates a directory called `OG-Core` in the directory that you specified in the prior step: - ``` + ```console git clone https://github.com/[github-username]/OG-Core.git ``` @@ -37,7 +37,7 @@ If you have already completed the {ref}`Sec_SetupPython` and {ref}`Sec_SetupGit` 8. Make it easier to [push](https://help.github.com/articles/github-glossary/#pull) your local work to others and [pull](https://help.github.com/articles/github-glossary/#pull) others' work to your local machine by entering at the command line: - ``` + ```console $ cd OG-Core OG-Core$ git remote add upstream https://github.com/PSLmodels/OG-Core.git ``` @@ -45,20 +45,20 @@ If you have already completed the {ref}`Sec_SetupPython` and {ref}`Sec_SetupGit` 9. Create a conda environment with all of the necessary packages to execute the source code: - ``` + ```console OG-Core$ conda env create ``` 10. The prior command will create a conda environment called `ogcore-dev`. Activate this environment as follows: - ``` + ```console OG-Core$ conda activate ogcore-dev ``` 11. To make sure that the `ogcore` Python package from the `OG-Core` repository is installed and operational in your `ogcore-dev` conda environment, type the following command at your command prompt. - ``` + ```console OG-Core$ pip install -e . ``` @@ -75,7 +75,6 @@ Don't be alarmed if the above paragraph is confusing. The following section introduces some standard Git practices and guides you through the contribution process. - (Sec_Workflow)= ## Workflow @@ -84,7 +83,6 @@ the contribution process. GitHub "issues" are an excellent way to ask questions, include code examples, and tag specific GitHub users. - (Sec_GitHubPR)= ### Submitting a GitHub Pull Request @@ -100,60 +98,75 @@ situations, in which case other contributors are here to help. Navigate to your local `OG-Core` directory and enter the following text at the command line: - ``` + ```console OG-Core$ git checkout master ``` b. Download all of the content from the central `OG-Core` repo: - ``` + + ```console OG-Core$ git fetch upstream ``` + c. Update your local master branch to contain the latest content of the central master branch using [merge](https://help.github.com/articles/github-glossary/#merge). This step ensures that you are working with the latest version of `OG-Core`: - ``` + + ```console OG-Core$ git merge upstream/master ``` + d. Push the updated master branch in your local repo to your GitHub repo: - ``` + + ```console OG-Core$ git push origin master ``` + 2. Create a new [branch](https://help.github.com/articles/github-glossary/#branch) on your local machine. Think of your branches as a way to organize your projects. If you want to work on this documentation, for example, create a separate branch for that work. If you want to change an element of the `OG-Core` model, create a different branch for that project: - ``` + + ```console OG-Core$ git checkout -b [new-branch-name] ``` + 3. As you make changes, frequently check that your changes do not introduce bugs or degrade the accuracy of the `OG-Core`. To do this, run the following command from the command line from inside the `OG-Core/ogcore` directory: - ``` + + ```console OG-Core/ogcore$ pytest ``` + Note that running this full suite of tests may take more than 6 hours (depending on your hardware). To run the subset of tests that run on each pull request (and take about 40 minutes), use `pytest -m "not local"`. If the tests do not pass, try to fix the issue by using the information provided by the error message. If this isn't possible or doesn't work, the core maintainers are here to help via a [GitHub Issue](https://github.com/PSLmodels/OG-Core/issues). 4. Now you're ready to [commit](https://help.github.com/articles/github-glossary/#commit) your changes to your local repo using the code below. The first line of code tells `Git` to track a file. Use the `git status` command to find all the files you have edited, and `git add` command to add each of the files that you would like `Git` to track. As a rule, do not add large files. If you'd like to add a file that is larger than 25 MB, please contact the other contributors and ask how to proceed. The second line of code commits your changes to your local repo and allows you to create a commit message. This should be a short description of your changes. *Tip*: Committing often is a good idea as `Git` keeps a record of your changes. This means that you can always revert to a previous version of your work if you need to. Do this to commit: - ``` + + ```console OG-Core$ git add [filename] OG-Core$ git commit -m "[description-of-your-commit]" ``` 5. Periodically, make sure that the branch you created in step 2 is in sync with the changes other contributors are making to the central master branch by fetching upstream and merging upstream/master into your branch: - ``` + + ```console OG-Core$ git fetch upstream OG-Core$ git merge upstream/master ``` + You may need to resolve conflicts that arise when another contributor changed the same section of code that you are changing. Feel free to ask other contributors for guidance if this happens to you. If you do need to fix a merge conflict, re-run the test suite afterwards (step 4.) 6. When you are ready for other team members to review your code, make your final commit and push your local branch to your remote repo: - ``` + + ```console OG-Core$ git push origin [new-branch-name] ``` + 7. From the GitHub.com user interface, [open a pull request](https://help.github.com/articles/creating-a-pull-request/#creating-the-pull-request). 8. When you open a GitHub pull request, a code coverage report will be automatically generated. If your branch adds new code that is not tested, the code coverage percent will decline and the number of untested statements ("misses" in the report) will increase. If this happens, you need to add to your branch one or more tests of your newly added code. Add tests so that the number of untested statements is the same as it is on the master branch. @@ -166,13 +179,13 @@ situations, in which case other contributors are here to help. 1. Navigate to your local `OG-Core` repository in the terminal of your local machine and activate the `ogcore-dev` conda environment. If you have not created the `ogcore-dev` conda environment, follow steps 1-11 in Section {ref}`Sec_SetupGit` above. - ``` + ```console OG-Core$ conda activate ogcore-dev ``` 2. Run the Python example script [`OG-Core/run_examples/run_ogcore_example.py`](https://github.com/PSLmodels/OG-Core/blob/master/run_examples/run_ogcore_example.py) by entering the following command in your terminal in your local machine `OG-Core` repository with the `ogcore-dev` conda environment activated. - ``` + ```console (ogcore-dev) OG-Core$ python ./run_examples/run_ogcore_example.py ``` diff --git a/docs/book/content/theory/demographics.md b/docs/book/content/theory/demographics.md index a3efd915f..6c001c4fd 100644 --- a/docs/book/content/theory/demographics.md +++ b/docs/book/content/theory/demographics.md @@ -11,7 +11,6 @@ kernelspec: name: ogcore-dev --- -(glue)= (Chap_Demog)= # Demographics diff --git a/docs/book/content/theory/equilibrium.md b/docs/book/content/theory/equilibrium.md index f09adf093..eab221cc1 100644 --- a/docs/book/content/theory/equilibrium.md +++ b/docs/book/content/theory/equilibrium.md @@ -90,7 +90,7 @@ The computational algorithm for solving for the steady-state follows the steps b :label: EqSS_HHeul_bS (\bar{c}_{j,E+S})^{-\sigma} = e^{-\sigma g_y}\chi^b_j(\bar{b}_{j,E+S+1})^{-\sigma} \quad\forall j ``` - 6. Determine from the quantity of the composite consumption good consumed by each household, $\bar{c}_{j,s}$, use equation {eq}`EqHH_cmDem` to determine consumption of each output good, $\bar{c}_{m,j,s}$ + 6. Determine from the quantity of the composite consumption good consumed by each household, $\bar{c}_{j,s}$, use equation {eq}`EqStnrz_cmDem2` to determine consumption of each output good, $\bar{c}_{m,j,s}$ 7. Using $\bar{c}_{m,j,s}$ in {eq}`EqCmt`, solve for aggregate consumption of each output good, $\bar{C}_{m}$ 8. Given values for $\bar{n}_{j,s}$ and $\bar{b}_{j,s+1}$ for all $j$ and $s$, solve for steady-state labor supply, $\bar{L}$, savings, $\bar{B}$ 1. Use $\bar{n}_{j,s}$ and the steady-state version of the stationarized labor market clearing equation {eq}`EqStnrzMarkClrLab` to get a value for $\bar{L}^{i}$. @@ -196,7 +196,7 @@ Under alternative model configurations, the solution algorithm changes slightly. (SecSSeqlbResults)= ### Steady-state results: default specification - [TODO: Update the results in this section.] In this section, we use the baseline calibration described in Chapter {ref}`Chap_Calibr`, which includes the baseline tax law from `Tax-Calculator`, to show some steady-state results from `OG-Core`. Figures {numref}`FigSSeqlbHHcons`, {numref}`FigSSeqlbHHlab`, and {numref}`FigSSeqlbHHsave` show the household steady-state variables by age $s$ and lifetime income group $j$. + [TODO: Update the results in this section.] In this section, we use the baseline calibration described in Chapter {ref}`Chap_Calib`, which includes the baseline tax law from `Tax-Calculator`, to show some steady-state results from `OG-Core`. Figures {numref}`FigSSeqlbHHcons`, {numref}`FigSSeqlbHHlab`, and {numref}`FigSSeqlbHHsave` show the household steady-state variables by age $s$ and lifetime income group $j$. ```{figure} ./images/HHcons_SS.png --- @@ -328,7 +328,7 @@ The stationary non-steady state (transition path) solution algorithm has followi 2. From price of consumption goods, determine the price of the composite consmpution good, $\bar{p}$ using equation {eq}`EqCompPnorm2` 3. The household problem can be solved with a multivariate root finder solving the $2S$ equations and unknowns at once for each $j$ and $1\leq t\leq T+S-1$. The root finder uses $2S$ household Euler equations {eq}`EqStnrz_eul_n`, {eq}`EqStnrz_eul_b`, and {eq}`EqStnrz_eul_bS` to solve for each household's $2S$ lifetime decisions. The household decision rules for each type and birth cohort are solved separately. 4. After solving the first iteration of time path iteration, subsequent initial values for the $J$, $2S$ root finding problems are based on the solution in the prior iteration. This speeds up computation further and makes the initial guess for the highly nonlinear system of equations start closer to the solution value. -7. Determine from the quantity of the composite consumption good consumed by each household, $\hat{c}_{j,s,t}$, use equation {eq}`EqHH_cmDem` to determine consumption of each output good, $\hat{c}_{m,j,s,t}$ +7. Determine from the quantity of the composite consumption good consumed by each household, $\hat{c}_{j,s,t}$, use equation {eq}`EqStnrz_cmDem2` to determine consumption of each output good, $\hat{c}_{m,j,s,t}$ 8. Using $\hat{c}_{m,j,s,t}$ in {eq}`EqCmt`, solve for aggregate consumption of each output good, $\hat{C}_{m,t}$ 9. Given values for $n_{j,s,t}$ and $\hat{b}_{j,s+1,t+1}$ for all $j$, $s$, and $t$, solve for aggregate labor supply, $\hat{L}_t$, and savings, $B_t$ in each period 1. Use $n_{j,s,t}$ and the stationarized labor market clearing equation {eq}`EqStnrzMarkClrLab` to get a value for $\hat{L}_t^{i}$. @@ -345,17 +345,20 @@ The stationary non-steady state (transition path) solution algorithm has followi 2. The capital-output ratio can be determined from the FOC for the firms' choice of capital: $\frac{\hat{K}_{m,t}}{\hat{Y}_{m,t}} = \gamma_m\left[\frac{r_t + \delta_{M,t} - \tau^{corp}_{m,t}\delta^{\tau}_{m,t} - \tau^{inv}_{m,t}\delta_{M,t}}{(1-\tau^{corp}_{m,t})p_{m,t}({Z}_{m,t})^\frac{\varepsilon_m -1}{\varepsilon_m}}\right]^{-\varepsilon_m}$ 3. Capital demand can thus be found: $\hat{K}_{m,t} = \frac{\hat{K}_{m,t}}{\hat{Y}_{m,t}} * \hat{Y}_{m,t}$ 4. Labor demand can be found by inverting the production function: + ```{math} :label: EqTPI_solveL \hat{L}_{m,t} = \left(\frac{\left(\frac{\hat{Y}_{m,t}}{Z_{m,t}}\right)^{\frac{\varepsilon_m-1}{\varepsilon_m}} - \gamma_{m}^{\frac{1}{\varepsilon_m}}\hat{K}_{m,t}^{\frac{\varepsilon_m-1}{\varepsilon_m}} - \gamma_{g,m}^{\frac{1}{\varepsilon_m}}\hat{K}_{g,m,t}^{\frac{\varepsilon_m-1}{\varepsilon_m}}}{(1-\gamma_m-\gamma_{g,m})^{\frac{1}{\varepsilon_m}}}\right)^{\frac{\varepsilon_m}{\varepsilon_m-1}} ``` + 5. Use the interest rate $r_t^*$ and labor demand $\hat{L}_{m,t}$ to solve for private capital demand at the world interest rate $\hat{K}_{m,t}^{r^*}$ using {eq}`EqFirmsMPKg_opt` + ```{math} :label: EqTP_MPKg \hat{K}_{m,t}^{r^*} = \hat{L}_{m,t}\left(\frac{\hat{w}_t}{\frac{r_t + \delta_{M,t} - \tau^{corp}_{m,t}\delta^{\tau}_{m,t} - \tau^{inv}_{m,t}\delta_{M,t}}{1 - \bar{\tau}_{m,t}^b}}\right)^{\varepsilon_m} \frac{\gamma_m}{(1 - \gamma_m - \gamma_{g,m})} ``` -18. Determine factor demands and output for industry $M$: +18. Determine factor demands and output for industry $M$: 1. $\hat{L}_{M,t} = \hat{L}_t - \sum_{m=1}^{M-1}\hat{L}_{m,t}$ 2. Find $\hat{K}_{m,t}^{r^*}$ using {eq}`EqFirmsMPKg_opt` 3. Find total capital supply, and the split between that from domestic and foreign households: $\hat{K}_t^{i'}$, $\hat{K}_t^d$, $\hat{K}_t^f$: @@ -385,7 +388,7 @@ The stationary non-steady state (transition path) solution algorithm has followi 5. $error_{bq} = max\left\{\frac{\hat{BQ}_{t}^{\,i'} - \hat{BQ}_{t}^{\,i}}{\hat{BQ}_{t}^{\,i}}\right\}_{t=0}^{T}$ 6. $error_{tr} = \left\{\frac{\hat{TR}_{t}^{\,i'} - \hat{TR}_{t}^{\,i}}{\hat{TR}_{t}^{\,i}}\right\}_{t=0}^{T}$ -23. If the maximum absolute error among the four outer loop error terms is greater than some small positive tolerance $toler_{tpi,out}$, $\max\big|\left(error_{r_p}, error_r, error_w, error_p, error_{bq},error_{tr}\right)\bigr| > toler_{tpi,out}$, then update the guesses for the outer loop variables as a convex combination governed by $\xi_{tpi}\in(0,1]$ of the respective initial guesses and the new implied values and repeat steps (3) through (5). +23. If the maximum absolute error among the four outer loop error terms is greater than some small positive tolerance $toler_{tpi,out}$, $\max\big|\left(error_{r_p}, error_r, error_w, error_p, error_{bq},error_{tr}\right)\bigr| > toler_{tpi,out}$, then update the guesses for the outer loop variables as a convex combination governed by $\xi_{tpi}\in(0,1]$ of the respective initial guesses and the new implied values and repeat steps (3) through (5). $$ &[\boldsymbol{r}_p^{i+1}, \boldsymbol{r}^{i+1}, \boldsymbol{\hat{w}}^{i+1}, \boldsymbol{p}^{i+1}, \boldsymbol{\hat{BQ}}^{i+1},\boldsymbol{\hat{TR}}^{i+1} ] = \\ @@ -395,9 +398,9 @@ The stationary non-steady state (transition path) solution algorithm has followi 24. If the maximum absolute error among the M-1+5 outer loop error terms is less-than-or-equal-to some small positive tolerance $toler_{tpi,out}$ in each period along the transition path, $\max\big|\left(error_{r_p}, error_r, error_w, error_p, error_{bq},error_{tr}\right)\bigr| \leq toler_{tpi,out}$ then the non-steady-state equilibrium has been found. - 1. Make sure that the resource constraint for industry $M$ (goods market clearing) {eq}`EqStnrzMarkClrGoods_M` is satisfied in each period along the time path. It is redundant, but this is a good check as to whether everything worked correctly. - 2. Make sure that the government budget constraint {eq}`EqStnrzGovBC` binds. - 3. Make sure that all the $(T+S)\times2JS$ household Euler equations are solved to a satisfactory tolerance. + 1. Make sure that the resource constraint for industry $M$ (goods market clearing) {eq}`EqStnrzMarkClrGoods_M` is satisfied in each period along the time path. It is redundant, but this is a good check as to whether everything worked correctly. + 2. Make sure that the government budget constraint {eq}`EqStnrzGovBC` binds. + 3. Make sure that all the $(T+S)\times2JS$ household Euler equations are solved to a satisfactory tolerance. Under alternative model configurations, the solution algorithm changes slightly. When `budget_balance = True`, the guess of $\boldsymbol{\hat{TR}}$ in the outer loop is replaced by the guess of $\boldsymbol{\hat{Y}}$ and transfers are determined a residual from the government budget constraint given revenues and other spending policy. When `baseline_spending = True`, $\boldsymbol{\hat{TR}}$ is determined from the baseline model solution and not updated in the outer loop described above. In this case $\boldsymbol{\hat{Y}}$ becomes variable that is updates in the outer loop. diff --git a/docs/book/content/theory/financial.md b/docs/book/content/theory/financial.md index 183acce46..9e1b4985f 100644 --- a/docs/book/content/theory/financial.md +++ b/docs/book/content/theory/financial.md @@ -1,6 +1,5 @@ (Chap_FinInt)= - # Financial Intermediary Domestic household wealth $W^d_{t}=B_{t}$ and foreign ownership of domestic assets $W^f_{t}$, both in terms of the numeraire good, are invested in a financial intermediary. This intermediary purchases a portfolio of government bonds and private capital in accordance with the domestic and foreign investor demand for these assets and then returns a single portfolio rate of return to all investors. @@ -15,7 +14,7 @@ Foreign demand for government bonds is specified in section {ref}`SecMarkClrMktC This leaves domestic investors to buy up the residual amount of government debt: ```{math} - :label: EqMarkClr_zetaD2 + :label: EqMarkClr_DomesticDebt D^{d}_{t} = D_{t} - D^{f}_{t} \quad\forall t ``` diff --git a/docs/book/content/theory/firms.md b/docs/book/content/theory/firms.md index 87bec2a36..fffb84a26 100644 --- a/docs/book/content/theory/firms.md +++ b/docs/book/content/theory/firms.md @@ -16,9 +16,11 @@ The production side of the `OG-Core` model is populated by $M$ industries indexe &\quad\quad\quad\quad\quad(1-\gamma_m-\gamma_{g,m})^\frac{1}{\varepsilon_m}(e^{g_y t}L_{m,t})^\frac{\varepsilon_m-1}{\varepsilon_m}\biggr]^\frac{\varepsilon_m}{\varepsilon_m-1} \quad\forall m,t \end{split} ``` + where $Z_{m,t}$ is an exogenous scale parameter (total factor productivity) that can be time dependent, $\gamma_m$ represents private capital's share of income, $\gamma_{g,m}$ is public capital's share of income, and $\varepsilon_m$ is the constant elasticity of substitution among the two types of capital and labor. We have included constant productivity growth rate $g_y$ as the rate of labor augmenting technological progress. A nice feature of the CES production function is that the Cobb-Douglas production function is a nested case for $\varepsilon_m=1$.[^Kg0_case] + ```{math} :label: EqFirmsCDprodfun Y_{m,t} = Z_{m,t} (K_{m,t})^{\gamma_m} (K_{g,m,t})^{\gamma_{g,m}}(e^{g_y t}L_{m,t})^{1-\gamma_m-\gamma_{g,m}} \quad\forall m,t \quad\text{for}\quad \varepsilon_m=1 diff --git a/docs/book/content/theory/government.md b/docs/book/content/theory/government.md index f3e8d3767..ee584cc42 100644 --- a/docs/book/content/theory/government.md +++ b/docs/book/content/theory/government.md @@ -17,7 +17,7 @@ Government levies taxes on households and firms, funds public pensions, and make Income taxes are modeled through the total tax liability function $T_{s,t}$, which can be decomposed into the effective tax rate times total income {eq}`EqTaxCalcLiabETR2`. In this chapter, we detail the household tax component of government activity $T_{s,t}$ in `OG-Core`, along with our method of incorporating detailed microsimulation data into a dynamic general equilibrium model. ```{math} -:label: EqHHBC2 +:label: EqHHBC2_gov p_t c_{j,s,t} + &\sum_{i=1}^I (1 + \tau^{c}_{i,t})p_{i,t}c_{min,i} + b_{j,s+1,t+1} = \\ &(1 + r_{p,t})b_{j,s,t} + w_t e_{j,s} n_{j,s,t} + \\ &\quad\quad\zeta_{j,s}\frac{BQ_t}{\lambda_j\omega_{s,t}} + \eta_{j,s,t}\frac{TR_{t}}{\lambda_j\omega_{s,t}} + ubi_{j,s,t} - T_{j,s,t} \\ @@ -31,7 +31,7 @@ The second difficulty in modeling realistic tax and incentive detail is the need `OG-Core` follows the method of {cite}`DeBackerEtAl:2019` of generating detailed tax data on effective tax rates and marginal tax rates for a sample of tax filers along with their respective income and demographic characteristics and then using that data to estimate parametric tax functions that can be incorporated into `OG-Core`. (SecTaxCalcRateTheory)= -###### Effective and Marginal Tax Rates +##### Effective and Marginal Tax Rates Before going into more detail regarding how we handle these two difficulties in `OG-Core`, we need to define some functions and make some notation. For notational simplicity, we will use the variable $x$ to summarize labor income, and we will use the variable $y$ to summarize capital income. @@ -445,11 +445,14 @@ Businesses face a linear tax rate $\tau^{b}_{m,t}$, which can vary by industry a Similar to transfers $TR_t$, the time dependent multiplier $g_{g,t}$ in front of the right-hand-side of {eq}`EqUnbalGBC_Gt` will equal 1 in most initial periods. It will potentially deviate from 1 in some future periods in order to provide a closure rule that ensures a stable long-run debt-to-GDP ratio. We make this more specific in the next section. Total government infrastructure investment spending, $I_{g,t}$ is assumed to be a time-dependent fraction of GDP. + ```{math} :label: EqUnbalGBC_Igt I_{g,t} = \alpha_{I,t}\: p_t Y_t \quad\forall t ``` + The government also chooses what percent of total infrastructure investment goes to each industry $\alpha_{I,m,t}$, although these are exogenously calibrated parameters in the model. + ```{math} :label: EqUnbalGBC_Igmt I_{g,m,t} = \alpha_{I,m,t}\: I_{g,t} \quad\forall m,t diff --git a/docs/book/content/theory/intro.md b/docs/book/content/theory/intro.md index 836276152..cc4a2c9d7 100644 --- a/docs/book/content/theory/intro.md +++ b/docs/book/content/theory/intro.md @@ -1,4 +1,4 @@ -(Chap_Intro)= +(Chap_ModelIntro)= # Model Overview The overlapping generations model is a workhorse of dynamic fiscal analysis. The `OG-Core` model is dynamic in that households in the model make consumption, savings, and labor supply decisions based on their expectations over their entire lifetime, not just the current period. Because `OG-Core` is a general equilibrium model, behavioral changes by households and firms can cause macroeconomic variables and prices to adjust. This characteristic has recently become a required component of fiscal policy analysis in the United States.[^dynscore_note] diff --git a/ogcore/__init__.py b/ogcore/__init__.py index 867703ee1..456043395 100644 --- a/ogcore/__init__.py +++ b/ogcore/__init__.py @@ -20,4 +20,4 @@ from ogcore.txfunc import * from ogcore.utils import * -__version__ = "0.11.9" +__version__ = "0.11.10" diff --git a/ogcore/default_parameters.json b/ogcore/default_parameters.json index e9cce702f..52903b395 100644 --- a/ogcore/default_parameters.json +++ b/ogcore/default_parameters.json @@ -3148,6 +3148,7 @@ "DEP", "DEP_totalinc", "GS", + "HSV", "linear", "mono", "mono2D" diff --git a/ogcore/elliptical_u_est.py b/ogcore/elliptical_u_est.py index 2779f4166..ce8b4c019 100644 --- a/ogcore/elliptical_u_est.py +++ b/ogcore/elliptical_u_est.py @@ -55,7 +55,7 @@ def elliptical_u(b, k, upsilon, l_tilde, n): Args: b (scalar): scale parameter of elliptical utility function - k (scalar): shift parametr of elliptical utility function + k (scalar): shift parameter of elliptical utility function upsilon (scalar): curvature parameter of elliptical utility function l_tilde (scalar): maximum amount of labor supply @@ -152,31 +152,23 @@ def sumsq_MU(params, *objs): def estimation(frisch, l_tilde): """ This function estimates the parameters of an elliptical utility - funcion that fits a constant frisch elasticty function. + function that fits a constant frisch elasticity function. Args: frisch (scalar): Frisch elasticity of labor supply l_tilde (scalar): maximum amount of labor supply Returns: - b_MU_til (scalar): estimated b from ellipitical utility function - upsilon_MU_til (scalar): estimated upsilon from ellipitical + b_MU_til (scalar): estimated b from elliptical utility function + upsilon_MU_til (scalar): estimated upsilon from elliptical utility function """ - - """ - ------------------------------------------------------------------------ - Set parameters - ------------------------------------------------------------------------ - """ + # Set parameters theta = 1 / frisch N = 101 - """ - ------------------------------------------------------------------------ - Estimate parameters of ellipitical utility function - ------------------------------------------------------------------------ - """ + + # Estimate parameters of elliptical utility function # Initial guesses b_init = 0.6701 # k_init = -.6548 @@ -184,17 +176,6 @@ def estimation(frisch, l_tilde): # don't estimate near edge of range of labor supply n_grid = np.linspace(0.01, 0.8, num=N) - # Estimating using levels of utility function - # ellipse_params_init = np.array([b_init, k_init, upsilon_init]) - # ellipse_objs = (theta, l_tilde, n_grid) - # bnds = ((None, None), (None, None), (1e-12, None)) - # ellipse_params_til = opt.minimize(sumsq, ellipse_params_init, - # args=(ellipse_objs), method="L-BFGS-B", bounds=bnds, - # tol=1e-15) - # (b_til, k_til, upsilon_til) = ellipse_params_til.x - - # elapsed_time = time.clock() - start_time - # Estimate params using marginal utilities ellipse_MU_params_init = np.array([b_init, upsilon_init]) ellipse_MU_objs = (theta, l_tilde, n_grid) diff --git a/ogcore/utils.py b/ogcore/utils.py index c9c6bff26..a88003a80 100644 --- a/ogcore/utils.py +++ b/ogcore/utils.py @@ -331,9 +331,9 @@ def get_initial_path(x1, xT, p, shape): Notes: The identifying assumptions for quadratic are the following: - 1. `x1` is the value at time `t=0: x1 = c + 1. `x1` is the value at time `t=0: x1 = c` 2. `xT` is the value at time `t=T-1: xT = a*(T-1)^2 + b*(T-1) + c` - 3. the slope of the path at `t=T-1` is 0: 0 = 2*a*(T-1) + b` + 3. the slope of the path at `t=T-1` is 0: `0 = 2*a*(T-1) + b` """ if shape == "linear": diff --git a/setup.py b/setup.py index fa4e1d1eb..571e96e4a 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="ogcore", - version="0.11.9", + version="0.11.10", author="Jason DeBacker and Richard W. Evans", license="CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", description="A general equilibribum overlapping generations model for fiscal policy analysis", diff --git a/tests/test_parameters.py b/tests/test_parameters.py index 6da427db6..ec2645986 100644 --- a/tests/test_parameters.py +++ b/tests/test_parameters.py @@ -160,7 +160,7 @@ def test_implement_bad_reform2(): assert len(specs.errors) > 0 assert specs.errors["tax_func_type"][0] == ( 'tax_func_type "not_a_functional_form" must be in list of ' - + "choices DEP, DEP_totalinc, GS, linear, mono, mono2D." + + "choices DEP, DEP_totalinc, GS, HSV, linear, mono, mono2D." )