-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #971 +/- ##
==========================================
+ Coverage 69.98% 70.14% +0.16%
==========================================
Files 20 20
Lines 4977 5038 +61
==========================================
+ Hits 3483 3534 +51
- Misses 1494 1504 +10
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@jdebacker. All the GH Action CI tests have now passed. Some of the local tests in
I have successfully run the Baseline SS equilibrium
Baseline TP equilibrium (35 min, 47 sec)
Reform SS equilibrium
Reform TP equilibrium (39 min, 29 sec)
I also plotted the aggregate remittances time series from the last two cases tested in alpha_RM_1 = 0.05
alpha_RM_T = 0.05
g_RM = ((np.exp(g_y) * (1 + g_n_ss)) - 1) * np.ones(T + S) In this case, aggregate remittances start and end at 5% of GDP. And they grow over the time series at the aggregate long-run growth rate of the economy. The plot dips below its initial level because the long-run aggregate growth rate is bigger than the actual growth rate of GDP in the early periods. The second lin is labeled "RM3" and is represented by a similar parameterization in which the only difference is that the growth rate of remittances over the first g_RM = ((np.exp(g_y) * (1 + g_n_ss)) - 1 + 0.005) * np.ones(T + S) The code for creating this plot is: import numpy as np
from ogcore.parameters import Specifications
from ogcore import aggregates as aggr
import matplotlib.pyplot as plt
Y_RM1 = 0.625
p_RM2= Specifications(baseline=True)
p_RM2.alpha_RM_1 = 0.05
p_RM2.alpha_RM_T = 0.05
p_RM2.g_RM =(
((np.exp(p_RM2.g_y_annual) * (1 + p_RM2.g_n_ss)) - 1) *
np.ones(p_RM2.T + p_RM2.S)
)
Y_RM2 = Y_RM1 * np.ones(p_RM2.T + p_RM2.S)
RM2 = aggr.get_RM(Y_RM2, p_RM2, "TPI")
p_RM3 = copy.deepcopy(p_RM2)
p_RM3.g_RM = (
((np.exp(p_RM2.g_y_annual) * (1 + p_RM2.g_n_ss)) - 1 + 0.005) *
np.ones(p_RM2.T + p_RM2.S)
)
RM3 = aggr.get_RM(Y_RM2, p_RM3, "TPI")
plt.plot(np.arange(2025, 2025 + p_RM3.T), RM3[:p_RM3.T], label='RM3')
plt.plot(np.arange(2025, 2025 + p_RM3.T), RM2[:p_RM3.T], label='RM2')
plt.vlines(
[2025 + p_RM3.tG1, 2025 + p_RM3.tG2], 0.0292, 0.0336, color='black',
linestyle='--'
)
plt.xlabel(r"Year $t$")
plt.ylabel(r"Remittances $\hat{RM}_t$")
plt.legend() |
@jdebacker. I think this PR is now ready for review and to be merged if accepted. In addition to running the
|
@jdebacker. I made the following updates:
|
@jdebacker. Now all the tests are passing, both GH Actions and local (see output below). This PR should now be ready to go.
|
This adds remittances to OG-Core and does some heavy updates to the documentation. This PR:
households.md
with subsections on bequests, remittances, government transfers, and universal basic incomeequilibrium.md
government.md
and addedpensions
to all instances of the household budget constraint.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.get_RM()
toaggregates.py
get_rm()
tohousehold.py
alpha_RM_1
,g_RM
,alpha_RM_T
,eta_RM
test_get_RM()
function intest_aggregates.py
test_get_rm()
function intest_household.py
initial_guess_r_SS
in two tests intest_SS.py
because they were not solving with their current valuesRC_SS
steady-state resource constraint tolerance from 1e-9 to 1e-8. because on of the tests intest_run_TPI.py::test_run_TPI_full_run[Baseline, small open]
was failing due to `RuntimeError: Steady state aggregate resource constraint not satisfied. The maximum absolute resource constraint error was 2.29575914e-09.RC_TPI
transition path resource constraint tolerance from 1e-5 to 1e-4 in because onetest_run_TPI_full_run()
test was failing intest_TPI.py
with a resource constraint error just bigger than 1e-5 (1.4459913381864586e-05 for[Baseline, M=3 non-zero Kg]
).test_run_example.py
.test_txfunc.py
.cc: @jdebacker