diff --git a/ogcore/TPI.py b/ogcore/TPI.py index 4c51d639a..0ccba9d9f 100644 --- a/ogcore/TPI.py +++ b/ogcore/TPI.py @@ -262,7 +262,7 @@ def twist_doughnut( n_s = n_guess chi_n_s = p.chi_n[-length:] e_s = p.e[-length:, j] - rho_s = np.diag(p.rho[t: t + p.S , :], max(p.S - (s+1), 0)) + rho_s = np.diag(p.rho[t: t + p.S, :], max(p.S - length, 0)) error1 = household.FOC_savings( r_s, diff --git a/ogcore/default_parameters.json b/ogcore/default_parameters.json index 5a764bd52..5507437c9 100644 --- a/ogcore/default_parameters.json +++ b/ogcore/default_parameters.json @@ -3547,10 +3547,10 @@ "section_1": "Demographic Parameters", "notes": "", "type": "float", - "number_dims": 1, + "number_dims": 2, "value": [ { - "value": [0.0007328533962063233, 0.0008171197422418564, 0.0008788729669386708, 0.0009116525208591186, 0.0009229802325645409, 0.0009273406814831464, 0.0009357102393970917, 0.0009500953703120985, 0.0009759735565497696, 0.0010103554581823992, 0.0010497459745855142, 0.0010896505583020133, 0.0011290564585360041, 0.0011654456037331062, 0.0012043239258441307, 0.0012511773865916398, 0.0013110045346917953, 0.0013828255727224015, 0.0014696353786847194, 0.0015729202258729647, 0.0016901599123994027, 0.0018253151315732463, 0.00198785868083029, 0.002182248418529209, 0.0024054583493769988, 0.002649495698085591, 0.002912359902066397, 0.003196521891964843, 0.0035014404113965503, 0.0038265853053018883, 0.004175977199939118, 0.004546000079867052, 0.004929386691983617, 0.005323440679881664, 0.005732162610849301, 0.00618294920155571, 0.0066650630096521946, 0.007142892752724284, 0.007605334723393753, 0.008079293606839011, 0.008607183802693097, 0.009219540427197637, 0.009916977317307896, 0.01071379466147504, 0.011618680680630211, 0.012651175630041145, 0.013806200722411788, 0.015069231422104257, 0.01643990870680101, 0.017946285365270986, 0.019682839990789902, 0.02164309127204489, 0.02374663347580741, 0.025983719293213747, 0.028428273440626484, 0.03125859803249409, 0.03451112898875497, 0.038087062505788305, 0.04199247322144961, 0.04632683864241138, 0.05133101803558171, 0.05704185782117355, 0.06332015480431863, 0.07017696315508493, 0.0777688358372085, 0.0862903314228447, 0.09590618992081834, 0.1067242554403307, 0.11879857491346835, 0.13212525643676043, 0.14668282278042066, 0.16243247757898882, 0.17932696648992474, 0.19731341445765527, 0.21633944779689218, 0.23535763270336796, 0.2540598444887924, 0.2721191714344474, 0.28919517981339793, 1.0] + "value": [[0.0007328533962063233, 0.0008171197422418564, 0.0008788729669386708, 0.0009116525208591186, 0.0009229802325645409, 0.0009273406814831464, 0.0009357102393970917, 0.0009500953703120985, 0.0009759735565497696, 0.0010103554581823992, 0.0010497459745855142, 0.0010896505583020133, 0.0011290564585360041, 0.0011654456037331062, 0.0012043239258441307, 0.0012511773865916398, 0.0013110045346917953, 0.0013828255727224015, 0.0014696353786847194, 0.0015729202258729647, 0.0016901599123994027, 0.0018253151315732463, 0.00198785868083029, 0.002182248418529209, 0.0024054583493769988, 0.002649495698085591, 0.002912359902066397, 0.003196521891964843, 0.0035014404113965503, 0.0038265853053018883, 0.004175977199939118, 0.004546000079867052, 0.004929386691983617, 0.005323440679881664, 0.005732162610849301, 0.00618294920155571, 0.0066650630096521946, 0.007142892752724284, 0.007605334723393753, 0.008079293606839011, 0.008607183802693097, 0.009219540427197637, 0.009916977317307896, 0.01071379466147504, 0.011618680680630211, 0.012651175630041145, 0.013806200722411788, 0.015069231422104257, 0.01643990870680101, 0.017946285365270986, 0.019682839990789902, 0.02164309127204489, 0.02374663347580741, 0.025983719293213747, 0.028428273440626484, 0.03125859803249409, 0.03451112898875497, 0.038087062505788305, 0.04199247322144961, 0.04632683864241138, 0.05133101803558171, 0.05704185782117355, 0.06332015480431863, 0.07017696315508493, 0.0777688358372085, 0.0862903314228447, 0.09590618992081834, 0.1067242554403307, 0.11879857491346835, 0.13212525643676043, 0.14668282278042066, 0.16243247757898882, 0.17932696648992474, 0.19731341445765527, 0.21633944779689218, 0.23535763270336796, 0.2540598444887924, 0.2721191714344474, 0.28919517981339793, 1.0]] } ], "validators": { diff --git a/ogcore/parameter_plots.py b/ogcore/parameter_plots.py index 90cd2ae93..255315d85 100644 --- a/ogcore/parameter_plots.py +++ b/ogcore/parameter_plots.py @@ -54,10 +54,13 @@ def plot_mort_rates(p, years=[DEFAULT_START_YEAR], include_title=False, path=Non """ age_per = np.linspace(p.E, p.E + p.S, p.S) + years = np.array(years) - p.start_year fig, ax = plt.subplots() - plt.plot(age_per, p.rho) + for y in years: + plt.plot(age_per, p.rho[y, :], label=str(y + p.start_year)) plt.xlabel(r"Age $s$ (model periods)") plt.ylabel(r"Mortality Rates $\rho_{s}$") + plt.legend(loc="upper right") vals = ax.get_yticks() ax.set_yticklabels(["{:,.0%}".format(x) for x in vals]) if include_title: diff --git a/ogcore/parameters.py b/ogcore/parameters.py index 5a4da6596..a9bc34e0a 100644 --- a/ogcore/parameters.py +++ b/ogcore/parameters.py @@ -347,6 +347,66 @@ def compute_default_params(self): ) ) setattr(self, item, this_attr) + # Deal with parameters that vary across age and over time + tp_param_list4 = [ + "rho", + ] + for item in tp_param_list4: + this_attr = getattr(self, item) + if this_attr.ndim == 1: + # case where enter single number, so assume constant + # across years and age + if this_attr.shape[0] == 1: + this_attr = ( + np.ones((self.T + self.S, self.S)) * this_attr[0] + ) + # case where user enters just one year for all ages + if this_attr.shape[0] == self.S: + this_attr = np.tile( + this_attr.reshape(1, self.S), (self.T + self.S, 1) + ) + else: + # case where user enters multiple years for one age + # will assume they implied values the same across + # time for all periods after the last year of values + this_attr = np.concatenate( + ( + this_attr, + np.ones((self.T + self.S - this_attr.size)) + * this_attr[-1], + ) + ) + this_attr = np.tile( + this_attr.reshape(self.T + self.S, 1), (1, self.S) + ) + elif this_attr.ndim == 2: + if this_attr.shape[1] > 1 and this_attr.shape[1] != self.S: + print( + "please provide values of " + + item + + " for each age (or one if common across " + + "S}" + ) + assert False + if this_attr.shape[1] == 1: + this_attr = np.tile( + this_attr.reshape(this_attr.shape[0], 1), (1, self.S) + ) + if this_attr.shape[0] > self.T + self.S: + this_attr = this_attr[: self.T + self.S, :] + this_attr = np.concatenate( + ( + this_attr, + np.ones( + ( + self.T + self.S - this_attr.shape[0], + this_attr.shape[1], + ) + ) + * this_attr[-1, :], + ) + ) + setattr(self, item, this_attr) # Deal with tax parameters that maybe age and time specific tax_params_to_TP = [ "etr_params", @@ -631,8 +691,8 @@ def update_specifications(self, revision, raise_errors=True): """ if not (isinstance(revision, dict) or isinstance(revision, str)): raise ValueError("ERROR: revision is not a dictionary or string") - # Skip over the adjust method if the tax paraemeters passed in - # are fucntions (e.g., in the case of tax_func_type = mono) + # Skip over the adjust method if the tax parameters passed in + # are functions (e.g., in the case of tax_func_type = mono) tax_update_dict = {} tax_func_params_functions = False try: diff --git a/tests/test_TPI.py b/tests/test_TPI.py index 2fdfee269..09440c10f 100644 --- a/tests/test_TPI.py +++ b/tests/test_TPI.py @@ -183,6 +183,7 @@ def test_twist_doughnut(file_inputs, file_outputs): initial_b, p, ) + print("t = ", t, s, " p.S = ", p.S, p.rho.shape) test_list = TPI.twist_doughnut(*input_tuple) expected_list = utils.safe_read_pickle(file_outputs) assert np.allclose(np.array(test_list), np.array(expected_list), atol=1e-5) diff --git a/tests/test_aggregates.py b/tests/test_aggregates.py index 1d3f9dd06..b80f0549c 100644 --- a/tests/test_aggregates.py +++ b/tests/test_aggregates.py @@ -6,9 +6,12 @@ p = Specifications() +rho_vec = np.zeros((1, 40)) +rho_vec[0, -1] = 1.0 new_param_values = { "T": 160, "S": 40, + "rho": rho_vec.tolist(), "J": 2, "labor_income_tax_noncompliance_rate": [[0.0]], "capital_income_tax_noncompliance_rate": [[0.0]], @@ -43,9 +46,12 @@ def test_get_L(n, p, method, expected): p = Specifications() +rho_vec = np.zeros((1, 40)) +rho_vec[0, -1] = 1.0 new_param_values = { "T": 160, "S": 40, + "rho": rho_vec.tolist(), "J": 2, "labor_income_tax_noncompliance_rate": [[0.0]], "capital_income_tax_noncompliance_rate": [[0.0]], @@ -120,9 +126,12 @@ def test_get_I(b_splus1, K_p1, K, p, method, expected): p = Specifications() +rho_vec = np.zeros((1, 40)) +rho_vec[0, -1] = 1.0 new_param_values = { "T": 160, "S": 40, + "rho": rho_vec.tolist(), "J": 2, "labor_income_tax_noncompliance_rate": [[0.0]], "capital_income_tax_noncompliance_rate": [[0.0]], @@ -173,9 +182,12 @@ def test_get_B(b, p, method, PreTP, expected): p = Specifications() +rho_vec = np.zeros((1, 40)) +rho_vec[0, -1] = 1.0 new_param_values = { "T": 160, "S": 40, + "rho": rho_vec.tolist(), "J": 2, "labor_income_tax_noncompliance_rate": [[0.0]], "capital_income_tax_noncompliance_rate": [[0.0]], @@ -184,7 +196,7 @@ def test_get_B(b, p, method, PreTP, expected): "omega": np.ones((160, 40)) / 40, "omega_SS": np.ones(40) / 40, "imm_rates": np.zeros((160, 40)), - "rho": np.zeros(40), + "rho": rho_vec.tolist(), } # update parameters instance with new values for test p.update_specifications(new_param_values) @@ -194,7 +206,7 @@ def test_get_B(b, p, method, PreTP, expected): b_splus1 = 0.06 + 7 * np.random.rand(p.T, p.S, p.J) pop = np.append(p.omega_S_preTP.reshape(1, p.S), p.omega[: p.T - 1, :], axis=0) BQ_presum = (b_splus1 * np.squeeze(p.lambdas)) * np.tile( - np.reshape(p.rho * pop, (p.T, p.S, 1)), (1, 1, p.J) + np.reshape(p.rho[0, :] * pop, (p.T, p.S, 1)), (1, 1, p.J) ) growth_adj = (1.0 + r) / (1.0 + p.g_n[: p.T]) @@ -251,9 +263,12 @@ def test_get_BQ(r, b_splus1, j, p, method, PreTP, expected): p = Specifications() +rho_vec = np.zeros((1, 40)) +rho_vec[0, -1] = 1.0 new_param_values = { "T": 160, "S": 40, + "rho": rho_vec.tolist(), "J": 2, "M": 3, "labor_income_tax_noncompliance_rate": [[0.0]], @@ -297,9 +312,12 @@ def test_get_C(c, p, method, expected): """ p = Specifications() num_tax_params = 12 +rho_vec = np.zeros((1, 20)) +rho_vec[0, -1] = 1.0 new_param_values = { "T": 30, "S": 20, + "rho": rho_vec.tolist(), "J": 2, "labor_income_tax_noncompliance_rate": [[0.0]], "capital_income_tax_noncompliance_rate": [[0.0]], @@ -349,9 +367,12 @@ def test_get_C(c, p, method, expected): theta = 0.101 + (0.156 - 0.101) * random_state.rand(p.J) p3 = Specifications() +rho_vec = np.zeros((1, 20)) +rho_vec[0, -1] = 1.0 new_param_values3 = { "T": 30, "S": 20, + "rho": rho_vec.tolist(), "J": 2, "labor_income_tax_noncompliance_rate": [[0.0]], "capital_income_tax_noncompliance_rate": [[0.0]], @@ -380,9 +401,12 @@ def test_get_C(c, p, method, expected): inv_tax_cred_rev3 = np.squeeze(p3.inv_tax_credit[: p3.T] * Inv3) p_u = Specifications() +rho_vec = np.zeros((1, 20)) +rho_vec[0, -1] = 1.0 new_param_values_ubi = { "T": 30, "S": 20, + "rho": rho_vec.tolist(), "J": 2, "labor_income_tax_noncompliance_rate": [[0.0]], "capital_income_tax_noncompliance_rate": [[0.0]], diff --git a/tests/test_firm.py b/tests/test_firm.py index 0b1476b4d..2cd76a503 100644 --- a/tests/test_firm.py +++ b/tests/test_firm.py @@ -27,12 +27,15 @@ expected3 = np.array([0.592030917]) # update parameters instance with new values for test p4 = Specifications() +rho_vec = np.zeros((1, 3)) +rho_vec[0, -1] = 1.0 new_param_values4 = { "Z": [[2.0]], "gamma": [0.5], "epsilon": [1.0], "T": 3, "S": 3, + "rho": rho_vec.tolist(), "eta": (np.ones((3, p4.J)) / (3 * p4.J)), } # update parameters instance with new values for test @@ -48,6 +51,7 @@ "epsilon": [1.0], "T": 3, "S": 3, + "rho": rho_vec.tolist(), "eta": (np.ones((3, p5.J)) / (3 * p5.J)), } # update parameters instance with new values for test @@ -60,6 +64,7 @@ "epsilon": [1.0], "T": 3, "S": 3, + "rho": rho_vec.tolist(), "eta": (np.ones((3, p5.J)) / (3 * p5.J)), "gamma_g": [0.2], "initial_Kg_ratio": 0.01, @@ -79,6 +84,7 @@ "T": 3, "S": 3, "M": 2, + "rho": rho_vec.tolist(), "eta": (np.ones((3, p4.J)) / (3 * p4.J)), "initial_Kg_ratio": 0.01, } @@ -99,6 +105,7 @@ "T": 3, "S": 3, "M": 2, + "rho": rho_vec.tolist(), "eta": (np.ones((3, p4.J)) / (3 * p4.J)), "initial_Kg_ratio": 0.01, } @@ -115,6 +122,7 @@ "T": 3, "S": 3, "M": 3, + "rho": rho_vec.tolist(), "eta": (np.ones((3, p5.J)) / (3 * p5.J)), "gamma_g": [0.2, 0.1, 0.25], "initial_Kg_ratio": 0.01, @@ -139,6 +147,7 @@ "T": 3, "S": 3, "M": 3, + "rho": rho_vec.tolist(), "eta": (np.ones((3, p5.J)) / (3 * p5.J)), "gamma_g": [0.2, 0.1, 0.25], "initial_Kg_ratio": 0.01, @@ -258,6 +267,7 @@ def test_get_Y(K, K_g, L, p, method, m, expected): "delta_annual": 0.5, "T": 3, "S": 3, + "rho": rho_vec.tolist(), "eta": (np.ones((3, p4.J)) / (3 * p4.J)), } # update parameters instance with new values for test @@ -277,6 +287,7 @@ def test_get_Y(K, K_g, L, p, method, m, expected): "inv_tax_credit": [[0.07]], "T": 3, "S": 3, + "rho": rho_vec.tolist(), "eta": (np.ones((3, p5.J)) / (3 * p5.J)), } # update parameters instance with new values for test @@ -350,6 +361,7 @@ def test_get_r(Y, K, p_m, p, method, expected): "epsilon": [1.2], "T": 3, "S": 3, + "rho": rho_vec.tolist(), "eta": (np.ones((3, p4.J)) / (3 * p4.J)), } # update parameters instance with new values for test @@ -438,6 +450,7 @@ def test_get_w(Y, L, p_m, p, method, expected): "cit_rate": [[(0.0357 / 0.55) * (0.055 / 0.017)]], "T": 3, "S": 3, + "rho": rho_vec.tolist(), "eta": (np.ones((3, p4.J)) / (3 * p4.J)), } # update parameters instance with new values for test @@ -545,6 +558,7 @@ def test_get_KLratio(r, p, method, expected): "cit_rate": [[(0.0357 / 0.55) * (0.055 / 0.017)]], "T": 3, "S": 3, + "rho": rho_vec.tolist(), "eta": (np.ones((3, p4.J)) / (3 * p4.J)), } # update parameters instance with new values for test @@ -625,6 +639,7 @@ def test_get_w_from_r(r, p, method, expected): "cit_rate": [[0.5]], "T": 3, "S": 3, + "rho": rho_vec.tolist(), "eta": (np.ones((3, p4.J)) / (3 * p4.J)), } # update parameters instance with new values for test diff --git a/tests/test_household.py b/tests/test_household.py index 4256c038d..0664f5025 100644 --- a/tests/test_household.py +++ b/tests/test_household.py @@ -97,6 +97,7 @@ def test_marg_ut_labor(n, params, expected): p2 = Specifications() p2.zeta = np.array([[0.1, 0.3], [0.15, 0.4], [0.05, 0.0]]) p2.S = 3 +p2.rho = np.array([[0.0, 0.0, 1.0]]) p2.J = 2 p2.T = 3 p2.lambdas = np.array([0.6, 0.4]) @@ -115,6 +116,7 @@ def test_marg_ut_labor(n, params, expected): expected4 = np.array([[7.5, 10.0, 0.0], [2.4, 3.2, 0.0], [10.8, 14.4, 0.0]]) p3 = Specifications() p3.S = 3 +p3.rho = np.array([[0.0, 0.0, 1.0]]) p3.J = 2 p3.T = 3 p3.lambdas = np.array([0.6, 0.4]) @@ -183,6 +185,7 @@ def test_get_bq(BQ, j, p, method, expected): expected1 = np.array([[1.66666667, 7.5], [2.5, 10.0], [0.416666667, 0.0]]) p2 = Specifications() p2.S = 3 +p2.rho = np.array([[0.0, 0.0, 1.0]]) p2.J = 2 p2.T = 3 p2.eta = np.tile( @@ -259,6 +262,7 @@ def test_get_tr(TR, j, p, method, expected): p3.lambdas = np.array([0.4, 0.6]) p3.g_y = 0.01 p3.S = 3 +p3.rho = np.array([[0.0, 0.0, 1.0]]) p3.J = 2 r3 = 0.11 w3 = 0.75 @@ -415,7 +419,7 @@ def test_get_cons(model_args, expected): p1.g_y = 0.03 p1.chi_b = np.array([1.5]) p1.tau_bq = np.array([0.0]) -p1.rho = np.array([0.1, 0.2, 1.0]) +p1.rho = np.array([[0.1, 0.2, 1.0]]) p1.lambdas = np.array([1.0]) p1.S = 3 p1.T = 3 @@ -664,7 +668,7 @@ def test_FOC_savings(model_vars, params, expected): ubi, theta, params.e[:, j], - params.rho, + params.rho[-1, :], etr_params, mtry_params, t, @@ -686,7 +690,7 @@ def test_FOC_savings(model_vars, params, expected): ubi, theta, np.squeeze(params.e), - params.rho, + params.rho[-1, :], etr_params, mtry_params, t, @@ -970,6 +974,7 @@ def test_get_y(): p = Specifications() # p.update_specifications({'S': 4, 'J': 1}) p.S = 3 + p.rho = np.array([[0.0, 0.0, 1.0]]) p.e = np.array([0.99, 1.5, 0.2]) test_y = household.get_y(r_p, w, b_s, n, p) diff --git a/tests/test_parameter_plots.py b/tests/test_parameter_plots.py index 26a3c9d70..c337544a9 100644 --- a/tests/test_parameter_plots.py +++ b/tests/test_parameter_plots.py @@ -28,6 +28,7 @@ micro_data = utils.safe_read_pickle( os.path.join(CUR_PATH, "test_io_data", "micro_data_dict_for_tests.pkl") ) +base_params.rho = np.tile(base_params.rho.reshape(1, base_params.S), (base_params.T + base_params.S, 1)) def test_plot_imm_rates(): @@ -209,9 +210,9 @@ def test_plot_mort_rates_data(): min_yr = 21 max_yr = 100 age_year_all = np.arange(min_yr, max_yr) - mort_rates = base_params.rho[1:] - mort_rates_all = base_params.rho[1:] - infmort_rate = base_params.rho[0] + mort_rates = base_params.rho[-1, 1:].squeeze() + mort_rates_all = base_params.rho[-1, 1:].squeeze() + infmort_rate = base_params.rho[0, 0] fig = parameter_plots.plot_mort_rates_data( totpers, min_yr, @@ -230,9 +231,9 @@ def test_plot_mort_rates_data_save_fig(tmpdir): min_yr = 21 max_yr = 100 age_year_all = np.arange(min_yr, max_yr) - mort_rates = base_params.rho[1:] - mort_rates_all = base_params.rho[1:] - infmort_rate = base_params.rho[0] + mort_rates = base_params.rho[-1, 1:].squeeze() + mort_rates_all = base_params.rho[-1, 1:].squeeze() + infmort_rate = base_params.rho[0, 0] parameter_plots.plot_mort_rates_data( totpers, min_yr, diff --git a/tests/test_parameters.py b/tests/test_parameters.py index b708638e7..1bc970457 100644 --- a/tests/test_parameters.py +++ b/tests/test_parameters.py @@ -40,6 +40,7 @@ def test_compute_default_params(): param_updates1 = { "T": 4, "S": 3, + "rho": [[0.0, 0.0, 1.0]], "J": 1, "ubi_nom_017": 1000, "eta": np.ones((4, 3, 1)) / 12, @@ -51,6 +52,7 @@ def test_compute_default_params(): param_updates2 = { "T": 4, "S": 3, + "rho": [[0.0, 0.0, 1.0]], "J": 1, "ubi_nom_017": 1000, "eta": np.ones((4, 3, 1)) / 12, @@ -63,6 +65,7 @@ def test_compute_default_params(): param_updates3 = { "T": 4, "S": 3, + "rho": [[0.0, 0.0, 1.0]], "J": 1, "ubi_nom_017": 1000, "eta": np.ones((4, 3, 1)) / 12, diff --git a/tests/test_tax.py b/tests/test_tax.py index 9257e8fd2..ddc622ded 100644 --- a/tests/test_tax.py +++ b/tests/test_tax.py @@ -6,8 +6,11 @@ p = Specifications() +rho_vec = np.zeros((1, 4)) +rho_vec[0, -1] = 1.0 new_param_values = { "S": 4, + "rho": rho_vec.tolist(), "lambdas": [1.0], "labor_income_tax_noncompliance_rate": [[0.0]], "capital_income_tax_noncompliance_rate": [[0.0]], @@ -64,8 +67,11 @@ def test_replacement_rate_vals(n, w, factor, j, p, expected): b1 = np.array([0.1, 0.5, 0.9]) p1 = Specifications() +rho_vec = np.zeros((1, 3)) +rho_vec[0, -1] = 1.0 new_param_values = { "S": 3, + "rho": rho_vec.tolist(), "lambdas": [1.0], "J": 1, "T": 3, @@ -81,6 +87,7 @@ def test_replacement_rate_vals(n, w, factor, j, p, expected): p2 = Specifications() new_param_values2 = { "S": 3, + "rho": rho_vec.tolist(), "lambdas": [1.0], "J": 1, "T": 3, @@ -113,6 +120,7 @@ def test_ETR_wealth(b, p, expected): p1 = Specifications() new_param_values = { "S": 3, + "rho": rho_vec.tolist(), "lambdas": [1.0], "J": 1, "T": 3, @@ -129,6 +137,7 @@ def test_ETR_wealth(b, p, expected): p2 = Specifications() new_param_values2 = { "S": 3, + "rho": rho_vec.tolist(), "lambdas": [1.0], "J": 1, "T": 3, @@ -866,6 +875,7 @@ def test_MTR_income(etr_params, mtr_params, params, mtr_capital, expected): "inv_tax_credit": [[0.02]], "T": 3, "S": 3, + "rho": rho_vec.tolist(), "eta": (np.ones((3, p1.J)) / (3 * p1.J)), "labor_income_tax_noncompliance_rate": [[0.0]], "capital_income_tax_noncompliance_rate": [[0.0]], @@ -1193,6 +1203,7 @@ def test_get_biz_tax(w, Y, L, K, p_m, p, m, method, expected): "T": 3, "S": 3, "J": 2, + "rho": rho_vec.tolist(), "lambdas": [0.65, 0.35], "eta": (np.ones((3, 2)) / (3 * 2)), "ubi_nom_017": 1000, diff --git a/tests/testing_params.json b/tests/testing_params.json index c192618c5..1244b622b 100644 --- a/tests/testing_params.json +++ b/tests/testing_params.json @@ -1162,14 +1162,14 @@ 0.94059131, 0.93103307, 0.91912315, 0.90307411, 0.88633508, 0.86570502, 0.83882665, 0.8113354 , 0.77769617, 0.73566779, 0.69573454, 0.64996442, 0.60005633, 0.56161104, 0.0], -"rho": [0.0025781 , 0.00268902, 0.00282206, 0.00303204, 0.00333702, +"rho": [[0.0025781 , 0.00268902, 0.00282206, 0.00303204, 0.00333702, 0.00373181, 0.00435139, 0.00521627, 0.00608546, 0.00715621, 0.0084698 , 0.00975143, 0.01134659, 0.01332463, 0.01493943, 0.01647184, 0.0181378 , 0.01991245, 0.02238255, 0.02570651, 0.02896702, 0.03292571, 0.0381694 , 0.04358988, 0.05031253, 0.05940869, 0.06896693, 0.08087685, 0.09692589, 0.11366492, 0.13429498, 0.16117335, 0.1886646 , 0.22230383, 0.26433221, - 0.30426546, 0.35003558, 0.39994367, 0.43838896, 1.0], + 0.30426546, 0.35003558, 0.39994367, 0.43838896, 1.0]], "g_n": [7.96404268e-03, 8.40062030e-03, 9.29197104e-03, 7.46734317e-03, 5.76003535e-03, 4.47065743e-03, 3.58911639e-03, 3.24296433e-03, 3.23553123e-03, 2.07757478e-03, 2.05620669e-03, 1.98933891e-03,