ogeth 0.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ogeth/__init__.py +11 -0
- ogeth/calibrate.py +108 -0
- ogeth/constants.py +490 -0
- ogeth/income.py +529 -0
- ogeth/input_output.py +103 -0
- ogeth/labor.py +198 -0
- ogeth/macro_params.py +294 -0
- ogeth/ogeth_default_parameters.json +101449 -0
- ogeth/test_est_chi_n.py +46 -0
- ogeth/utils.py +44 -0
- ogeth-0.0.0.dist-info/METADATA +126 -0
- ogeth-0.0.0.dist-info/RECORD +15 -0
- ogeth-0.0.0.dist-info/WHEEL +5 -0
- ogeth-0.0.0.dist-info/licenses/LICENSE +121 -0
- ogeth-0.0.0.dist-info/top_level.txt +1 -0
ogeth/__init__.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Specify what is available to import from the ogeth package.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from ogeth.calibrate import *
|
|
6
|
+
from ogeth.income import *
|
|
7
|
+
from ogeth.input_output import *
|
|
8
|
+
from ogeth.macro_params import *
|
|
9
|
+
from ogeth.utils import *
|
|
10
|
+
|
|
11
|
+
__version__ = "0.0.0"
|
ogeth/calibrate.py
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
from ogeth import macro_params, income
|
|
2
|
+
from ogeth import input_output as io
|
|
3
|
+
import os
|
|
4
|
+
import numpy as np
|
|
5
|
+
import datetime
|
|
6
|
+
from ogcore import demographics
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class Calibration:
|
|
10
|
+
"""OG-ETH calibration class"""
|
|
11
|
+
|
|
12
|
+
def __init__(
|
|
13
|
+
self,
|
|
14
|
+
p,
|
|
15
|
+
macro_data_start_year=datetime.datetime(1947, 1, 1),
|
|
16
|
+
macro_data_end_year=datetime.datetime(2024, 12, 31),
|
|
17
|
+
demographic_data_path=None,
|
|
18
|
+
output_path=None,
|
|
19
|
+
update_from_api=False, # Set True to update from World Bank and UN APIs
|
|
20
|
+
):
|
|
21
|
+
"""
|
|
22
|
+
Constructor for the Calibration class.
|
|
23
|
+
|
|
24
|
+
Args:
|
|
25
|
+
p (OG-Core Specifications object): model parameters
|
|
26
|
+
demographic_data_path (str): path to save demographic data
|
|
27
|
+
output_path (str): path to save output to
|
|
28
|
+
update_from_api (bool): Set True if you want to pull updated macro data
|
|
29
|
+
from World Bank and UN APIs
|
|
30
|
+
|
|
31
|
+
Returns:
|
|
32
|
+
None
|
|
33
|
+
|
|
34
|
+
"""
|
|
35
|
+
# Create output_path if it doesn't exist
|
|
36
|
+
if output_path is not None:
|
|
37
|
+
if not os.path.exists(output_path):
|
|
38
|
+
os.makedirs(output_path)
|
|
39
|
+
|
|
40
|
+
# Macro estimation
|
|
41
|
+
self.macro_params = macro_params.get_macro_params(
|
|
42
|
+
macro_data_start_year,
|
|
43
|
+
macro_data_end_year,
|
|
44
|
+
update_from_api=update_from_api,
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
# io matrix and alpha_c
|
|
48
|
+
if p.I > 1: # no need if just one consumption good
|
|
49
|
+
alpha_c_dict = io.get_alpha_c()
|
|
50
|
+
# check that model dimensions are consistent with alpha_c
|
|
51
|
+
assert p.I == len(list(alpha_c_dict.keys()))
|
|
52
|
+
self.alpha_c = np.array(list(alpha_c_dict.values()))
|
|
53
|
+
else:
|
|
54
|
+
self.alpha_c = np.array([1.0])
|
|
55
|
+
if p.M > 1: # no need if just one production good
|
|
56
|
+
io_df = io.get_io_matrix()
|
|
57
|
+
# check that model dimensions are consistent with io_matrix
|
|
58
|
+
assert p.M == len(list(io_df.keys()))
|
|
59
|
+
self.io_matrix = io_df.values
|
|
60
|
+
else:
|
|
61
|
+
self.io_matrix = np.array([[1.0]])
|
|
62
|
+
|
|
63
|
+
# demographics
|
|
64
|
+
self.demographic_params = demographics.get_pop_objs(
|
|
65
|
+
p.E,
|
|
66
|
+
p.S,
|
|
67
|
+
p.T,
|
|
68
|
+
0,
|
|
69
|
+
99,
|
|
70
|
+
country_id="710",
|
|
71
|
+
initial_data_year=p.start_year - 1,
|
|
72
|
+
final_data_year=p.start_year + 1,
|
|
73
|
+
GraphDiag=False,
|
|
74
|
+
download_path=demographic_data_path,
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
# demographics for 80 period lives (needed for getting e below)
|
|
78
|
+
demog80 = demographics.get_pop_objs(
|
|
79
|
+
20,
|
|
80
|
+
80,
|
|
81
|
+
p.T,
|
|
82
|
+
0,
|
|
83
|
+
99,
|
|
84
|
+
country_id="710",
|
|
85
|
+
initial_data_year=p.start_year - 1,
|
|
86
|
+
final_data_year=p.start_year + 1,
|
|
87
|
+
GraphDiag=False,
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
# earnings profiles
|
|
91
|
+
self.e = income.get_e_interp(
|
|
92
|
+
p.S,
|
|
93
|
+
self.demographic_params["omega_SS"],
|
|
94
|
+
demog80["omega_SS"],
|
|
95
|
+
p.lambdas,
|
|
96
|
+
plot_path=output_path,
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
# method to return all newly calibrated parameters in a dictionary
|
|
100
|
+
def get_dict(self):
|
|
101
|
+
dict = {}
|
|
102
|
+
dict.update(self.macro_params)
|
|
103
|
+
dict["e"] = self.e
|
|
104
|
+
dict["alpha_c"] = self.alpha_c
|
|
105
|
+
dict["io_matrix"] = self.io_matrix
|
|
106
|
+
dict.update(self.demographic_params)
|
|
107
|
+
|
|
108
|
+
return dict
|
ogeth/constants.py
ADDED
|
@@ -0,0 +1,490 @@
|
|
|
1
|
+
SHOW_RUNTIME = False # Flag to display RuntimeWarnings when run model
|
|
2
|
+
|
|
3
|
+
REFORM_DIR = "OUTPUT_REFORM"
|
|
4
|
+
BASELINE_DIR = "OUTPUT_BASELINE"
|
|
5
|
+
|
|
6
|
+
# Default year for model runs
|
|
7
|
+
DEFAULT_START_YEAR = 2022
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
VAR_LABELS = {
|
|
11
|
+
"Y": "GDP ($Y_t$)",
|
|
12
|
+
"C": "Consumption ($C_t$)",
|
|
13
|
+
"L": "Labor ($L_t$)",
|
|
14
|
+
"G": "Government Expenditures ($G_t$)",
|
|
15
|
+
"TR": "Lump sum transfers ($TR_t$)",
|
|
16
|
+
"B": "Wealth ($B_t$)",
|
|
17
|
+
"I_total": "Investment ($I_t$)",
|
|
18
|
+
"K": "Capital Stock ($K_t$)",
|
|
19
|
+
"K_d": "Domestically-owned Capital Stock ($K^d_t$)",
|
|
20
|
+
"K_f": "Foreign-owned Capital Stock ($K^f_t$)",
|
|
21
|
+
"D": "Government Debt ($D_t$)",
|
|
22
|
+
"D_d": "Domestically-owned Gov Debt ($D^d_t$)",
|
|
23
|
+
"D_f": "Foreign-owned Gov Debt ($D^f_t$)",
|
|
24
|
+
"r": "Real interest rate ($r_t$)",
|
|
25
|
+
"r_gov": "Real interest rate on gov debt ($r_{gov,t}$)",
|
|
26
|
+
"r_hh": "Real interest rate on HH portfolio ($r_{hh,t}$)",
|
|
27
|
+
"w": "Wage rate",
|
|
28
|
+
"BQ": "Aggregate bequests ($BQ_{j,t}$)",
|
|
29
|
+
"total_tax_revenue": "Total tax revenue ($REV_t$)",
|
|
30
|
+
"business_tax_revenue": "Business tax revenue",
|
|
31
|
+
"iit_revenue": "Individual income tax revenue",
|
|
32
|
+
"payroll_tax_revenue": "Payroll tax revenue",
|
|
33
|
+
"iit_payroll_tax_revenue": "IIT and payroll tax revenue",
|
|
34
|
+
"n_mat": "Labor Supply ($n_{j,s,t}$)",
|
|
35
|
+
"c_path": "Consumption ($c_{j,s,t}$)",
|
|
36
|
+
"bmat_splus1": "Savings ($b_{j,s+1,t+1}$)",
|
|
37
|
+
"bq_path": "Bequests ($bq_{j,s,t}$)",
|
|
38
|
+
"bmat_s": "Savings ($b_{j,s,t}$)",
|
|
39
|
+
"y_before_tax_mat": "Before tax income",
|
|
40
|
+
"etr_path": "Effective Tax Rate ($ETR_{j,s,t}$)",
|
|
41
|
+
"mtrx_path": "Marginal Tax Rate, Labor Income ($MTRx_{j,s,t}$)",
|
|
42
|
+
"mtry_path": "Marginal Tax Rate, Capital Income ($MTRy_{j,s,t}$)",
|
|
43
|
+
"tax_path": "Total Taxes",
|
|
44
|
+
"nssmat": "Labor Supply ($\\bar{n}_{j,s}$)",
|
|
45
|
+
"bssmat_s": "Savings ($\\bar{b}_{j,s}$)",
|
|
46
|
+
"bssmat_splus1": "Savings ($\\bar{b}_{j,s+1}$)",
|
|
47
|
+
"cssmat": "Consumption ($\\bar{c}_{j,s}$)",
|
|
48
|
+
"yss_before_tax_mat": "Before-tax Income",
|
|
49
|
+
"etr_ss": "Effective Tax Rate ($\\bar{ETR}_{j,s}$)",
|
|
50
|
+
"mtrx_ss": "Marginal Tax Rate, Labor Income ($\\bar{MTRx}_{j,s}$)",
|
|
51
|
+
"mtry_ss": "Marginal Tax Rate, Capital Income ($\\bar{MTRy}_{j,s}$)",
|
|
52
|
+
"ETR": "Effective Tax Rates",
|
|
53
|
+
"MTRx": "Marginal Tax Rates on Labor Income",
|
|
54
|
+
"MTRy": "Marginal Tax Rates on Capital Income",
|
|
55
|
+
"etr": "Effective Tax Rates",
|
|
56
|
+
"mtrx": "Marginal Tax Rates on Labor Income",
|
|
57
|
+
"mtry": "Marginal Tax Rates on Capital Income",
|
|
58
|
+
"Yss": "GDP ($\\bar{Y}$)",
|
|
59
|
+
"Css": "Consumption ($\\bar{C}$)",
|
|
60
|
+
"Lss": "Labor ($\\bar{L}$)",
|
|
61
|
+
"Gss": "Government Expenditures ($\\bar{G}$)",
|
|
62
|
+
"TR_ss": "Lump sum transfers, ($\\bar{TR}$)",
|
|
63
|
+
"Bss": "Wealth ($\\bar{B}$)",
|
|
64
|
+
"Iss_total": "Investment ($\\bar{I}$)",
|
|
65
|
+
"Kss": "Capital Stock ($\\bar{K}$)",
|
|
66
|
+
"K_d_ss": "Domestically-owned Capital Stock ($\\bar{K}^d$)",
|
|
67
|
+
"K_f_ss": "Foreign-owned Capital Stock ($\\bar{K}^f$)",
|
|
68
|
+
"Dss": "Government Debt ($\\bar{D}$)",
|
|
69
|
+
"D_d_ss": "Domestically-owned Gov Debt ($\\bar{D}^d$)",
|
|
70
|
+
"D_f_ss": "Foreign-owned Gov Debt ($\\bar{D}^f$)",
|
|
71
|
+
"rss": "Real interest rate ($\\bar{r}$)",
|
|
72
|
+
"r_gov_ss": "Real interest rate on gov debt ($\\bar{r}_{gov}$)",
|
|
73
|
+
"r_hh_ss": "Real interest rate on HH portfolio ($\\bar{r}_{hh}$)",
|
|
74
|
+
"wss": "Wage rate ($\\bar{w}$)",
|
|
75
|
+
"BQss": "Aggregate bequests ($\\bar{BQ}_{j}$)",
|
|
76
|
+
"debt_service_ss": "Debt service cost ($\\bar{r}_{gov}\\bar{D}$)",
|
|
77
|
+
"D/Y": "Debt to GDP ratio",
|
|
78
|
+
"T_Pss": "Government Pensions",
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
ToGDP_LABELS = {
|
|
82
|
+
"D": "Debt-to-GDP ($D_{t}/Y_t$)",
|
|
83
|
+
"D_d": "Domestically-owned Debt-to-GDP ($D^d_{t}/Y_t$)",
|
|
84
|
+
"D_f": "Foreign-owned Debt-to-GDP ($D^f_{t}/Y_t$)",
|
|
85
|
+
"G": "Govt Spending-to-GDP ($G_{t}/Y_t$)",
|
|
86
|
+
"K": "Capital-Output Ratio ($K_{t}/Y_t$)",
|
|
87
|
+
"K_d": "Domestically-owned Capital-Output Ratio ($K^d_{t}/Y_t$)",
|
|
88
|
+
"K_f": "Foreign-owned Capital-Output Ratio ($K^f_{t}/Y_t$)",
|
|
89
|
+
"C": "Consumption-Output Ratio ($C_{t}/Y_t$)",
|
|
90
|
+
"I": "Investment-Output Ratio ($I_{t}/Y_t$)",
|
|
91
|
+
"total_tax_revenue": "Tax Revenue-to-GDP ($REV_{t}/Y_t$)",
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
GROUP_LABELS = {
|
|
95
|
+
7: {
|
|
96
|
+
0: "0-25%",
|
|
97
|
+
1: "25-50%",
|
|
98
|
+
2: "50-70%",
|
|
99
|
+
3: "70-80%",
|
|
100
|
+
4: "80-90%",
|
|
101
|
+
5: "90-99%",
|
|
102
|
+
6: "Top 1%",
|
|
103
|
+
},
|
|
104
|
+
9: {
|
|
105
|
+
0: "0-25%",
|
|
106
|
+
1: "25-50%",
|
|
107
|
+
2: "50-70%",
|
|
108
|
+
3: "70-80%",
|
|
109
|
+
4: "80-90%",
|
|
110
|
+
5: "90-99%",
|
|
111
|
+
6: "99-99.5%",
|
|
112
|
+
7: "99.5-99.9%",
|
|
113
|
+
8: "Top 0.1%",
|
|
114
|
+
},
|
|
115
|
+
10: {
|
|
116
|
+
0: "0-25%",
|
|
117
|
+
1: "25-50%",
|
|
118
|
+
2: "50-70%",
|
|
119
|
+
3: "70-80%",
|
|
120
|
+
4: "80-90%",
|
|
121
|
+
5: "90-99%",
|
|
122
|
+
6: "99-99.5%",
|
|
123
|
+
7: "99.5-99.9%",
|
|
124
|
+
8: "99.9-99.99%",
|
|
125
|
+
9: "Top 0.01%",
|
|
126
|
+
},
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
CBO_UNITS = {
|
|
130
|
+
"Y": r"Billions of R",
|
|
131
|
+
"r": "Percent",
|
|
132
|
+
"w_growth": "Percent",
|
|
133
|
+
"L_growth": "Percent",
|
|
134
|
+
"I_total": r"Billions of R",
|
|
135
|
+
"L": "2012=100",
|
|
136
|
+
"C": r"Billions of R",
|
|
137
|
+
"agg_pension_outlays": r"Billions of R",
|
|
138
|
+
"G": r"Billions of R",
|
|
139
|
+
"iit_revenue": r"Billions of R",
|
|
140
|
+
"payroll_tax_revenue": r"Billions of R",
|
|
141
|
+
"business_tax_revenue": r"Billions of R",
|
|
142
|
+
"wL": r"Billions of R",
|
|
143
|
+
"D": r"Billions of R",
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
PARAM_LABELS = {
|
|
147
|
+
"start_year": ["Initial year", r"$\texttt{start_year}$"],
|
|
148
|
+
# 'Gamma': ['Initial distribution of savings', r'\hat{\Gamma}_{0}'],
|
|
149
|
+
# 'N': ['Initial population', 'N_{0}'],
|
|
150
|
+
"omega": ["Population by age over time", r"${{\omega_{s,t}}}_{s=1}^{S}$"],
|
|
151
|
+
# 'fert_rates': ['Fertility rates by age',
|
|
152
|
+
# r'\left{f_{s}\right}_{s=1}^{S}'],
|
|
153
|
+
"imm_rates": ["Immigration rates by age", r"${{i_{s}}}_{s=1}^{S}$"],
|
|
154
|
+
"rho": ["Mortality rates by age", r"${{\rho_{s}}}_{s=1}^{S}$"],
|
|
155
|
+
"e": ["Deterministic ability process", r"${{e_{j,s}}}_{j,s=1}^{J,S}$"],
|
|
156
|
+
"lambdas": [
|
|
157
|
+
"Lifetime income group percentages",
|
|
158
|
+
r"${{\lambda_{j}}}_{j=1}^{J}$",
|
|
159
|
+
],
|
|
160
|
+
"J": ["Number of lifetime income groups", "$J$"],
|
|
161
|
+
"S": ["Maximum periods in economically active individual life", "$S$"],
|
|
162
|
+
"E": ["Number of periods of youth economically outside the model", "$E$"],
|
|
163
|
+
"T": ["Number of periods to steady-state", "$T$"],
|
|
164
|
+
"retirement_age": ["Retirement age", "$R$"],
|
|
165
|
+
"ltilde": ["Maximum hours of labor supply", r"$\tilde{l}$"],
|
|
166
|
+
"beta": ["Discount factor", r"$\beta$"],
|
|
167
|
+
"sigma": ["Coefficient of constant relative risk aversion", r"$\sigma$"],
|
|
168
|
+
"frisch": ["Frisch elasticity of labor supply", r"$\nu$"],
|
|
169
|
+
"b_ellipse": ["Scale parameter in utility of leisure", "$b$"],
|
|
170
|
+
"upsilon": ["Shape parameter in utility of leisure", r"$\upsilon$"],
|
|
171
|
+
# 'k': ['Constant parameter in utility of leisure', 'k'],
|
|
172
|
+
"chi_n": [
|
|
173
|
+
"Disutility of labor level parameters",
|
|
174
|
+
r"$\left{\chi^{n}_{s}\right}_{s=1}^{S}$",
|
|
175
|
+
],
|
|
176
|
+
"chi_b": [
|
|
177
|
+
"Utility of bequests level parameters",
|
|
178
|
+
r"$\left{\chi^{b}_{j}\right}_{j=1}^{J}$",
|
|
179
|
+
],
|
|
180
|
+
"use_zeta": [
|
|
181
|
+
"Whether to distribute bequests between lifetime income groups",
|
|
182
|
+
r"$\texttt{use_zeta}$",
|
|
183
|
+
],
|
|
184
|
+
"zeta": ["Distribution of bequests", r"$\zeta$"],
|
|
185
|
+
"Z": ["Total factor productivity", "$Z_{t}$"],
|
|
186
|
+
"gamma": ["Capital share of income", r"$\gamma$"],
|
|
187
|
+
"epsilon": [
|
|
188
|
+
"Elasticity of substitution between capital and labor",
|
|
189
|
+
r"\varepsilon",
|
|
190
|
+
],
|
|
191
|
+
"delta": ["Capital depreciation rate", r"$\delta$"],
|
|
192
|
+
"g_y": [
|
|
193
|
+
"Growth rate of labor augmenting technological progress",
|
|
194
|
+
r"$g_{y}$",
|
|
195
|
+
],
|
|
196
|
+
"tax_func_type": [
|
|
197
|
+
"Functional form used for income tax functions",
|
|
198
|
+
r"$\texttt{tax_func_type}$",
|
|
199
|
+
],
|
|
200
|
+
"analytical_mtrs": [
|
|
201
|
+
"Whether use analytical MTRs or estimate MTRs",
|
|
202
|
+
r"$\texttt{analytical_mtrs}$",
|
|
203
|
+
],
|
|
204
|
+
"age_specific": [
|
|
205
|
+
"Whether use age-specific tax functions",
|
|
206
|
+
r"$\texttt{age_specific}$",
|
|
207
|
+
],
|
|
208
|
+
"tau_payroll": ["Payroll tax rate", r"$\tau^{p}_{t}$"],
|
|
209
|
+
# 'theta': ['Replacement rate by average income',
|
|
210
|
+
# r'\left{\theta_{j}\right}_{j=1}^{J}'],
|
|
211
|
+
"tau_bq": ["Bequest (estate) tax rate", r"$\tau^{BQ}_{t}}$"],
|
|
212
|
+
"tau_b": ["Entity-level business income tax rate", r"$\tau^{b}_{t}$"],
|
|
213
|
+
"delta_tau": [
|
|
214
|
+
"Rate of depreciation for tax purposes",
|
|
215
|
+
r"$\delta^{\tau}_{t}$",
|
|
216
|
+
],
|
|
217
|
+
"tau_c": ["Consumption tax rates", r"$\tau^{c}_{t,s,j}$"],
|
|
218
|
+
"h_wealth": ["Coefficient on linear term in wealth tax function", "$H$"],
|
|
219
|
+
"m_wealth": ["Constant in wealth tax function", "$M$"],
|
|
220
|
+
"p_wealth": ["Coefficient on level term in wealth tax function", "$P$"],
|
|
221
|
+
"budget_balance": [
|
|
222
|
+
"Whether have a balanced budget in each period",
|
|
223
|
+
r"$\texttt{budget_balance}$",
|
|
224
|
+
],
|
|
225
|
+
"baseline_spending": [
|
|
226
|
+
"Whether level of spending constant between "
|
|
227
|
+
+ "the baseline and reform runs",
|
|
228
|
+
r"$\texttt{baseline_spending}$",
|
|
229
|
+
],
|
|
230
|
+
"alpha_T": ["Transfers as a share of GDP", r"$\alpha^{T}_{t}$"],
|
|
231
|
+
"eta": ["Distribution of transfers", r"$\eta_{j,s,t}$"],
|
|
232
|
+
"alpha_G": ["Government spending as a share of GDP", r"$\alpha^{G}_{t}$"],
|
|
233
|
+
"tG1": ["Model period in which budget closure rule starts", r"$t_{G1}$"],
|
|
234
|
+
"tG2": ["Model period in which budget closure rule ends", r"$t_{G2}$"],
|
|
235
|
+
"rho_G": ["Budget closure rule smoothing parameter", r"$\rho_{G}$"],
|
|
236
|
+
"debt_ratio_ss": ["Steady-state Debt-to-GDP ratio", r"$\bar{\alpha}_{D}$"],
|
|
237
|
+
"initial_debt_ratio": [
|
|
238
|
+
"Initial period Debt-to-GDP ratio",
|
|
239
|
+
r"$\alpha_{D,0}$",
|
|
240
|
+
],
|
|
241
|
+
"r_gov_scale": [
|
|
242
|
+
"Scale parameter in government interest rate wedge",
|
|
243
|
+
r"$\tau_{d,t}$",
|
|
244
|
+
],
|
|
245
|
+
"r_gov_shift": [
|
|
246
|
+
"Shift parameter in government interest rate wedge",
|
|
247
|
+
r"$\mu_{d,t}$",
|
|
248
|
+
],
|
|
249
|
+
"AIME_num_years": [
|
|
250
|
+
"Number of years over which compute AIME",
|
|
251
|
+
r"$\texttt{AIME_num_years}$",
|
|
252
|
+
],
|
|
253
|
+
"AIME_bkt_1": ["First AIME bracket threshold", r"$\texttt{AIME_bkt_1}$"],
|
|
254
|
+
"AIME_bkt_2": ["Second AIME bracket threshold", r"$\texttt{AIME_bkt_2}$"],
|
|
255
|
+
"PIA_rate_bkt_1": [
|
|
256
|
+
"First AIME bracket PIA rate",
|
|
257
|
+
r"$\texttt{PIA_rate_bkt_1}$",
|
|
258
|
+
],
|
|
259
|
+
"PIA_rate_bkt_2": [
|
|
260
|
+
"Second AIME bracket PIA rate",
|
|
261
|
+
r"\texttt{PIA_rate_bkt_2}",
|
|
262
|
+
],
|
|
263
|
+
"PIA_rate_bkt_3": [
|
|
264
|
+
"Third AIME bracket PIA rate",
|
|
265
|
+
r"$\texttt{PIA_rate_bkt_3}$",
|
|
266
|
+
],
|
|
267
|
+
"PIA_maxpayment": ["Maximum PIA payment", r"$\texttt{PIA_maxpayment}$"],
|
|
268
|
+
"PIA_minpayment": ["Minimum PIA payment", r"$\texttt{PIA_maxpayment}$"],
|
|
269
|
+
"replacement_rate_adjust": [
|
|
270
|
+
"Adjustment to replacement rate",
|
|
271
|
+
r"$theta_{adj,t}$",
|
|
272
|
+
],
|
|
273
|
+
"world_int_rate": ["World interest rate", r"$r^{*}_{t}$"],
|
|
274
|
+
"initial_foreign_debt_ratio": [
|
|
275
|
+
"Share of government debt held by foreigners in initial period",
|
|
276
|
+
r"$D_{f,0}$",
|
|
277
|
+
],
|
|
278
|
+
"zeta_D": [
|
|
279
|
+
"Share of new debt issues purchased by foreigners",
|
|
280
|
+
r"$\zeta_{D, t}$",
|
|
281
|
+
],
|
|
282
|
+
"zeta_K": [
|
|
283
|
+
"Share of excess capital demand satisfied by foreigners",
|
|
284
|
+
r"$\zeta_{K, t}$",
|
|
285
|
+
],
|
|
286
|
+
"nu": ["Dampening parameter for TPI", r"$\xi$"],
|
|
287
|
+
"maxiter": ["Maximum number of iterations for TPI", r"$\texttt{maxiter}$"],
|
|
288
|
+
"mindist_SS": ["SS solution tolerance", r"$\texttt{mindist_SS}$"],
|
|
289
|
+
"mindist_TPI": ["TPI solution tolerance", r"$\texttt{mindist_TPI}$"],
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
# Ignoring the following:
|
|
293
|
+
# 'starting_age', 'ending_age', 'constant_demographics',
|
|
294
|
+
# 'constant_rates', 'zero_taxes'
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
"""
|
|
298
|
+
Create dictionaries to map micro categories to broad groups
|
|
299
|
+
"""
|
|
300
|
+
CONS_DICT = {
|
|
301
|
+
"Food": [
|
|
302
|
+
"cceri",
|
|
303
|
+
"cvegf",
|
|
304
|
+
"clani",
|
|
305
|
+
"cfore",
|
|
306
|
+
"cfish",
|
|
307
|
+
"cwatr",
|
|
308
|
+
"cmeat",
|
|
309
|
+
"cpfis",
|
|
310
|
+
"cvege",
|
|
311
|
+
"cfrui",
|
|
312
|
+
"cfats",
|
|
313
|
+
"cdair",
|
|
314
|
+
"cgrai",
|
|
315
|
+
"cafee",
|
|
316
|
+
"cbake",
|
|
317
|
+
"csuga",
|
|
318
|
+
"cconf",
|
|
319
|
+
"cpast",
|
|
320
|
+
"calcb",
|
|
321
|
+
"csftd",
|
|
322
|
+
"ctoba",
|
|
323
|
+
],
|
|
324
|
+
"Energy and extraction": [
|
|
325
|
+
"ccoal",
|
|
326
|
+
"colig",
|
|
327
|
+
"cmore",
|
|
328
|
+
"cquar",
|
|
329
|
+
"comin",
|
|
330
|
+
"celcg",
|
|
331
|
+
],
|
|
332
|
+
"Non-durables": [
|
|
333
|
+
"ctexf",
|
|
334
|
+
"ctexm",
|
|
335
|
+
"ccarp",
|
|
336
|
+
"cotex",
|
|
337
|
+
"cknit",
|
|
338
|
+
"cwear",
|
|
339
|
+
"cleat",
|
|
340
|
+
"cfoot",
|
|
341
|
+
"cwood",
|
|
342
|
+
"cpapp",
|
|
343
|
+
"cprnt",
|
|
344
|
+
"ccoke",
|
|
345
|
+
"cpetr",
|
|
346
|
+
"cbchm",
|
|
347
|
+
"cpain",
|
|
348
|
+
"cphar",
|
|
349
|
+
"csoap",
|
|
350
|
+
"coche",
|
|
351
|
+
"ctyre",
|
|
352
|
+
"cplas",
|
|
353
|
+
"cglas",
|
|
354
|
+
"ccera",
|
|
355
|
+
"cclay",
|
|
356
|
+
"ccmnt",
|
|
357
|
+
"cconc",
|
|
358
|
+
"conmp",
|
|
359
|
+
"cfurn",
|
|
360
|
+
"cjewl",
|
|
361
|
+
"comnf",
|
|
362
|
+
"cwast",
|
|
363
|
+
],
|
|
364
|
+
"Durables": [
|
|
365
|
+
"cirst",
|
|
366
|
+
"cimet",
|
|
367
|
+
"cnfme",
|
|
368
|
+
"cstrm",
|
|
369
|
+
"cofbm",
|
|
370
|
+
"cengt",
|
|
371
|
+
"clift",
|
|
372
|
+
"cgenm",
|
|
373
|
+
"cspcm",
|
|
374
|
+
"cdoma",
|
|
375
|
+
"coffm",
|
|
376
|
+
"celcm",
|
|
377
|
+
"crdtv",
|
|
378
|
+
"cmeda",
|
|
379
|
+
"cmtvp",
|
|
380
|
+
"cmbod",
|
|
381
|
+
"cship",
|
|
382
|
+
"crail",
|
|
383
|
+
"cairc",
|
|
384
|
+
"coteq",
|
|
385
|
+
"ccnst",
|
|
386
|
+
],
|
|
387
|
+
"Services": [
|
|
388
|
+
"cwhol",
|
|
389
|
+
"creta",
|
|
390
|
+
"chotl",
|
|
391
|
+
"crest",
|
|
392
|
+
"cptrp",
|
|
393
|
+
"cftrp",
|
|
394
|
+
"ctrps",
|
|
395
|
+
"cpost",
|
|
396
|
+
"celcd",
|
|
397
|
+
"cwatd",
|
|
398
|
+
"cfins",
|
|
399
|
+
"cinsp",
|
|
400
|
+
"cofin",
|
|
401
|
+
"ccrpf",
|
|
402
|
+
"creal",
|
|
403
|
+
"crrea",
|
|
404
|
+
"crent",
|
|
405
|
+
"crsea",
|
|
406
|
+
"clacc",
|
|
407
|
+
"cobus",
|
|
408
|
+
"ctelc",
|
|
409
|
+
"csupp",
|
|
410
|
+
"cmnfs",
|
|
411
|
+
"cpuba",
|
|
412
|
+
"ceduc",
|
|
413
|
+
"cheal",
|
|
414
|
+
"ccmemb",
|
|
415
|
+
"centa",
|
|
416
|
+
"cpers",
|
|
417
|
+
"cdoms",
|
|
418
|
+
],
|
|
419
|
+
}
|
|
420
|
+
PROD_DICT = {
|
|
421
|
+
"Primary": [
|
|
422
|
+
"aagri",
|
|
423
|
+
"afore",
|
|
424
|
+
"afish",
|
|
425
|
+
"acoal",
|
|
426
|
+
"agold",
|
|
427
|
+
"amore",
|
|
428
|
+
"aomin",
|
|
429
|
+
],
|
|
430
|
+
"Energy": [
|
|
431
|
+
"aelcg",
|
|
432
|
+
],
|
|
433
|
+
"Tertiary": [
|
|
434
|
+
"awtrd",
|
|
435
|
+
"artrd",
|
|
436
|
+
"amtvs",
|
|
437
|
+
"aacct",
|
|
438
|
+
"altrp",
|
|
439
|
+
"awtrp",
|
|
440
|
+
"aatrp",
|
|
441
|
+
"atrps",
|
|
442
|
+
"apost",
|
|
443
|
+
"afins",
|
|
444
|
+
"ainsp",
|
|
445
|
+
"aofin",
|
|
446
|
+
"areal",
|
|
447
|
+
"arent",
|
|
448
|
+
"acomp",
|
|
449
|
+
"arsea",
|
|
450
|
+
"aobus",
|
|
451
|
+
"apuba",
|
|
452
|
+
"aeduc",
|
|
453
|
+
"aheal",
|
|
454
|
+
"awast",
|
|
455
|
+
"amorg",
|
|
456
|
+
"arecr",
|
|
457
|
+
"aoact",
|
|
458
|
+
"anobs",
|
|
459
|
+
],
|
|
460
|
+
"Secondary Ex Energy": [
|
|
461
|
+
"afood",
|
|
462
|
+
"abevt",
|
|
463
|
+
"aweav",
|
|
464
|
+
"aknit",
|
|
465
|
+
"aleat",
|
|
466
|
+
"afoot",
|
|
467
|
+
"awood",
|
|
468
|
+
"apapr",
|
|
469
|
+
"aprnt",
|
|
470
|
+
"apetr",
|
|
471
|
+
"abchm",
|
|
472
|
+
"aochm",
|
|
473
|
+
"arubb",
|
|
474
|
+
"aplas",
|
|
475
|
+
"aglss",
|
|
476
|
+
"anmmi",
|
|
477
|
+
"amets",
|
|
478
|
+
"afabm",
|
|
479
|
+
"amach",
|
|
480
|
+
"aemch",
|
|
481
|
+
"ardtv",
|
|
482
|
+
"amopt",
|
|
483
|
+
"amtvp",
|
|
484
|
+
"aotrp",
|
|
485
|
+
"afurn",
|
|
486
|
+
"aomnf",
|
|
487
|
+
"awatd",
|
|
488
|
+
"acnst",
|
|
489
|
+
],
|
|
490
|
+
}
|