Skip to content

Port the UK stochastic layer: take-up anchoring, identity-keyed draws, LHA/BRMA, provenance flags #680

Description

@juaristi22

Workstream E4 of the UK-migration master epic #665; child of #145.

Scope

  • Port the reported-receipt take-up anchoring (utils/takeup.py: reported recipients take up with certainty; the residual target count fills across non-reporters at an adjusted rate), applied at benunit level to child benefit, pension credit, and universal credit as the incumbent does.
  • The 11 take-up + 3 stochastic parameter files land as committed build/uk/ JSON resources with citations, referenced by stage manifests — never Python literals.
  • Identity-keyed draws: a UK twin of the US _stable_draws (blake2b over entity id + seed + per-stage salt) replaces the incumbent's sequential rng streams. Unit-record draws therefore differ from the incumbent by construction — a standing signed-difference class; parity is weighted-distributional only, which UKDS disclosure rules require anyway. Incumbent seed constants recorded as documentation (brma 0, take-up 100, property 0, has_fuel 42, cgt 0/1, salary sacrifice 2024, student loans 42).
  • LHA/BRMA assignment through the declared rules-engine adapter (LHA_category is real model logic; duplicating it invites drift); the BRMA rent table is a pinned resource.
  • TV licence ownership/evasion, first-time-buyer, and property-purchase draws; household_is_* provenance flags as first-class columns (the calibration diagnostics auto-discover them).
  • UC take-up stays at the incumbent's 0.55 for the parity build (changing it moves every UC column against the frozen register); follow-up on the caseload undercount is tracked against policyengine-uk-data#452 and WS-D.

Acceptance

  • Every stochastic assignment has a determinism test: two runs identical, and row-permutation identity-stability (permute the frame, run, un-permute — values identical per entity id).
  • Rates are declared stage parameters with citations; BRMA distribution by region × LHA category within tolerance, with the RNG-stream divergence signed.

UK-specificity note (required in the PR)

Take-up program semantics and BRMA geography are UK; the anchored-assignment and identity-keyed-draw operations should be generic (the US already has assign_binary_from_rate / calibrate_binary_assignment). List anything beyond that and why.

Depends on: E3; the E1 adapter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions