-
Notifications
You must be signed in to change notification settings - Fork 30
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
CBO baseline update #412
CBO baseline update #412
Conversation
@andersonfrailey Hi Anderson, the update of CBO Baseline, May 2022, has been completed in this PR. Can you have a check if everything looks ok to merge? |
Thanks for working on this, @bodiyang! Can you see how this would affect our projections and generate a report? You can do so following the instructions here. Also, you're right about the auto-updating scripts being out of date. I tried running them the other day and I think a few things have changed on CBO's side that broke the code. I'll see if there's a way to make them work again or if it's better to go back to doing things by hand. |
Have generated the report of 2022 in the last commit. |
Thanks! One more thing that I forgot about yesterday. Did you run the |
Trying to make it run right now~ Got an error from running "/Users/bodiyang/Desktop/taxdata/taxdata/createpuf.py", line 97, in |
Do you have access to the raw PUF? That's the file it's looking for here. If not, just run the make command for the CPS file, I can merge this, then do the PUF next |
issue: when running cps_stage2/stage2.py get the error as~ The above exception was the direct cause of the following exception: ---> at line 37 The problem of this error might be because the Stage_I_factors.csv is not updated in this link, which does not include the year 2032. Shall we have a try to merge the PR and see if this link will be updated with 2032 values? to pass the stage2.py script |
@bodiyang, I think your diagnosis is right, but let's do a quick fix instead of merging and then fixing just because I don't want the weights in the repo to be out of step with the projections and that would cause some issues with creating weights. If you update lines 65 and 66 to read as the following: try:
factor_match = _factors[year].equals(CUR_FACTORS[year])
except KeyError:
factor_match = False
try:
target_match = stage_2_targets[f"{year}"].equals(CUR_TARGETS[f"{year}"])
except KeyError:
target_match = False Similarly, lines 62 and 63 in try:
factor_match = Stage_I_factors[i].equals(CUR_FACTORS[i])
except KeyError:
factor_match = False
try:
target_match = Stage_II_targets[f"{i}"].equals(CUR_TARGETS[f"{i}"])
except KeyError:
target_match = False
This is a good catch too because it's a problem that'll pop up for every CBO update. I probably should've thought of it when I first wrote those lines so sorry about that! But if you add those lines in it shouldn't be an issue any more. |
Updating end year, exception for missing years
Thanks Anderson, solved this in another PR |
@andersonfrailey Have solved the bugs and everything looks good to me right now. Able to create CPS files by running |
Except for the test failures this is looking pretty good. But I don't really understand why the CPS projections don't change at all. I wouldn't expect much of a difference, but for there to be no difference feels fishy. I don't know if we can't get to a definitive answer as to why that's happening, but do you have any guesses? |
Thanks Anderson. Have fixed the testing problems in the last commit; Can you expand more on
Where/which point makes you think the CPS projections don't change? (I'm not sure is there a CPS projection file would be automated in taxdata and should reflect some changes there?) |
@bodiyang, there's a table in the PDF report that shows the year-by-year projections for the CPS and those are the same for both the old and new file. I also ran them through taxcalc myself just to verify and got the same results. It seems pretty unlikely to me that the exact same weights would be generated for each year after the CBO updates, but if after checking we can't find something that's wrong I guess we'll just have to accept it |
Got it, I will have another check on this to see if can figure out if anything goes wrong. |
follow up note: For cps.csv.gz, nothing is updated; For cps_weights.csv.gz, the value of 2032 is added, the value of all previous years is not changed. This is the reason why CPS projections don't change at all. So our issue can be narrowed down to check why cps.csv.gz and cps_weights.csv.gz remained unchanged or should they expected to be unchanged. I have checked the previous PR, these two files had been changed/updated. However in this update, these two files remained the same (year before 2031). |
@andersonfrailey So to speak, this problem is basically base files cps.csv.gz and cps_weights.csv.gz have been changed/updated, while the resulting CPS projections remain unchanged. Have discussed with @jdebacker @MattHJensen in the PSL meeting, and consider this is probably the problem of how taxdata generates report. I will conduct more investigation into this issue in report.py |
@andersonfrailey @jdebacker @MattHJensen Have run the code by hand in report.py. The issue why CBO projections showing no difference in the report is related to the decimal places. There are actually calculated differences, but too small to show up. For example the Current Payroll versus the New Payroll of the year 2023 in baseline CPS and new CPS are Full detailed results can be referred to values.docx So to speak, CBO projections indeed have changed because of the CBO update, while the differences are very small from this year's CBO update. We can then merge this PR, if think it's all right. |
Generated a new report with PUF |
Details of which files are used to construct the record class used in the report's tax liability analysis CPS comparison: PUF comparison: |
For posterity: We had a discussion today regarding the reports being generated by this PR. We believe that there is an issue with the reports script that causes the tables showing the difference in tax liabilities to be incorrect. We're going to generate those tables without using the reports function and post them here before merging. |
CPS Tax Liability values generated without using the reports function: |
Current PUF: |
@andersonfrailey Have generated the CPS and PUF tax liability without calling report.py, as documented in the previous conversation. I think the PR is good to merge right now, see if there is any other question. |
I still think it's weird that the CPS projections aren't changing more. However, I can't see anything wrong in this PR that would cause that to happen so I'm going to merge it so that we can get to the newer updates and I can work on #411 again. |
Merge pull request PSLmodels#412 from bodiyang/master
This PR updates Tax Data to the May 2022 CBO economic projections.
The update process follows Tax Data CBO Baseline Updating Instructions
However, the algorithm has been out of date and needs to be changed each year based on the format of the projection forms. Future updates for the Tax Data CBO Baseline updates can either be completed following the Updating Instructions with fair amount of code change or completed manually in the CBO_baseline.csv.