Fix JCT tax expenditure target handling in calibration#647
Closed
MaxGhenis wants to merge 2 commits into
Closed
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
Author
|
Superseded by #648, which uses the same branch pushed to the upstream repository so the required CI checks can run. |
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
This fixes the JCT target concept mismatch described in Fixes #646.
Changes:
reform_idthroughtarget_overview, target querying, matrix building, and staging validationincome_taxdeltas rather than raw deduction totalsreform_idpassthrough and reform target querying/namingWhy
JCT publishes tax expenditures, not deduction aggregates. The old path mixed SOI-style deduction totals with JCT revenue-loss targets, which materially distorted calibration for variables like
salt_deduction.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.