Skip to content

Use person-weighted groups for income-decile impacts #218

Description

@anth-volk

Problem

UK Chat delegates decile statistics to policyengine.py, but the upstream
fallback grouping used pandas.qcut. That ignored MicroSeries weights and
assigned deciles by raw survey rows.

For household income distributions, computed groups should be person-weighted:

MicroSeries(
    income,
    weights=household_weight * household_count_people,
).decile_rank()

Resolution

Keep the weighting implementation in policyengine.py, not UK Chat:

  • Default decile impacts to household net income and person-weighted groups policyengine.py#486 provides shared person-weighted fallback
    groups for DecileImpact and IntraDecileImpact.
  • UK Chat pins the exact upstream commit until the first containing release is
    available.
  • UK Chat continues to pass its three public concepts explicitly:
    household_net_income, equivalised_hbai_net_income, and wealth.
  • UK Chat does not materialize decile assignments or manipulate survey weights.
  • Wealth impacts continue to pass the precomputed
    household_wealth_decile.

No policyengine-uk change is required.

Acceptance criteria

  • UK Chat contains no local weighted-grouping implementation.
  • Ordinary and explicit equivalised-HBAI income concepts use upstream computed
    person-weighted groups.
  • Wealth grouping remains explicit and precomputed.
  • The upstream dependency is pinned immutably and covered by backend tests.
  • Prompts, tool descriptions, and runtime guidance reflect the calculation
    boundary.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions