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

is the Taxer function doing what is desired? #29

Closed
talumbau opened this issue Sep 18, 2014 · 6 comments
Closed

is the Taxer function doing what is desired? #29

talumbau opened this issue Sep 18, 2014 · 6 comments
Labels

Comments

@talumbau
Copy link
Member

It seems like the Taxer function is doing quite a bit of logical work to set variable _a5. Then, it sets the value of _a6 based on some logical conditions and the values _a3 and _a5. Immediately after this though, there is the line:

_a6 = inc_in

The computed results (inc_out) only involve _a6 and other values from outside the function, so none of the work for variables _a1 - _a5 is used. I commented out that code and got the same answer. Am I missing something?

https://github.com/OpenSourcePolicyCenter/Tax-Calculator/blob/master/translation.py#L1738-L1740

@iliakur
Copy link
Contributor

iliakur commented Sep 18, 2014

@SameerSarkar is the best person to ask, since that line is missing from previous translations.

That function in general could do with some refactoring for an increase in speed and legibility.

@talumbau
Copy link
Member Author

Still looking for input from @SameerSarkar on this issue.

@talumbau
Copy link
Member Author

talumbau commented Oct 7, 2014

I'm hesitant to remove the code that uses _a1 though_a5 in the Taxer function, but it looks like that might be the right answer.

@iliakur
Copy link
Contributor

iliakur commented Oct 7, 2014

I checked the SAS code and it appears _a1-_a5 are in fact used there. Based on a cursory read (during lunch break), I think they're just an optional logical branch if one's income satisfies certain conditions.

Considering this and that @SameerSarkar appears to have gone AWOL, my call would be to a) keep these lines b) translate them into vanilla python so that it's easier to figure out where and how they fit in.
I can totally help with the latter, so let me know!

@feenberg
Copy link
Contributor

feenberg commented Oct 9, 2014

There is a lot of code in taxer to round the result in the same way that the the tax tables in the 1040 book are rounded. We don't need that in the long run, but it is useful to keep it while we are comparing with the withc data. I am virtually certain that taxer is doing the right thing - it has been compared to millions of actual returns at SOI, but the syntax may be limited by SAS, and it might look better as a loop rather than a series of conditional statements.

dan

@MattHJensen MattHJensen added tax and removed bug labels Mar 4, 2015
@MattHJensen
Copy link
Contributor

Closing.

Amy-Xu pushed a commit to Amy-Xu/Tax-Calculator that referenced this issue Mar 9, 2016
Add additional difference table calculations
jdebacker pushed a commit that referenced this issue Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants