Skip to content

Count SNAP households by average month in the take-up fill and the target - #1851

Open
DTrim99 wants to merge 1 commit into
mainfrom
snap-average-month-1713
Open

DTrim99 wants to merge 1 commit into
mainfrom
snap-average-month-1713

Conversation

@DTrim99

@DTrim99 DTrim99 commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #1713.

What changes

FNS counts SNAP households as an average over the fiscal year's months. The build counted them two other ways:

  • The take-up fill asked the engine for is_snap_eligible for the year, which policyengine-core answers with December. A unit eligible only earlier in the year sat outside the count but kept its drawn flag, and a unit eligible from October counted as a whole household. Units eligible in December with a zero benefit all year counted toward the FNS caseload too.
  • The household target counted every SPM unit with a positive annual snap as a whole household.

Both now count each SPM unit by the share of the year's twelve months in which it has a positive benefit.

  • Fill (snap_state_take_up). The eligibility pass can return each unit's share of months with a positive snap_if_takes_up (benefit_month_share=True). The stage's domain is units with any such month, and a new snap_month_weight (unit weight times share) weights the rate prior, the greedy count calibration (the manifest's weight) and the diagnostics. Without shares, the stage falls back to the December flag as a 0/1 share, so the old basis is still available and the frozen main-baseline batch-loop tests are unchanged. Diagnostics move to schema 2 with benefit_month_basis.
  • Target (snap_households). A new register key, indicator_months: mean, averages a count target's indicator over the year's months. The household collapse is linear, so the column is the mean of the twelve monthly columns. The key applies only to indicator_sum and less_than_indicator_sum; an amount refuses it. _calculate_array and the two household-value evaluators take a period, defaulting to PERIOD.

What it should do to a build

From #1713's measurement on populace-us-2024-spm-20260915 (policyengine-us 2.145.3):

  • the average month has 4.6% fewer units with a benefit than the year has units with any benefit (22.50M against 23.58M), so the target no longer pulls the average-month caseload below FNS;
  • 7.0% of December-eligible units nationally are not eligible in June, mostly from the October update (Colorado 39%, New Mexico 25%, Maine 18%), and now count for their months;
  • 0.87M December-eligible units with no benefit all year leave the fill's count;
  • while builds stay on policyengine-us 2.145.3, Idaho's January–June units (from the parameter error fixed in policyengine-us#11194) count as half a household instead of a whole one.

Moving builds to policyengine-us 2.153.1 or later removes the Idaho and Colorado steps at their source. This PR fixes the counting in every state either way.

Cost

The eligibility pass computes snap_if_takes_up for twelve months instead of is_snap_eligible for December. The target pass reads snap monthly, which the annual calculation has already cached.

Interaction with #1850

#1850's persons target (#1843) uses the annual basis. Whichever of the two merges second should add indicator_months: mean to the persons entry, so both targets count the same units the same way.

Interaction with #1857

#1857 (#1712 part 2) changes the same stage's draw (snap_fill_draw), and this PR changes its count weight. They edit neighboring lines of the stage module and of the calibrate_binary_assignment operation, so whichever merges second needs a small rebase. They don't interact in behavior.

Tests

  • Engine-free: the stage weights units by month share in the rate prior, calibration and diagnostics; a part-year unit counts for its months; a unit with no benefit month is outside the domain; bad shares are refused; the manifest declares the month weight; the builder's month share counts months with a positive benefit and December stays the default; indicator_months refuses amounts and other values.
  • Engine (engine_workflow/us/test_us_snap_average_month_targets.py): on the real-engine fixture, the month-mean target column equals the mean of monthly snap > 0 collapsed to households and never exceeds the annual indicator, and the batched month share equals the unbatched one and the engine's monthly values.
  • Repin sequence, then the three --check runs and ci_test_plan.py verify, all clean. The INDICATOR_LEDGER_TARGETS digest pin moves.
  • Targeted tests pass, the two engine tests among them on policyengine-us 2.145.3. I didn't finish the full engine-free job locally, so CI is the check for the rest.

🤖 Generated with Claude Code

)

FNS counts households as a fiscal-year average of monthly caseloads. The
take-up fill read December eligibility (policyengine-core's answer to a year
request for the monthly is_snap_eligible) and the household target counted any
SPM unit with positive annual snap as a whole household. Both now count a unit
by the share of the year's months with a positive benefit:

- the eligibility pass can return each unit's share of months with a positive
  snap_if_takes_up; the take-up stage weights the rate prior, the greedy count
  calibration and its diagnostics by snap_month_weight (weight times share);
- a new register key, indicator_months: mean, averages a count target's
  indicator over the year's months, and the household target uses it.

Without month shares the stage falls back to the December flag, so the default
eligibility pass and its frozen main-baseline batch tests are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SNAP household target counts part-year recipients as whole households, and take-up reads December eligibility only

1 participant