Remove Additional Medicare Tax from fiitax to match NBER taxsimtest#963
Merged
Conversation
NBER TAXSIM-35 (taxsimtest) reports the Additional Medicare Tax (Form 8959) in a separate `addmed` column per Form 1040 Line 23 / Schedule 2 Line 11, not as part of regular income tax. PE was adding it to `fiitax`, which caused PE to overshoot TAXSIM by exactly the AddMed amount on every record above the $200K single / $250K MFJ threshold. On the eCPS n=2000 TY 2025 sample this represented ~$412K (95%) of the residual federal mismatch with correlation 0.997 between the actual diff and 0.9% × (wages − threshold). Per IRC § 3101(b)(2) and § 1401(b)(2), the 0.9% AddMed is statutorily distinct from the regular income tax bracket calculation. PE's `income_tax` already includes NIIT via `income_tax_before_refundable_credits`; that is the correct match for TAXSIM's `fiitax`. AddMed continues to flow out through the `v44` output column (`employee_medicare_tax + additional_medicare_tax`). The `frate` marginal-rate calculation mirrors the same fiitax definition, so it also drops AddMed to avoid a spurious 0.9% step above threshold. eCPS n=2000 TY 2025 (non-S-corp): Federal $$ off: $432,768 → $40,730 (−90.6%) Federal $15 match: 93.6% → 97.3% >$1M bucket $$ off: $325K → $18K (−94%) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The pre-existing `test_fiitax_includes_additional_medicare_tax_when_precomputed` guarded the removed behavior and was failing across the CI matrix. Rewrite it to assert the inverse: `fiitax` is populated from `income_tax` alone, and `additional_medicare_tax` is never invoked during fiitax assembly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Stop adding
additional_medicare_taxto thefiitaxoutput. NBER TAXSIM-35 (taxsimtest) reports the Additional Medicare Tax (Form 8959) in a separateaddmedcolumn rather than rolling it into regular income tax — matching Form 1040 Line 23 / Schedule 2 Line 11. PE'sincome_tax(which already includes NIIT) is the correct match for TAXSIM'sfiitax.Why
This was the dominant remaining federal mismatch on the eCPS comparison after #961 / #962. On the n=2000 TY 2025 sample:
|fed_diff|and0.9% × (medicare_wages − threshold)was 0.997 — almost a perfect fit, indicating a single source.3.8% × $... = $...for AddMed.Verified by probing the live binary used by our compare flow:
fiitaxhere is justv28(income tax only). AddMed comes out separately. PE was reportingfiitax = income_tax + additional_medicare_tax, hence the consistent ~AddMed-sized overshoot.Statute / form anchors
Changes
policyengine_runner.py: drop the AddMed add-on from both thefiitaxoutput assembly and thefratemarginal-rate calculation (which had to mirror the fiitax definition, including a comment that referenced the now-removed addition).tests/test_addmed_excluded_from_fiitax.py: two pinning tests using NBERtaxsimtestsmoke values as targets:fiitax ≈ $140,265 ±$200fiitax ≈ $285,321 ±$300Both targets are tight enough that adding back AddMed (~$2,700 / ~$6,000) would break them cleanly.
changelog.d/remove-addmed-from-fiitax.fixed.md.eCPS n=2000 TY 2025 (non-S-corp,
--disable-salt --assume-w2-wages)Per-bucket federal $$ off
Test plan
test_single_500k_fiitax_excludes_addmed,test_mfj_1m_fiitax_excludes_addmed)pytest tests/passestest_otherprop_niit.py::test_otherprop_does_not_trigger_qbidcontinues to hold (the otherprop-NIIT target$353,188for the synthetic probe matchestaxsimtestbecause the synthetic record has no wages → no AddMed component)