-
Notifications
You must be signed in to change notification settings - Fork 32
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
TaxBrain produces incorrect results because it allows invalid reforms #630
Comments
I advocate for providing a good warning and no error in both tax-calculator and TaxBrain. I left a few related comments on the merged PR: PSLmodels/Tax-Calculator#1502. First I said:
I then left a longer explanation:
@martinholmer, is there something that I am missing that means we must have no validation or strict validation? What about improving the quality of the warning? -- Relatedly, the user interface may be nicer if the warnings are displayed at the top of the output page rather than on the input page with a required resubmission. |
@MattHJensen said in TaxBrain issue #620:
So, you think the situation described in #620 is OK? What would the "warning" at the top of the results page say? Something like "The results from this TaxBrain run are completely non-sensical, but we're showing them to you anyway"? My point in #620 is that there is a fundamental difference between the current validations: some are logical requirements (like the one in #620) and others (related to to deductions) are data weaknesses that we haven't fixed since you asked for that data fix a year ago.
In my view, yes we should have "strict validation" (resulting in a fatal error and no simulation results) when the validation involves a logical requirement (like in #620). If you want the deduction related data weaknesses to not be validated, I have no problem with that as I already mentioned in Tax-Calculator 1502. But why not solve these data weakness issues by adding itemized-deduction expenses for non-itemizers? This is the most direct way to deal with this second class of validations. You seem to favor "warnings", but I don't see how that works. Can you explain exactly how Tax-Calculator would communicate a "warning" to TaxBrain? |
That makes sense to me, too, as does bifurcating our approach for handling logical requirements and data weaknesses.
The Python logging module was on my mind. I imagine we'd add a special log level for this purpose. There was a brief discussion of the benefits of the logging module in PSLmodels/Tax-Calculator#160 (comment). That said, I see your point about how solving the data weaknesses themselves would eliminate our (current) need for warnings. I asked @GoFroggyRun to focus on the webapp earlier this summer, which has been very productive, but it disrupted his progress on the imputation of deductions for non itemizers (PSLmodels/taxdata#32): @GoFroggyRun, could you leave an update over at PSLmodels/taxdata#32 on the state of the project and what you think the next steps should be when you pick it up again? -- Given that a) we haven't yet built the capacity to provide informative warnings, and b) our current need for those warnings might go away, one approach might look something like this:
|
@MattHJensen said about warnings and errors in #630:
I am in general agreement with this kind of approach to improving our handling of warnings and errors. But I'd like to suggest a slight variation on this basic approach. Assuming we agree to maintain a distinction between warnings (that do not stop Tax-Calculator execution) and errors (that do stop Tax-Calculator execution), then I think we should add warnings for parameter values being out of range for all policy parameters. Among the benefits of this approach is that we can continue to include the "data weakness" warnings which are very useful to point out to users. I can begin preparing a pull request as soon as we are in agreement on this basic approach: Does this (slightly modified) approach make sense? |
That sounds great. Thanks @martinholmer. |
@martinholmer said
@MattHJensen said
What if we had some function in
This function could be called in TaxBrain and an action could be taken depending on the contents of |
Thanks for the creative thinking. I'll think about this kind of approach. |
Consider the following reform:
When using Tax-Calculator (version at HEAD of master branch), the validation checking detects the logical inconsistency in the reform.
The error message
ValueError: 2020 _II_brk1 value 9e+99 > max value 40605.4
gives a strong hint about what the problem is.But if you hand enter this reform into the TaxBrain GUI input page, you would be given a vague warning about some unspecified parameters having questionable values and given an opportunity to click on the "Show Me the Results!" button a second time to simulate the reform. And here would be the totally incorrect results you would get:
Notice that the top expanded income decile is simulated to pay over $1.3 trillion in income taxes, even though the user thought s/he was eliminating the income tax by setting the first bracket's rate to zero and making the top of that first bracket be (essentially) infinity.
The reason why we put these tax bracket validations in the
current_law_policy.json
file becomes apparent when looking at the code that computes tax liability:So, by letting users make this kind of mistake, TaxBrain is producing absurdly incorrect results.
At least this is what the user would think (because TaxBrain users are not being requested to understand the Python source code before using TaxBrain). The user was clear: the first bracket is infinitely big and has a zero rate. So, the user is going to think the TaxBrain results are absurd.
It seems like we need to make a fundamental philosophical decision about Tax-Calculator and TaxBrain. Do we want to remove all validation testing or not? Essentially, the current version of TaxBrain removes all validation testing (because the warning message is so vague, most users are not going to realize their mistake and go ahead and click the execute button a second time). This philosophy of minimal or no validation checking (which has a long tradition in software development) is often described in computer programming discourse as the "give them enough rope to hang themselves" approach.
@MattHJensen @feenberg @Amy-Xu @andersonfrailey @hdoupe @talumbau @brittainhard
The text was updated successfully, but these errors were encountered: