PSLmodels / InverseOptimalTax

Inverse optimal taxation model
https://pslmodels.github.io/InverseOptimalTax/
1 stars 3 forks source link

Allow non-constant elasticity of taxable income #23

Closed jdebacker closed 9 months ago

jdebacker commented 10 months ago

This PR adds the ability for users to enter an elasticity of taxable income that varies over the earned income distribution, which would resolve Issue #21. The functionality allows the user to enter a value of eti that is either a scalar (i.e., constant over income) or a dictionary with keys knot_points and etc_values, which each contain corresponding lists of income values and the ETI at those values. E.g., using the estimate of the ETI over the income distribution from Gruber and Saez (2002), this would look like:

eti_dict = {
    "eti_values": [0.18, 0.106, 0.567, 1.0],
    "knot_points": [30000, 75000, 250000, 10000000]
}

Where the last value is provided to help find just a gradual increase in the ETI after $250,000. Using a linear spline, the results look like: linear_spline

The sharp changes in the ETI in this interpolated function are probably not realistic and introduce odd kinds in the implied social welfare weights.

However, with so few datapoints, a cubic spline has its own problems (going off to values that are unrealistically high): cubic_spline

I believe the solution is to find more data points on the ETI on different parts of the income distribution that can be used to inform a cubic spline. This should allow for some smoothness in the ETI spline, but without a steep slope in some values beyond those in the literature.

cc @john-p-ryan

codecov-commenter commented 10 months ago

Codecov Report

Attention: 12 lines in your changes are missing coverage. Please review.

Comparison is base (614ba3f) 81.81% compared to head (944ebae) 72.81%.

Files Patch % Lines
iot/inverse_optimal_tax.py 33.33% 12 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #23 +/- ## ========================================== - Coverage 81.81% 72.81% -9.01% ========================================== Files 3 3 Lines 88 103 +15 ========================================== + Hits 72 75 +3 - Misses 16 28 +12 ``` | [Flag](https://app.codecov.io/gh/PSLmodels/InverseOptimalTax/pull/23/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/PSLmodels/InverseOptimalTax/pull/23/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) | `72.81% <33.33%> (-9.01%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.