Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add remittances to OG-Core #971

Merged
merged 86 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from 82 commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
e16ec26
Updated documentation files
rickecon Aug 16, 2024
e05f91d
Updated equilibrium.md
rickecon Aug 20, 2024
1c007e4
Merge remote-tracking branch 'origin/master' into remit
rickecon Aug 21, 2024
53fae74
Updated default_parameters.json
rickecon Aug 21, 2024
affd65e
Updated documentation
rickecon Aug 21, 2024
9f8654b
Updated docstrings in tax.py
rickecon Aug 21, 2024
4a8064a
Updated government.md
rickecon Aug 21, 2024
20869b3
Updated documentation
rickecon Aug 21, 2024
25dc700
Updated docstring in tax.py
rickecon Aug 21, 2024
7762317
Updated documentation
rickecon Aug 21, 2024
4d24afb
Updated SS algorithm in code and docs
rickecon Aug 22, 2024
f611ead
Updated equilibrium.md
rickecon Aug 22, 2024
f704600
Updated documentation for equilibrium step
rickecon Aug 24, 2024
0b420f0
Reverted Y update line in SS.py
rickecon Aug 24, 2024
4dc4868
Updated file paths in run_ogcore_example.py
rickecon Aug 24, 2024
6181fe3
Updated output paths in run_ogcore_example.py
rickecon Aug 24, 2024
969466b
Restore default_parameters.json to orig
rickecon Aug 26, 2024
4a9b7b6
Updated aggregates.py and households.md
rickecon Aug 29, 2024
4d7b18c
fix pension subscripts
jdebacker Aug 29, 2024
801af44
put pensions in household budget constraint
jdebacker Aug 29, 2024
cd80888
define aggregate pension spending
jdebacker Aug 29, 2024
7efcce0
Updated government.md and households.md
rickecon Sep 3, 2024
a7503a6
Merge branch 'remit' into pr-971
rickecon Sep 3, 2024
1796c11
Merge pull request #2 from jdebacker/pr-971
rickecon Sep 3, 2024
01c464c
Updated section label
rickecon Sep 3, 2024
4a835f2
Merge remote-tracking branch 'origin/remit' into remit
rickecon Sep 3, 2024
0ecf26d
Updated households.md
rickecon Sep 3, 2024
4b9f5eb
Updated plot_elliptical_u func in parameter_plots.py
rickecon Sep 3, 2024
aab3b4c
Updated elliptical utility fit image
rickecon Sep 3, 2024
507d65d
Updated government.md and households.md
rickecon Sep 3, 2024
04e1ae0
Updated government.md
rickecon Sep 3, 2024
705edd4
Updated households.md and stationarization.md
rickecon Sep 4, 2024
a20590a
Black formatted parameter_plots.py
rickecon Sep 4, 2024
62566fc
Updated equilibrium.md
rickecon Sep 4, 2024
4326b4b
Added 5 new remittance parameters to default_parameters.json
rickecon Sep 5, 2024
6d11bcc
Updated the version
rickecon Sep 5, 2024
574201e
Updated constants.py
rickecon Sep 5, 2024
2040d29
Changed section heading title
rickecon Sep 5, 2024
d035e38
Black formatted constants.py
rickecon Sep 5, 2024
4fdd313
Add get_rm and update get_cons in household.py
rickecon Sep 5, 2024
461570f
Fix typos in stationarization.md
rickecon Sep 5, 2024
d79c745
Add get_rm to household.rst
rickecon Sep 5, 2024
079b583
Removed ndims in three RM scalar parameters
rickecon Sep 5, 2024
881ad75
Updated .py files with remittances
rickecon Sep 6, 2024
cd728f5
Black formatted aggregates.py and household.py and updated parameters.py
rickecon Sep 6, 2024
eb14ed1
Fixed error in test_SS.py test_euler_equation_solver() tests
rickecon Sep 7, 2024
a40451c
Updated test_SS.py
rickecon Sep 9, 2024
9bd48b2
Updated form of aggregate remittances function
rickecon Sep 10, 2024
7344ff5
Updated get_RM tests
rickecon Sep 10, 2024
5fa5d64
Fixed typo in test_aggregates.py
rickecon Sep 10, 2024
749fde2
Updated tests_household.py
rickecon Sep 11, 2024
d3ef7e1
Black formatted test files
rickecon Sep 11, 2024
1e12e88
Removed extraneous parma from PARAM_LABLES in constants.py
rickecon Sep 11, 2024
df10942
Updated TPI.py and parameters.py
rickecon Sep 11, 2024
e677596
Updated TPI.py
rickecon Sep 11, 2024
41d54a0
Updated CHANGELOG.md
rickecon Sep 12, 2024
dca00b1
Updated test_TPI.py
rickecon Sep 12, 2024
1277c20
Black formatted TPI.py and parameters.py
rickecon Sep 12, 2024
9ed1539
Updated tests_TPI.py
rickecon Sep 13, 2024
d5b4762
Updated test_TPI.py
rickecon Sep 13, 2024
5f64455
Updated twist_doughnut data files
rickecon Sep 13, 2024
9130a0a
Updated test_inner_loop in test_TPI.py
rickecon Sep 13, 2024
cc92773
Updated test_TPI.py::test_run_TPI tests
rickecon Sep 15, 2024
7f59b9b
Update test_TPI.py
rickecon Sep 15, 2024
7ae3744
Updated test_TPI.py
rickecon Sep 16, 2024
bdb254f
Updated CHANGELOG.md
rickecon Sep 16, 2024
80bc551
UPDATED CHANGELOG.md
rickecon Sep 16, 2024
321c04a
Updated CHANGELOG.md and test_run_example.py
rickecon Sep 16, 2024
8341e5f
Black formatted test_run_example.py
rickecon Sep 16, 2024
a3ed07b
Updated test_run_example.py
rickecon Sep 16, 2024
678997b
Updated CHANGELOG.md and tests
rickecon Sep 17, 2024
58a152d
Black formatted test_txfunc.py
rickecon Sep 17, 2024
9cf79d1
Updated CHANGELOG.md
rickecon Sep 17, 2024
3714290
Update aggregate remittances in resource constraint in code
rickecon Sep 18, 2024
ca46d5f
Black formatted TPI.py
rickecon Sep 18, 2024
abad20e
Updated aggregate remittances in resource constraint
rickecon Sep 18, 2024
802bf2e
Update test_infant_mort() test in test_demographics.py
rickecon Sep 18, 2024
a96eb77
Restored RC_SS val to 1e-09
rickecon Sep 18, 2024
bc6db91
Update default_parameters.json values for RC_SS and RC_TPI
rickecon Sep 18, 2024
3169b8f
Updated files
rickecon Sep 19, 2024
796a779
Updated test_TPI.py and test_run_example.py
rickecon Sep 19, 2024
1f14820
Black formatted test_run_example.py
rickecon Sep 19, 2024
dc6453a
Updated CHANGELOG.md
rickecon Sep 26, 2024
9927c4a
Updated CHANGELOG.md
rickecon Sep 26, 2024
1588643
Fixed typo in test_TPI.py
rickecon Sep 26, 2024
30d7977
Fixed double hash typo in TPI.py
rickecon Sep 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,32 @@ 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.13.0] - 2024-09-17 12:00:00

