-
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
Decile distribution table entries not correct #794
Comments
@martinholmer do you think #794 is related to #214? |
@hdoupe asked: I don't think so. Issue #214 was about difference tables with bins, not about distribution tables with deciles. The distribution tables generated by Tax-Calculator do not have the problem reported in #794.
The assert statements did not fail because itax+ptax always equals combined, but that is not what's shown in TaxBrain results cited in #794. |
Thanks @martinholmer. I'll be back in the office next week and will have more time to dive into this. |
The 4th column from the right (AMT) has a problem too, as it shows AMT as being higher than taxable income. The payroll tax liability column is also far too high--total payroll tax liabilities should be close to the amount of income tax liabilities, as they're each roughly the same percentage of federal revenues. I've also noticed that changing payroll taxes produces illogical results in the distribution table. Setting the Social Security tax rate to 6% instead of the default of 12.4% results in higher payroll tax liabilities, and 1% results in higher payroll tax liabilities than 6%! The "Total Liabilities by Calendar Year (Change)" table at the top of the results page correctly shows a large reduction in payroll tax liability, but the distribution table shows a slightly higher number than with default settings. |
I can replicate these issues. See a 1% OASDI tax rate here: http://www.ospc.org/taxbrain/30382/ My initial thought is that the columns in the tables are mislabeled. |
I agree that the table columns are probably mislabeled. I'll dig into this today. @martinholmer @siervicul @MattHJensen Thanks for the bug report. |
The AMT column seems way off. I looked at the output straight from Tax-Calculator before it is processed by PolicyBrain with the following script:
with output:
The corresponding TaxBrain results for AMT are: Link to run: http://www.ospc.org/taxbrain/30382/ I'm stumped right now. I'm having trouble figuring out which variables PolicyBrain is showing. |
The first five columns ("Returns" through "Itemizers") all seem off too. There must be more than 5.8 million returns and fewer than 96.3 billion itemizers, for example. |
The table labels are definitely out of order. I wrote a script that runs one year of the model and presents the results when a dataframe is returned and when a dictionary is returned. This is toggled with the
and output:
You can see that AGI is clearly wrong. AGI is -124,029,518,735 in the dataframe and 7,061 in the dictionary. It seems like either the order of the results has changed or the order has always been wrong. My hunch is that some of the results got mixed up after the changes to the TaxBrain/Tax-Calculator interface. @martinholmer do you have any insight into whether this makes sense? |
@hdoupe, Thanks for your extensive script in PolicyBrain issue #794. I must confess that I've never understood the reason T.J. put the Also, are results variables mis-assigned in other tables (say, the distribution table with expanded-income BINS or the aggregate tables)? |
@martinholmer No problem.
I don't understand that either. PolicyBrain only uses the dictionary results. However, the DataFrames haven proven to be useful in this situation since I've been able to use them as the "truth" that I can check the PolicyBrain dictionary against.
Good question, I'll check. |
It looks like the distribution tables are the only problem. The difference tables and aggregate tables look good to me. Here's the updated script [Edited to show corresponding dataframe column names]:
and output:
|
This Tax-Calculator bug has been fixed in Tax-Calculator pull request 1834. Thanks @hdoupe for the extensive diagnosis of the problems caused by the bug. |
When I go to http://www.ospc.org/taxbrain/29588/ and click on the "Distribution Table" button and then on the "Income Deciles" button, I get these (obviously incorrect) results:
The most obvious problem is in the right-most three columns where the income tax liabilities and the payroll tax liabilities don't add up to the combined income and payroll tax liabilities.
Is this a problem with the results generated by Tax-Calculator?
Or is the display of the Tax-Calculator results incorrect in TaxBrain?
Either way there is a bug somewhere.
These results are from a TaxBrain run specified by the user who raised Tax-Calculator issue 1806.
The text was updated successfully, but these errors were encountered: