Skip to content

Commit 57f417f

Browse files
authored
Merge pull request #34 from john-p-ryan/main
Add kreg bw option
2 parents 305c52f + bd68572 commit 57f417f

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

iot/inverse_optimal_tax.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def __init__(
4545
kde_bw=None,
4646
mtr_smoother="kreg",
4747
mtr_smooth_param=1000,
48+
kreg_bw=[120_000],
4849
):
4950
# keep the original data intact
5051
self.data_original = data.copy()
@@ -75,7 +76,7 @@ def __init__(
7576
self.eti = eti_spl(self.z)
7677
# compute marginal tax rate schedule
7778
self.mtr, self.mtr_prime = self.compute_mtr_dist(
78-
data, weight_var, income_measure, mtr_smoother, mtr_smooth_param
79+
data, weight_var, income_measure, mtr_smoother, mtr_smooth_param, kreg_bw
7980
)
8081
# compute theta_z, the elasticity of the tax base
8182
self.theta_z = 1 + ((self.z * self.f_prime) / self.f)
@@ -108,7 +109,7 @@ def df(self):
108109
return df
109110

110111
def compute_mtr_dist(
111-
self, data, weight_var, income_measure, mtr_smoother, mtr_smooth_param
112+
self, data, weight_var, income_measure, mtr_smoother, mtr_smooth_param, kreg_bw
112113
):
113114
"""
114115
Compute marginal tax rates over the income distribution and
@@ -150,7 +151,7 @@ def compute_mtr_dist(
150151
binned_data[income_measure].dropna(),
151152
var_type="c",
152153
reg_type="ll",
153-
bw=[mtr_smooth_param * 40_000],
154+
bw=kreg_bw,
154155
)
155156
mtr, _ = mtr_function.fit(self.z)
156157
mtr_prime = np.gradient(mtr, self.z, edge_order=2)

iot/iot_user.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ def __init__(
6262
dist_type="log_normal",
6363
kde_bw=None,
6464
mtr_smoother="kreg",
65-
mtr_smooth_param=4,
65+
mtr_smooth_param=1000,
66+
kreg_bw=[120_000]
6667
):
6768
self.income_measure = income_measure
6869
self.weight_var = weight_var
@@ -111,6 +112,7 @@ def __init__(
111112
kde_bw=kde_bw,
112113
mtr_smoother=mtr_smoother,
113114
mtr_smooth_param=mtr_smooth_param,
115+
kreg_bw=kreg_bw,
114116
)
115117
)
116118

0 commit comments

Comments
 (0)