Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional tests, approximate distributions from raw data #22

Merged
merged 34 commits into from
Oct 26, 2023

Conversation

jdebacker
Copy link
Member

This PR adds some additional unit test, including one to compare the computational solution to an analytical one.

It also removes the binning of the raw data by income group and rather uses the raw data directly to approximate the income distribution (which should resolve Issue #16).

@jdebacker
Copy link
Member Author

@john-p-ryan In this PR I'm trying to move away from the binning of data by income group and rather approximate the earnings distribution and the MTR schedule directly from the raw data. This helps avoid zero weight bins.

The approximation of the population distribution seems to go quite well (although it doesn't exactly match the theoretical moments at all points in the distribution, it is close). But the approximation of the MTR schedule has proven more challenging. Fitting a spline function to the whole distribution often takes several minutes and it's seems tricky to get the smoothing parameter just right - either theirs too much noise or important curvature in the MTR schedule is missed.

@codecov-commenter
Copy link

codecov-commenter commented Oct 26, 2023

Codecov Report

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

Comparison is base (fc84d50) 90.24% compared to head (529b07f) 81.81%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #22      +/-   ##
==========================================
- Coverage   90.24%   81.81%   -8.43%     
==========================================
  Files           3        3              
  Lines         123       88      -35     
==========================================
- Hits          111       72      -39     
- Misses         12       16       +4     
Flag Coverage Δ
unittests 81.81% <76.92%> (-8.43%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
iot/tests/test_inverse_optimal_tax.py 100.00% <100.00%> (ø)
iot/inverse_optimal_tax.py 83.87% <75.67%> (-4.81%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jdebacker jdebacker merged commit 614ba3f into PSLmodels:main Oct 26, 2023
4 of 5 checks passed
@jdebacker jdebacker deleted the add_tests branch October 26, 2023 20:44
This was referenced Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants