def test_ETR_income(b, n, etr_params, params, expected): # Test income tax function r = 0.04 w = 1.2 factor = 100000 test_ETR_income = tax.ETR_income(r, w, b, n, factor, params.e, etr_params, params) assert np.allclose(test_ETR_income, expected) p1 = Specifications() p1.e = np.array([0.5, 0.45, 0.3]) p1.S = 3 p1.J = 1 p1.tax_func_type = 'DEP' p1.analytical_mtrs = True etr_params1 = np.reshape(np.array([ [0.001, 0.002, 0.003, 0.0015, 0.8, 0.8, 0.83, -0.14, -0.15, 0.15, 0.16, -0.15], [0.002, 0.001, 0.002, 0.04, 0.8, 0.8, 0.83, -0.14, -0.15, 0.15, 0.16, -0.15], [0.011, 0.001, 0.003, 0.06, 0.8, 0.8, 0.83, -0.14, -0.15, 0.15, 0.16, -0.15]]), (1, p1.S, 12)) mtrx_params1 = np.reshape(np.array([ [0.001, 0.002, 0.003, 0.0015, 0.68, 0.8, 0.96, -0.17, -0.42, 0.18, 0.43, -0.42], [0.001, 0.002, 0.003, 0.0015, 0.65, 0.8, 0.90, -0.17, -0.42, 0.18, 0.33, -0.12], [0.001, 0.002, 0.003, 0.0015, 0.56, 0.8, 0.65, -0.17, -0.42, 0.18, 0.38, -0.22]]), (1, p1.S, 12)) p2 = Specifications()
------------------------------------------------------------------------------- ''' # Define variables for test of SS version p1 = Specifications() p1.e = np.array([1.0, 0.9, 1.4]).reshape(3, 1) p1.sigma = 2.0 p1.J = 1 p1.beta = np.ones(p1.J) * 0.96 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.lambdas = np.array([1.0]) p1.S = 3 p1.T = 3 p1.analytical_mtrs = False etr_params = np.array([ np.array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.33, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.25, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.20, 0]]), np.array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.9, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 0]]), np.array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.15, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.45, 0]]) ]) mtry_params = np.array([ np.array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.3, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.45, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.28, 0]]),