US local build: district targets that exist but are not in the fit
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
- Domain
- data, machine-learning
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-modeis one choice.state_cdhas the district SOI rows, andstate_countyhas the county rows. No mode has both. The County Files runbook usesstate_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
fullsurface 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 measuredstate_cdon the build from #1719.
Work, in order
- 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.
- District SOI rows (
state_cd), after #1036.- Measure memory, time, ESS and held-out error first.
- Use the holdout that exists (
--cd-holdout-fraction).
- District SOI rows and county rows in one run. This belongs with the declared target set of #1728 (work item 1).
- SALT and premium tax credit district rows, after PolicyEngine/chronicle#447 item 1.1.
- 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
- Which district families enter the loss, and which stay as checks.
- 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.
- 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_cdexists, 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
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PolicyEngine/microcosm
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
PolicyEngine/microcosm#1766 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
PolicyEngine/microcosm#1721 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
PolicyEngine/microcosm#1701 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PolicyEngine/microcosm#1638 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
PolicyEngine/microcosm#1431 ·
Maintainers usually reply within 1 day
All issues in PolicyEngine/microcosm
Similar issues
-
claude-subscription-directsdk: tool calls with raw control characters in string values are droppedOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
NousResearch/hermes-official-plugins#538 ·
Maintainers usually reply within 3 days
-
bug(qdiffusion): EnergyModel.score_visible_logits computes biased visible/hidden on-ratios when solver returns variable solution counts per candidatePossibly taken @houzhongyu claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
qboson/kaiwu-pytorch-plugin#2133 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
MakazhanAlpamys/Soup#3415 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days