### Added

- Updates all of the documentation.
- Adds remittances to all instances of the household budget constraint
- Rewrites bequests and transfers components of household budget constraint in terms of individual variables in all instances
- Adds a household transfers section to `households.md` with subsections on bequests, remittances, government transfers, and universal basic income
- Changes all instances of $p_t Y_t$ to $Y_t
- Updates the steady-state equilibrium algorithm description in `equilibrium.md`
- Added updates to the government pensions descriptions in `government.md` and added `pensions` to all instances of the household budget constraint.
- Updates the docstrings in `tax.py` for the wealth tax ETR and MTR functions. The code is right. I just thought there was a clearer specification of the equations in LaTeX.
- Adds remittances to the OG-Core code
- Adds aggregate remittances function `get_RM()` to `aggregates.py`
- Adds household remittances function `get_rm()` to `household.py`
- Adds four new remittance parameters: `alpha_RM_1`, `g_RM`, `alpha_RM_T`, `eta_RM`
- We model aggregate remittances as a percent of GDP in the first period, then growing at a specified rate that can deviate from the country growth rate until the cutoff rule period, after which the remittance growth rate trends back to the population growth rate. We also model remittances in reforms as being a percentage of baseline GDP. In this way, if remittance parameters are not changed in the reform, remittances remain at their baseline levels. The only way they change is if their parameter values are changed.
jdebacker marked this conversation as resolved.
Show resolved Hide resolved
- Adds 3 tests using the `test_get_RM()` function in `test_aggregates.py`
- Adds 4 tests using the `test_get_rm()` function in `test_household.py`
- Changes the `initial_guess_r_SS` in two tests in `test_SS.py` because they were not solving with their current values
- Increases `RC_SS` steady-state resource constraint tolerance from 1e-9 to 1e-8 because two `test_run_SS()` tests were failing in `test_SS.py` with resource constraints errors just bigger than 1e-9 (-2.29575914e-09 for [Baseline, small open] and -2.29575914e-09 for [Reform, small open]).
- Increases `RC_TPI` transition path resource constraint tolerance from 1e-5 to 1e-4 in because one `test_run_TPI_full_run()` test was failing in `test_TPI.py` with a resource constraint error just bigger than 1e-5 (1.4459913381864586e-05 for `[Baseline, M=3 non-zero Kg]`).
- However, there is another "local only" test that is failing in `test_run_TPI()` in `test_TPI.py` that has a much bigger resource constraint error. The specification is `[Baseline, small open]` with a maximum absolute resource constraint error of 0.07786113397046332. This error is big enough that it needs to be addressed.
jdebacker marked this conversation as resolved.
Show resolved Hide resolved
- Updated two directory path references that were out of date in `test_run_example.py`.
- Updated expected value tuples and dictionaries in `test_txfunc.py`.

