US local build: district targets that exist but are not in the fit

Open
#1,731 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
8/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Active
Tech stack
python

Research direction

This is a planning issue with open decisions, so a newcomer should not start a patch here. Read the three decisions and the linked #1728 and #1730 first. The concrete entry points are us/chronicle_feed_scope.json (ACS S0101 and S2201 scope), source_coverage.py, the REVIEWED_EXCLUDED_ALIASES and STATE_CD_DEFECTIVE_CD_FILE_MEASURES registers, and the --soi-mode and --cd-holdout-fraction options. Done means the local build fits the district age and household rows and reports their fit.

Written by the indexing model from the issue text.

Description

Problem

The local build fits one district family: population totals (436 rows, from the 2020 ladder). More district facts exist. This issue lists them, says what each one needs, and gives an order. It is the district part of #1728 (work items 3 and 4).

#1038 does not cover this. #1038 corrects three district tax families on the national full surface, and it adds no target.

District facts that exist today

Source Rows Where it is What it needs
IRS district file, all returns (--soi-mode state_cd) 21,743 district rows and 302 state rows The code is ready. It is opt-in, and no production build uses it #1036 for the state capital-gains level, a measured run, a ruling
District SALT and premium tax credit rows 974 and 487 specs Kept off state_cd by STATE_CD_DEFECTIVE_CD_FILE_MEASURES, because the feed pin reads the wrong IRS columns The corrected columns in the feed (PolicyEngine/chronicle#447, item 1.1). Then remove the register entries
ACS district population by age (S0101, 2024, 119th plan) 436 districts × 18 age bands In Chronicle at the feed pin, but not in the feed scope (us/chronicle_feed_scope.json). The national tool lists its alias under REVIEWED_EXCLUDED_ALIASES A scope change, a selection in the local tool, and a rule that ties the district rows to the state age rows
ACS district households (S2201, 2024, 119th plan) 436 districts × 3 rows: all households, with SNAP, without SNAP The same. source_coverage.py marks it as validation only (#240) The same for the household total. The SNAP rows stay a check
District tax_filer_individual_count 436 Kept off state_cd: no state parent A state parent
District rows of states with one district 459 and 360 specs Kept off state_cd: they are copies of the state total Nothing. They carry no district information

One more condition for the premium tax credit rows: ACA take-up is true on every ACS tax unit (#1720). The rows cannot enter the loss before a take-up draw exists.

District facts that do not exist yet

PolicyEngine/chronicle#447 requests them:

  • the IRS district file by AGI class (9 classes for each district);
  • IRS district columns that the package does not read. 15 of them have a state twin already: wages, total income, taxable income, the child tax credit, real estate taxes, taxes paid and state refunds;
  • ACS district income brackets (B19001) and households by type (B11001);
  • ACS district median income and poverty, as checks (#1673);
  • FNS county SNAP (#292).

Limits in the local tool

  • --soi-mode is one choice. state_cd has the district SOI rows, and state_county has the county rows. No mode has both. The County Files runbook uses state_county.
  • District plans. The IRS district file is on the 117th plan and the households carry 119th districts, so those rows pass through a population crosswalk. The ACS district packages are on the 119th plan and need no crosswalk. #1526 moves the districts to the 120th Congress.
  • Size. The dense matrix for the full surface needed 184 GiB before the sparse target matrix. #1067 then solved 27,148 district targets at 1.38M rows with a sparse operator. No run has measured state_cd on the build from #1719.

Work, in order

  1. ACS district age and households.
    • This needs no Chronicle work and no re-pin: add the two packages to the feed scope.
    • Select the rows in the local tool.
    • Bind each district row as a share of its state row, so that the state level stays with the state source (Census age groups, PR #1531).
    • ACS records can meet these targets without donor rows.
  2. District SOI rows (state_cd), after #1036.
    • Measure memory, time, ESS and held-out error first.
    • Use the holdout that exists (--cd-holdout-fraction).
  3. District SOI rows and county rows in one run. This belongs with the declared target set of #1728 (work item 1).
  4. SALT and premium tax credit district rows, after PolicyEngine/chronicle#447 item 1.1.
  5. New families as Chronicle delivers them. Income brackets are first.

Rules for every step:

  • Score a new family as a held-out check before it enters the loss.
  • Group the changes that move outputs into few builds. Choose λ again after them (#1730).

Decisions needed

  1. Which district families enter the loss, and which stay as checks.
  2. Whether district age rows bind as shares of the state row or as levels. The district source is a survey (ACS), and the state source is the Census estimates.
  3. Whether district SOI rows enter the loss before the starting weights change (#1727). They are tax targets, and ACS rows carry tax detail only as a transfer from donor rows.

Done when

  • The local build fits the district age and household rows and reports their fit. The state slices stay within tolerance.
  • A measured run of state_cd exists, and a ruling follows it.
  • The kept-off register has no entry for a column that the feed reads correctly.

Related

#1730, #1728, #1038, #1036, #1040, #1224, #1528, #240, #292, #625, #1526, #1673, PolicyEngine/chronicle#447.

Dominant language
Python
Stars
0
Forks
6
Avg merge
1d 17h
Merged PRs (30d)
190

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PolicyEngine/microcosm

All issues in PolicyEngine/microcosm

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.