Add TAXSIM-compatible marginal tax rates (frate, srate, ficar)#770
Merged
PavelMakarchuk merged 9 commits intomainfrom Mar 19, 2026
Merged
Add TAXSIM-compatible marginal tax rates (frate, srate, ficar)#770PavelMakarchuk merged 9 commits intomainfrom
PavelMakarchuk merged 9 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…car) Implements marginal rate calculation matching TAXSIM-35 methodology: - Perturbs employment income (wages only, not self-employment) - Splits perturbation proportionally between primary and spouse (weighted average earnings, matching TAXSIM mtr=11) - Uses $100 delta for float32 precision stability - Returns rates as percentages to match TAXSIM output format Rates are computed via a second simulation (branch in microsim path, deepcopy in single-household path) measuring the change in each tax component independently: - frate: federal income tax marginal rate - srate: state income tax marginal rate - ficar: FICA (employee payroll tax) marginal rate Depends on policyengine-us#7791 for upstream variable support. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add marginal rate methodology section to documentation page - Mark frate/srate/ficar as implemented in output variable table - Show descriptive variable names (e.g., "income_tax (via perturbation)") Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…XSIM-35 TAXSIM-35 reports ficar as the combined employee+employer FICA rate (~15.3%), not just the employee portion (~7.65%). Updated both the single-household and batch paths to sum employee_payroll_tax, employer_social_security_tax, and employer_medicare_tax. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
449a2aa to
ef68160
Compare
- frate now includes additional_medicare_tax in the perturbation, matching TAXSIM's definition of federal marginal rate - Disable ficar (TAXSIM always returns 0 for this field) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The exe/output_mapper code path in marginal_rates.py still had the old bugs: frate missing additional_medicare_tax and ficar still being computed. Align with the microsim-path fixes from e4a60b6. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <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
Implements marginal tax rate computation matching TAXSIM-35 methodology, enabling comparison of marginal rates between PolicyEngine and TAXSIM.
Methodology (matching TAXSIM-35)
mtr=11)Implementation
policyengine_runner.py): Uses simulation branching to compute perturbed taxes vectorizedoutput_mapper.pyviamarginal_rates.py): Deep-copies the situation and runs a second simulationChanges
policyengine_taxsim/core/marginal_rates.py— shared marginal rate computationvariable_mappings.yaml— frate/srate/ficar marked as implementedpolicyengine_runner.py— microsim marginal rate computation via branchingoutput_mapper.py— single-household marginal rate supportTest plan
Dependencies
🤖 Generated with Claude Code