## [0.12.0] - 2024-08-20 12:00:00

### Added
Expand Down
2 changes: 1 addition & 1 deletion docs/book/content/api/aggregates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ ogcore.aggregates
------------------------------------------

.. automodule:: ogcore.aggregates
:members: get_L, get_I, get_B, get_BQ, get_C, revenue, get_r_p,
:members: get_L, get_I, get_B, get_BQ, get_RM, get_C, revenue, get_r_p,
resource_constraint, get_K_splits, get_ptilde
4 changes: 2 additions & 2 deletions docs/book/content/api/household.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ ogcore.household
------------------------------------------

.. automodule:: ogcore.household
:members: marg_ut_cons, marg_ut_labor, get_bq, get_tr, get_cons, get_ci,
FOC_savings, FOC_labor, get_y, constraint_checker_SS,
:members: marg_ut_cons, marg_ut_labor, get_bq, get_tr, get_rm, get_cons,
get_ci, FOC_savings, FOC_labor, get_y, constraint_checker_SS,
constraint_checker_TPI
1 change: 1 addition & 0 deletions docs/book/content/contributing/contributor_guide.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

(Chap_ContribGuide)=
# Contributor Guide

Expand Down
146 changes: 76 additions & 70 deletions docs/book/content/theory/equilibrium.md

Large diffs are not rendered by default.

