Skip to content

Commit

Permalink
add ability to enter varying eti
Browse files Browse the repository at this point in the history
  • Loading branch information
jdebacker committed Oct 27, 2023
1 parent 003d214 commit 8e0deae
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions iot/inverse_optimal_tax.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import scipy.stats as st
import scipy
from statsmodels.nonparametric.kernel_regression import KernelReg

from scipy.interpolate import UnivariateSpline

class IOT:
"""
Expand Down Expand Up @@ -54,14 +54,29 @@ def __init__(
# (data[income_measure] >= lower_bound)
# & (data[income_measure] <= upper_bound)
# ]
self.eti = eti
# Get income distribution
self.z, self.F, self.f, self.f_prime = self.compute_income_dist(
data, income_measure, weight_var, dist_type, kde_bw
)
# see if eti is a scalar
if isinstance(eti, float):
self.eti = eti
else: # if not, then it should be a dict with keys containing lists as values
# check that same number of ETI values as knot points
assert len(eti["knot_points"]) == len(eti["eti_values"])
# want to interpolate across income distribution with knot points
# assume that eti can't go beyond 1 (or the max of the eti_values provided)
eti_spl = UnivariateSpline(
eti["knot_points"], eti["eti_values"], k=1, s=0
)
self.eti = eti_spl(self.z)
# compute marginal tax rate schedule
self.mtr, self.mtr_prime = self.compute_mtr_dist(
data, weight_var, income_measure, mtr_smoother, mtr_smooth_param
)
# compute theta_z, the elasticity of the tax base
self.theta_z = 1 + ((self.z * self.f_prime) / self.f)
# compute the social welfare weights
self.g_z, self.g_z_numerical = self.sw_weights()

def df(self):
Expand Down

0 comments on commit 8e0deae

Please sign in to comment.