PolicyEngine / PolicyEngine/microcosm
Align UK UC claim, child and period definitions
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 0
- Forks
- 4
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 94
Description
This consolidates the remaining UC consumer-contract questions from #736 and #738, following the benefit-unit corrections in #727 and #813. It supports the UC investigation alongside #879 and #701; SPI generation remains tracked in #840. The evidence below is limited to public repository code and published aggregate source tables.
Reproducible discrepancies
- Paid versus all claims. The current contract at
eb7ca8a5countsuniversal_credit > 0against all-claim headline/composition rows. The pinned family × payment-indicator source has 90 cells: five family categories × Yes/No × April–December 2025. Summing the five family cells within each month, then averaging the nine months, gives 6,316,227.78 paid and 542,059.89 nil-payment claims. DWP explicitly retains some open claims with no payment. These quantities cannot be treated interchangeably. (Payment indicator definition) - The required joint is unavailable. The pinned feed contains family × payment indicator, family × child entitlement and child count × child entitlement. It does not contain payment indicator × child entitlement, or payment indicator × child count. Therefore pairwise margins cannot identify the paid/child-entitled composition joint. Child Entitlement Yes also does not turn the reported child-count axis into a count of qualifying children. Chronicle #233 and #234 closed the earlier ingestion requests; the remaining consumer alignment is still necessary.
- Monthly cash and annual model payments differ in timing. The unresolved bridge is to DWP's monthly payment amount, which includes third-party payments and one-off advances in their issue month. Dividing an annual model award by 12 does not establish that equivalence, especially for rare upper-band cells. (DWP amount definition)
- Observation periods need an explicit comparison contract. The public April–December 2025 series has nine monthly observations; the TCL methodology covers open claims during April and a 6 April 2017 birth cutoff. It includes exceptions and distinguishes its dependent/qualifying-child definition from the broader verified under-20 children reported on Stat-Xplore. A source April snapshot, a nine-month average and an annual model state need separate labels and a documented comparison.
Acceptance criteria and ownership
- Microcosm: declare and test each target's claim state, benefit-unit/child definition, geography, amount basis and source/model observation periods. Preserve separate all-claim, paid and nil-claim diagnostics; do not blindly rebind all-claim targets to paid margins.
- Microcosm: enforce the declared source-month set and record the actual averaging denominator. Retain April snapshot dates separately from annual assignment.
- Microcosm: establish the age/cohort anchor across the source year, model year and source observation date; preserve its provenance and test year transitions. If exact birth dates or open-claim state are unavailable, record the approximation and its sensitivity.
- Microcosm, with PolicyEngine-UK where model inputs are required: test TCL claimant roles, own qualifying children, exceptions and element denial separately, including nil-payment claims, 18–19-year-olds, multiple benefit units in one dwelling and the birth-date boundary. Claimant PIP and disabled-child elements must refer to the relevant claim's members.
- Microcosm: support only identifiable joints. Do not construct a joint from marginal products or rename reported children as qualifying children. Chronicle owns any additional publisher cross export.
- Microcosm: reconcile the headline and family cells using a common-vintage published total, unknown-family cells and disclosure tolerances. Chronicle #247/PR #250 owns the published-total/history feed update; the consumer comparison remains a Microcosm responsibility.
- Microcosm: audit joint support by reported-child count, own qualifying-child count, birth cohort, family roles and claim/payment state. Trace missing or thin cells through source stages before choosing generation changes; retain original-source lineage in diagnostics.
- Microcosm: compare repairs at a fixed optimizer budget and report target-specific original-source support, source contribution and leave-one-source-out sensitivity alongside global concentration and convergence. Do not alter target values or exclusions solely to improve fit.
Contributor 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.
Research direction
Start with packages/microcosm-build/src/microcosm/build/uk/uk_population_targets.json and the pinned Chronicle family-by-payment-indicator feed. No test path or implementation entry point is named, so trace the acceptance criteria through Microcosm's target-generation and calibration code, then verify separate claim states, source periods, supported joints, lineage, and sensitivity reporting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-engineering
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100