45 changes: 24 additions & 21 deletions docs/book/content/theory/financial.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,62 @@
(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.
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.

Foreign demand for government bonds is specified in section {ref}`SecMarkClrMktClr_G` of the {ref}`Chap_MarkClr` chapter:
Foreign demand for government bonds is specified in section {ref}`SecMarkClrMktClr_G` of the {ref}`Chap_MarkClr` chapter:

```{math}
:label: EqMarkClr_zetaD2
D^{f}_{t+1} = D^{f}_{t} + \zeta_{D, t}(D_{t+1} - D_{t}) \quad\forall t
```

This leaves domestic investors to buy up the residual amount of government debt:
This leaves domestic investors to buy up the residual amount of government debt:

```{math}
:label: EqMarkClr_DomesticDebt
D^{d}_{t} = D_{t} - D^{f}_{t} \quad\forall t
```

We assume that debt dominates the capital markets, such that domestic investor demand for capital, $K^{d}_{t}$ is given as:
We assume that debt dominates the capital markets, such that domestic investor demand for capital, $K^{d}_{t}$ is given as:

```{math}
:label: eq_domestic_cap_demand
K^{d}_{t} = B_{t} - D^{d}_{t} \quad\forall t
```

Foreign demand for capital is given in {ref}`SecMarkClrMktClr_K`, where $K^{f}_{t}$ is an exogenous fraction of excess capital demand at the world interest rate:
Foreign demand for capital is given in {ref}`SecMarkClrMktClr_K`, where $K^{f}_{t}$ is an exogenous fraction of excess capital demand at the world interest rate:

```{math}
:label: eq_foreign_cap_demand
K^{f}_t = \zeta_{K, t}ED^{K,r^*}_t \quad\forall t
```

The total amount invested in the financial intermediary is thus:
The total amount invested in the financial intermediary is thus:

```{math}
W_{t} & = W^d_{t} + W^f_{t} \\
& = D^d_t + K^d_t + D^f_t + K^f_t \\
& = D_t + K_t
```
```{math}
W_{t} & = W^d_{t} + W^f_{t} \\
& = D^d_t + K^d_t + D^f_t + K^f_t \\
& = D_t + K_t
```

Interest rates on private capital through the financial intermediary and on government bonds differ. The return on the portfolio of assets held in the financial intermediary is the weighted average of these two rates of return. As derived in {eq}`EqFirms_rKt` of Section {ref}`EqFirmsPosProfits`, the presence of public infrastructure in the production function means that the returns to private factors of production ($r_t$ and $w_t$) exhibit decreasing returns to scale.[^MoorePecoraro] It is assumed that competition ensures a zero profit condition among firms and the returns to public infrastructure through the returns of firms are captured by the financial intermediary and returned to share holders. The return on capital is therefore the sum of the (after-tax) returns to private and public capital.
Interest rates on private capital through the financial intermediary and on government bonds differ. The return on the portfolio of assets held in the financial intermediary is the weighted average of these two rates of return. As derived in {eq}`EqFirms_rKt` of Section {ref}`EqFirmsPosProfits`, the presence of public infrastructure in the production function means that the returns to private factors of production ($r_t$ and $w_t$) exhibit decreasing returns to scale.[^MoorePecoraro] It is assumed that competition ensures a zero profit condition among firms and the returns to public infrastructure through the returns of firms are captured by the financial intermediary and returned to share holders. The return on capital is therefore the sum of the (after-tax) returns to private and public capital.

```{math}
:label: eq_rK
r_{K,t} = r_{t} + \frac{\sum_{m=1}^M(1 - \tau^{corp}_{m,t})p_{m,t}MPK_{g,m,t}K_{g,m,t}}{\sum_{m=1}^M K_{m,t}} \quad\forall t
```

```{math}
:label: eq_rK
r_{K,t} = r_{t} + \frac{\sum_{m=1}^M(1 - \tau^{corp}_{m,t})p_{m,t}MPK_{g,m,t}K_{g,m,t}}{\sum_{m=1}^M K_{m,t}} \quad\forall t
```
The return on the portfolio of assets held by the financial intermediary is thus a weighted average of the return to government debt $r_{gov,t}$ from {eq}`EqUnbalGBC_rate_wedge` and the adjusted return on private capital $r_{K,t}$ from {eq}`eq_rK`.

The return on the portfolio of assets held by the financial intermediary is thus a weighted average of the return to government debt $r_{gov,t}$ from {eq}`EqUnbalGBC_rate_wedge` and the adjusted return on private capital $r_{K,t}$ from {eq}`eq_rK`.
```{math}
:label: eq_portfolio_return
r_{p,t} = \frac{r_{gov,t}D_{t} + r_{K,t}K_{t}}{D_{t} + K_{t}} \quad\forall t \quad\text{where}\quad K_t \equiv \sum_{m=1}^M K_{m,t}
```

```{math}
:label: eq_portfolio_return
r_{p,t} = \frac{r_{gov,t}D_{t} + r_{K,t}K_{t}}{D_{t} + K_{t}} \quad\forall t \quad\text{where}\quad K_t \equiv \sum_{m=1}^M K_{m,t}
```

(SecFinfootnotes)=
## Footnotes

This section contains the footnotes for this chapter.

[^MoorePecoraro]: See also {cite}`MoorePecoraro:2021` for a similar treatment of government infrastructure investment, positive profits, and returns to the owners of capital.
2 changes: 2 additions & 0 deletions docs/book/content/theory/firms.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ Industry $M$ in the model is unique in two respects. First, we will define indu
(SecFirmsfootnotes)=
## Footnotes

This section contains the footnotes for this chapter.

[^Kg0_case]: It is important to note a special case of the Cobb-Douglas ($\varepsilon_m=1$) production function that we have to manually restrict. The inputs of production of private capital $K_{m,t}$ and labor $L_{m,t}$ are endogenous and have characteristics of the model that naturally bound them away from zero. But public capital $K_{g,m,t}$, although it is a function of endogenous variables in {eq}`EqUnbalGBC_Igt` and {eq}`EqUnbalGBC_Igmt`, can be exogenously set to zero as a policy parameter choice by setting $\alpha_{I,t}=0$ or $\alpha_{I,m,t}=0$. In the Cobb-Douglas case of the production function $\varepsilon_m=1$ {eq}`EqFirmsCDprodfun`, $K_{g,m,t}=0$ would zero out production and break the model. In the case when $\varepsilon_m=1$ and $K_{g,m,t}=0$, we set $\gamma_{g,m}=0$, thereby restricting the production function to only depend on private capital $K_{m,t}$ and labor $L_{m,t}$. This necessary restriction limits us from performing experiments in the model of the effect of changing $K_{g,m,t}=0$ to $K_{g,m,t}>0$ or vice versa in the $\varepsilon_m=1$ case.

[^delta_M]: Because we are assuming that only the output of the $M$th industry can be used for investment, government spending, or government debt, and because that industry's output is the numeraire, the only depreciation rate that matters or can be nonzero is that of the $M$th industry $\delta_{M,t}$.
Expand Down
Loading
Loading