Align itemized deduction targets with SOI itemizers and JCT tax expenditures#639
Merged
Conversation
SOI targets for SALT, real estate taxes, and medical expense deduction are reported only for the ~10% of filers who itemize, but the existing `variable > 0` constraint captures everyone with economic exposure (~80-90% of filers). This mismatch causes massive count and dollar overestimates. Adding `tax_unit_itemizes == 1` fixes the population alignment. Changes: - etl_irs_soi.py: For salt, real_estate_taxes, and medical_expense_deduction, append a `tax_unit_itemizes == 1` constraint to child strata in the generic target loop. - etl_national_targets.py: Split JCT itemized deduction targets (salt_deduction, medical_expense_deduction, charitable_deduction, interest_deduction) into a separate itemizer_targets list loaded into a new "United States - Itemizing Tax Filers" stratum with both filer and itemizer constraints. QBI deduction remains in the plain filer stratum (above-the-line). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
Reviewed the economics and the calibration-path changes in detail. The SOI-side itemizer constraint fix is correct, and the follow-up JCT changes now fix the real concept mismatch: these national JCT rows are tax expenditures, not baseline deduction aggregates. With the I don't see a remaining blocking correctness bug. The follow-up items I still want are non-blocking cleanup work:
I'm planning to merge this and open a focused cleanup PR for those items. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #646.
This PR does two related things for itemized-deduction calibration targets:
Changes:
tax_unit_itemizes == 1to the SOI strata forsalt,real_estate_taxes, andmedical_expense_deductionreform_idthroughtarget_overview, target querying, matrix building, and staging validationincome_taxdeltas rather than raw deduction totalsreform_idpassthrough and reform target querying/namingWhy
The original SOI fix was directionally correct, but the JCT side still treated tax expenditures as deduction aggregates. JCT publishes revenue-loss estimates, not raw deduction totals, so calibration needs to target repeal-based
income_taxdeltas for those rows.Validation
python3 -m py_compileon all edited filestarget_overviewand best-period target query logicEnvironment limitation
I could not run the repo's normal pytest path in this workspace because the available environments are broken on
torchand missingsqlmodelin the fallback Python.