Add federal vs. state budgetary impact to economic_impact_analysis#296
Open
Add federal vs. state budgetary impact to economic_impact_analysis#296
Conversation
Adds BudgetaryImpact model with federal/state/total fields, exposed on PolicyReformAnalysis and via a new standalone calculate_budgetary_impact helper. Federal = change in income_tax + payroll_tax minus change in federal_benefit_cost; state = change in state_income_tax minus change in state_benefit_cost. The arithmetic lives here (not in policyengine-api) so every consumer — API, analysis notebooks, ad-hoc scripts — reuses a single implementation. Requires policyengine-us with federal_benefit_cost / state_benefit_cost aggregates (PolicyEngine/policyengine-us#8076). Pin bump is separate. Closes #289.
This was referenced Apr 19, 2026
Open
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
Partitions US reform budgetary impact into federal vs. state shares:
BudgetaryImpact(federal/state/total) model added toPolicyReformAnalysiscalculate_budgetary_impact(baseline_sim, reform_sim) -> BudgetaryImpacthelperexamples/us_budgetary_impact.pyCloses #289.
Formulas
Where
federal_benefit_costandstate_benefit_costare the PE-US aggregates from PolicyEngine/policyengine-us#8076 that sum federal/state shares of Medicaid (FMAP) and CHIP (eFMAP). As more programs gain attribution (SNAP OBBBA FY2028, SSI, etc.), the aggregates grow automatically via the parameter-drivenaddslist — no changes needed here.Why here vs. in policyengine-api
The arithmetic is thin sums over microsim outputs. Every consumer — API, notebooks, ad-hoc scripts — needs the same split; putting it behind the
.pypackage means one implementation. The API follow-up (PolicyEngine/policyengine-api#3481) becomes a pass-through.Test plan
pytest tests/test_budgetary_impact.py -v— 4 unit tests pass (federal-tax-cut, Medicaid expansion rollback fed/state split, mixed, zero-reform)policyengine-us >= 1.XXX.Y)Scope notes
household_state_benefits) are not folded in here — this exposes only the shared-funding programs infederal_benefit_cost/state_benefit_cost. Follow-up can addfederal_only_benefit_costandstate_only_benefit_costaggregates if useful; for now users can compute those directly.state_income_taxis fully state (true) andincome_tax+payroll_taxis fully federal (true). Not yet modeled: local income taxes, state-level tax credits that show up under federal variables.Related