You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.},
Copy file name to clipboardExpand all lines: docs/book/content/contributing/contributor_guide.md
+31-18Lines changed: 31 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -29,36 +29,36 @@ If you have already completed the {ref}`Sec_SetupPython` and {ref}`Sec_SetupGit`
29
29
30
30
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:
7. From your command line or terminal, navigate to your local `OG-Core` directory.
37
37
38
38
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:
9. Create a conda environment with all of the necessary packages to
46
46
execute the source code:
47
47
48
-
```
48
+
```console
49
49
OG-Core$ conda env create
50
50
```
51
51
52
52
10. The prior command will create a conda environment called `ogcore-dev`.
53
53
Activate this environment as follows:
54
54
55
-
```
55
+
```console
56
56
OG-Core$ conda activate ogcore-dev
57
57
```
58
58
59
59
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.
60
60
61
-
```
61
+
```console
62
62
OG-Core$ pip install -e .
63
63
```
64
64
@@ -75,7 +75,6 @@ Don't be alarmed if the above paragraph is confusing. The following
75
75
section introduces some standard Git practices and guides you through
76
76
the contribution process.
77
77
78
-
79
78
(Sec_Workflow)=
80
79
## Workflow
81
80
@@ -84,7 +83,6 @@ the contribution process.
84
83
85
84
GitHub "issues" are an excellent way to ask questions, include code examples, and tag specific GitHub users.
86
85
87
-
88
86
(Sec_GitHubPR)=
89
87
### Submitting a GitHub Pull Request
90
88
@@ -100,60 +98,75 @@ situations, in which case other contributors are here to help.
100
98
Navigate to your local `OG-Core` directory and enter the
101
99
following text at the command line:
102
100
103
-
```
101
+
```console
104
102
OG-Core$ git checkout master
105
103
```
106
104
107
105
b. Download all of the content from the central `OG-Core` repo:
108
-
```
106
+
107
+
```console
109
108
OG-Core$ git fetch upstream
110
109
```
110
+
111
111
c. Update your local master branch to contain the latest content of
112
112
the central master branch using [merge](https://help.github.com/articles/github-glossary/#merge). This step ensures that
113
113
you are working with the latest version of `OG-Core`:
114
-
```
114
+
115
+
```console
115
116
OG-Core$ git merge upstream/master
116
117
```
118
+
117
119
d. Push the updated master branch in your local repo to your GitHub repo:
118
-
```
120
+
121
+
```console
119
122
OG-Core$ git push origin master
120
123
```
124
+
121
125
2. Create a new [branch](https://help.github.com/articles/github-glossary/#branch) on your local machine. Think of your
122
126
branches as a way to organize your projects. If you want to work on
123
127
this documentation, for example, create a separate branch for that
124
128
work. If you want to change an element of the `OG-Core` model, create
125
129
a different branch for that project:
126
-
```
130
+
131
+
```console
127
132
OG-Core$ git checkout -b [new-branch-name]
128
133
```
134
+
129
135
3. As you make changes, frequently check that your changes do not
130
136
introduce bugs or degrade the accuracy of the `OG-Core`. To do
131
137
this, run the following command from the command line from inside
132
138
the `OG-Core/ogcore` directory:
133
-
```
139
+
140
+
```console
134
141
OG-Core/ogcore$ pytest
135
142
```
143
+
136
144
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).
137
145
138
146
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.
139
147
140
148
*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:
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:
147
-
```
156
+
157
+
```console
148
158
OG-Core$ git fetch upstream
149
159
OG-Core$ git merge upstream/master
150
160
```
161
+
151
162
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.)
152
163
153
164
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:
154
-
```
165
+
166
+
```console
155
167
OG-Core$ git push origin [new-branch-name]
156
168
```
169
+
157
170
7. From the GitHub.com user interface, [open a pull request](https://help.github.com/articles/creating-a-pull-request/#creating-the-pull-request).
158
171
159
172
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.
166
179
167
180
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.
168
181
169
-
```
182
+
```console
170
183
OG-Core$ conda activate ogcore-dev
171
184
```
172
185
173
186
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.
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}$
93
+
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}$
94
94
7. Using $\bar{c}_{m,j,s}$ in {eq}`EqCmt`, solve for aggregate consumption of each output good, $\bar{C}_{m}$
95
95
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}$
96
96
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.
196
196
(SecSSeqlbResults)=
197
197
### Steady-state results: default specification
198
198
199
-
[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$.
199
+
[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$.
200
200
201
201
```{figure} ./images/HHcons_SS.png
202
202
---
@@ -328,7 +328,7 @@ The stationary non-steady state (transition path) solution algorithm has followi
328
328
2. From price of consumption goods, determine the price of the composite consmpution good, $\bar{p}$ using equation {eq}`EqCompPnorm2`
329
329
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.
330
330
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.
331
-
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}$
331
+
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}$
332
332
8. Using $\hat{c}_{m,j,s,t}$ in {eq}`EqCmt`, solve for aggregate consumption of each output good, $\hat{C}_{m,t}$
333
333
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
334
334
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
345
345
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}$
346
346
3. Capital demand can thus be found: $\hat{K}_{m,t} = \frac{\hat{K}_{m,t}}{\hat{Y}_{m,t}} * \hat{Y}_{m,t}$
347
347
4. Labor demand can be found by inverting the production function:
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`
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).
391
+
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).
@@ -395,9 +398,9 @@ The stationary non-steady state (transition path) solution algorithm has followi
395
398
396
399
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.
397
400
398
-
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.
399
-
2. Make sure that the government budget constraint {eq}`EqStnrzGovBC` binds.
400
-
3. Make sure that all the $(T+S)\times2JS$ household Euler equations are solved to a satisfactory tolerance.
401
+
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.
402
+
2. Make sure that the government budget constraint {eq}`EqStnrzGovBC` binds.
403
+
3. Make sure that all the $(T+S)\times2JS$ household Euler equations are solved to a satisfactory tolerance.
401
404
402
405
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.
Copy file name to clipboardExpand all lines: docs/book/content/theory/financial.md
+1-2Lines changed: 1 addition & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,5 @@
1
1
2
2
(Chap_FinInt)=
3
-
4
3
# Financial Intermediary
5
4
6
5
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
15
14
This leaves domestic investors to buy up the residual amount of government debt:
0 commit comments