Skip to content

Date the mixed-age couple Pension Credit exclusion and model the SI 2019/37 saving - #1940

Open
MaxGhenis wants to merge 5 commits into
mainfrom
pension-credit-mixed-age-saving
Open

MaxGhenis wants to merge 5 commits into
mainfrom
pension-credit-mixed-age-saving

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

is_pension_credit_eligible required every adult in the benefit unit to be over State Pension age, in every year. That creates two errors:

  • Before 15 May 2019 it applied the mixed-age couple exclusion (State Pension Credit Act 2002 s.4(1A)), which only started then (SI 2019/37 art. 3). Mixed-age couples could claim Pension Credit and pension-age Housing Benefit before that date, but PolicyEngine paid them Universal Credit.
  • After 15 May 2019 it ignored the SI 2019/37 art. 4 saving. A couple entitled to Pension Credit or pension-age HB on 14 May 2019 keeps them while it stays entitled, but PolicyEngine never paid such a couple Pension Credit.

housing_benefit_eligible (#1901) approximated the saving by a reported HB award, which only helps couples with would_claim_uc False and never pays them Pension Credit.

Law (legislation.gov.uk, read 2026-09-30; point-in-time versions checked)

  • SPCA 2002 s.1(2)(b): the claimant must have reached the qualifying age. Before 15.5.2019, s.4 had only (1), which excludes a claimant whose partner is entitled to Pension Credit, so the older member of a mixed-age couple could claim. The version valid 2019-02-01 to 2019-05-15 has no (1A).
  • s.4(1A), inserted from 15.5.2019 by WRA 2012 Sch 2 para 64 and SI 2019/37 art. 3: "A claimant is not entitled to state pension credit if he is a member of a couple the other member of which has not attained the qualifying age."
  • SI 2019/37 art. 4(1)-(2): s.4(1A) is treated as not in force for a member of a mixed-age couple who, on 14 May 2019 and as part of that couple, was entitled to Pension Credit, Housing Benefit, or both. The saving ceases on any later day when the member is entitled to neither as part of the same couple. Art. 2(3) says Housing Benefit here means HB under the pension-age (SPC) regulations only. Northern Ireland: SR 2019/4 arts 3-4, same date and text.
  • UC (TP) Regs 2014 reg 6A(4)-(5): a new HB claim is allowed where both members of the couple have reached the qualifying age, or where the older member of a mixed-age couple has an unceased art. 4 saving; any art. 4(1) saving counts, including Pension Credit alone.
  • UC (TP) Regs 2014 reg 5(1)(d): no Pension Credit for any period of UC entitlement. So a family is on one route or the other.
  • UC Regs 2013 reg 3(2)(a): mixed-age couples could claim UC jointly throughout, so before 2019 they could choose either route.

Change

  • Parameter gov.dwp.pension_credit.mixed_age_couples.excluded: false from 2003-10-06, true from 2019-05-15. Parameters are read at 30 April of the model year (convert_to_fiscal_year_parameters), so model year 2019 (2019-20) reads false and 2020 onward true. Everyone entitled on 14 May 2019 kept their benefits, so the old rule is the closer approximation for 2019-20.
  • Parameter ...mixed_age_couples.saving_latest_birth_year = 1954. Art. 4 needs the older member to have been over the qualifying age on 14 May 2019, which means being born on or before 5 February 1954 (Pensions Act 1995 Sch 4; SPCA s.1(6)). With whole-year ages the model admits all of 1954.
  • is_mixed_age_couple (SI 2019/37 art. 2(2)(a)): exactly two claimant or partner adults, excluding a child or qualifying young person for Pension Credit, one over and one under State Pension age. A single pensioner with an 18 or 19 year old dependant in education is not a mixed-age couple.
  • has_mixed_age_couple_pension_credit_saving: an input that can be set directly. By default it is inferred when all of these hold:
    • the couple is mixed-age and its older member was born by 1954;
    • it reports Pension Credit, or its pension-age member reports HB without IS, income-based JSA or income-related ESA. Art. 2(3) counts only HB under the pension-age regulations, which apply to a claimant over the qualifying age (reg 5(1)) and not to a couple on an income-related legacy benefit (reg 5(2));
    • it reports no Universal Credit (UC entitlement means no PC or HB entitlement, which ends the saving under art. 4(2)).
  • meets_pension_credit_age_conditions = every adult over State Pension age, or a mixed-age couple where the exclusion is not in force or the saving applies. It is used in three places:
    • is_pension_credit_eligible;
    • housing_benefit_eligible, for new pension-age claims (reg 6A(4)-(5)). The reported-HB continuing-award route stays for other families;
    • is_uc_eligible, negated (reg 5(1)(d)), so a family is never on both routes.

Two modelling choices, stated in the code:

  • Before 15 May 2019, a mixed-age couple reported on UC stays on UC, and any other takes the Pension Credit route. The law let them choose either (UC Regs reg 3(2)(a)), and PolicyEngine has no roll-out geography or better-off comparison.
  • A saved couple is kept on the Pension Credit route, anchored to its reported PC or HB. In law it could instead claim UC jointly and lose the saving (art. 4(2)).

Household results (real runs, main 44240bd → this branch)

Case (council rent £6,240, State Pension £9,000, council tax £1,500) Pension Credit HB UC CTR Net income
2026, 75+60, reports PC 0.00 → 9,889.00 0.00 → 6,240.00 14,243.64 → 0.00 838.11 → 1,500.00 22,601.71 → 25,328.96
2026, 75+60, reports HB 0.00 → 9,889.00 0.00 → 6,240.00 14,243.64 → 0.00 0.00 21,763.60 → 23,828.96
2026, 70+60, reports PC (older member reached SPA after May 2019) 0.00 0.00 14,243.64 838.11 22,601.71
2026, 70+60, no reports 0.00 0.00 14,243.64 838.11 22,601.71
2018, 70+60, no reports 0.00 → 3,937.60 0.00 → 6,240.00 12,226.68 → 0.00 68.90 → 1,500.00 20,995.04 → 20,377.05
2019, 70+60, no reports 0.00 → 4,273.00 0.00 → 6,240.00 12,226.68 → 0.00 68.90 → 1,500.00 20,991.04 → 20,708.46
2020, 70+60, no reports 0.00 0.00 13,398.96 0.00 22,091.42

The 2018 and 2019 couples get less net income on this branch than on main. Main's UC leaves State Pension out of unearned income, contrary to UC Regs regs 66(1)(a) and 67, so main overstates their UC. That is a separate bug.

Invariants (tests)

policyengine_uk/tests/test_mixed_age_couple_properties.py is a Hypothesis test over 40 derandomized households:

  • Shapes: single and couple pension-age, mixed-age, and single and couple working-age, each also with an 18-year-old dependant in education where it applies.
  • Years: 2018, 2019, 2020, 2025 and 2026.
  • Varied: reported PC, HB, UC and ESA; would_claim_uc and would_claim_pc; tenure, rent and savings.

Invariants checked:

  • P1/P2: PC > 0 ⇒ UC = 0, and HB > 0 ⇒ UC = 0.
  • P3: meeting the Pension Credit age conditions ⇒ not UC-eligible.
  • P4: the saving input is inert for units that are not mixed-age couples.
  • P5 (differential): against the pre-change formulas, kept verbatim in the test, non-mixed units and unsaved mixed-age couples from 2020 are unchanged, for PC, HB, UC and net income.
  • P6: the saving never lowers PC or HB and zeroes UC.
  • P7: in 2018 and 2019, every mixed-age couple not reported on UC is on the PC route.
  • P8: the default saving is never set for an older member born after 1954, or with reported UC.

mixed_age_couples.yaml has 16 hand-computed cases:

  • the saving from the input, from reported PC and from reported HB;
  • HB alongside income-related ESA carries no saving;
  • reported UC ends the saving;
  • the birth-year gate;
  • 2018 and 2019 on the PC route, and 2020 excluded;
  • would_claim_pc False;
  • the pension-age couple allowance;
  • Northern Ireland;
  • a single pensioner with an 18-year-old dependant is not a mixed-age couple;
  • a mixed-age couple with a dependant can keep the saving;
  • HB reported by the younger member sets no saving;
  • a couple reported on UC before 2019 stays on UC;
  • wholly pension-age and working-age couples unaffected.

Existing test updated: invariant 3 of #1901's test_housing_benefit_pension_age_properties.py (dataset mode). A saved mixed-age couple is now HB-eligible on the new-claim route as well as the continuing-award route. The test computes the expected saving from the drawn unit (mixed-age shape, HB reported by the pension-age claimant, born by 1954), not from model output.

All 1,303 YAML policy tests pass locally, as do the parameter metadata and fiscal-year parameter tests.

Dataset impact (real runs of main 44240bd and this branch)

Two Enhanced FRS 2024-25 builds are in use locally. Build A (md5 10a924c0, 126.6 MB) is the copy most review sessions use. Build B (md5 beba41cc, 127.5 MB) is the newer published download.

A 2025 A 2026 B 2025 B 2026
Pension Credit +£386.6m +£341.1m +£456.3m +£408.2m
Housing Benefit +£34.6m +£13.8m +£37.8m +£11.6m
Universal Credit −£101.5m −£36.1m −£116.4m −£30.5m
Council Tax Reduction +£0.8m +£1.0m +£0.6m +£0.8m
Household net income +£322.9m +£322.2m +£380.4m +£392.3m
Households gaining / losing 21.6k / 3.9k 16.8k / 2.2k 28.5k / 4.4k 23.2k / 1.9k
Mixed-age units eligible for Pension Credit (age conditions plus GC or SC conditions) 24.1k 19.9k 30.7k 25.9k
Change for any unit that is not a mixed-age couple 0 0 0 0
Units with PC and UC, or HB and UC 0 0 0 0

Caveats:

  • Few records. The change rests on 24-36 survey records, which come in duplicated pairs, so it is imprecise.
  • Static ages. Enhanced FRS ages do not advance between model years, so the birth-year gate protects one fewer cohort each year. policyengine-uk-data should set has_mixed_age_couple_pension_credit_saving at build time from survey-year ages.
  • Losers. Most are couples whose UC on main leaves State Pension out of unearned income (fixed separately in Count State Pension as Universal Credit unearned income #1943). With State Pension counted, every 2026 loser gains. In 2025, a small number of saved couples, all from one survey household, are put on the Pension Credit route where the model computes no Pension Credit, so they lose UC. That is the second modelling choice above; a better-off comparison between the routes is a follow-up.

Coordination (checked with git merge-tree)

Whoever merges second should re-run both property tests.

Not modelled

axiom: uk/statute/ukpga/2002/16/4 + uk/regulation/uksi/2019/37/article/4 TheAxiomFoundation/rulespec-uk#359 queued (extended), TheAxiomFoundation/rulespec-uk#370 queued (extended)

🤖 Generated with Claude Code

…019/37 saving

is_pension_credit_eligible required every adult to be over State Pension
age in every year, so PolicyEngine applied SPCA 2002 s.4(1A) before its
15 May 2019 commencement (SI 2019/37 art. 3) and ignored the art. 4 saving
afterwards. A mixed-age couple got UC in 2018 where the law allowed Pension
Credit and pension-age HB, and a protected couple never got Pension Credit.

Add meets_pension_credit_age_conditions (every adult over State Pension
age, or a mixed-age couple before the exclusion or with the saving) and use
it for Pension Credit, for new Housing Benefit claims (TP Regs reg 6A(4)-(5))
and, negated, for Universal Credit (TP Regs reg 5(1)(d): one route per
family). The saving, has_mixed_age_couple_pension_credit_saving, is an
input that defaults to reported Pension Credit or pension-age HB without
reported UC, where the older member was born by 1954.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis

Copy link
Copy Markdown
Collaborator Author

Overlap note from #1896: that PR also rewrites is_pension_credit_eligible.py. It replaces the is_adult count with is_claimant_or_partner (SPCA 2002 s.4: the claimant and any partner, not a dependent 18- or 19-year-old), and adds a comment that the SI 2019/37 art. 4 saving is not modelled, which this PR models. Whichever merges second should keep both: the claimant-and-partner member set from #1896 and the mixed-age saving from this PR, and drop that comment.

- is_mixed_age_couple counts only the claimant and partner (adults who are
  not a child or qualifying young person for Pension Credit), so a single
  pensioner with an 18 or 19 year old dependant in education is not a
  mixed-age couple and stays on main's route.
- Only Housing Benefit reported by the pension-age member sets the SI
  2019/37 saving: art. 2(3) counts HB under the pension-age regulations,
  which apply to a claimant over the qualifying age (HB(SPC) reg 5(1)).
- Before 15 May 2019 a couple reported on Universal Credit stays on it.
- State the Pension Credit routing of saved couples and pre-2019 couples as
  modelling choices, not a consequence of TP Regs reg 5(1)(d).
- The HB dataset-mode invariant computes the expected saving from the
  drawn unit rather than from model output; the mixed-age properties draw
  dependant shapes. Four YAML cases added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis

Copy link
Copy Markdown
Collaborator Author

An independent Opus review (in-session) returned REQUEST_CHANGES with three should-fix items and four nits. All are addressed in 24f59a4:

  • A single pensioner with an 18 or 19 year old dependant was flagged as a mixed-age couple (relation_type treats any two adults as a couple). is_mixed_age_couple now counts only the claimant and partner, meaning adults who are not a child or qualifying young person for Pension Credit. This shape therefore stays on main's route, and a mixed-age couple with a dependant can still keep the saving. Both are pinned in YAML and drawn in the property test.
  • The HB invariant used model output as its oracle. It now computes the expected saving from the drawn unit: mixed-age shape, HB reported by the pension-age claimant, born by 1954.
  • Losers caveat and the Pension Credit-route count. Both are reworded in the PR body. Most losers are couples whose UC on main leaves out State Pension (Count State Pension as Universal Credit unearned income #1943). In 2025, a few saved couples from one survey household are put on the PC route where the model computes no PC. The unit count now states its definition.
  • Saved couples barred from UC; the pre-2019 route. Both are now stated in the code as modelling choices. Before May 2019, a couple reported on UC stays on UC. The unsourced empirical claim is removed from the PR body.
  • HB reported by the younger member. It no longer sets the saving (art. 2(3) with HB(SPC) reg 5(1)).
  • Coordination section. Rewritten to match git merge-tree against Use the State Pension Credit qualifying age, and start-of-year status for Class 4 NI #1907, Abolish working-age Housing Benefit from 1 July 2026 (NI 1 October 2026) #1910 and Replace generic child and adult flags with each programme's legal definitions #1896.

Dataset totals are unchanged by these fixes on both builds; the corrected shapes don't occur in the survey data. Local results: 1,307 YAML tests and 5 property tests pass.

@MaxGhenis

Copy link
Copy Markdown
Collaborator Author

Coordination with #1944 (mixed-age couples on UC: benefit cap and CTR pensioner status). The two compose. I merged both locally: all 29 YAML cases from both PRs pass, as do both property suites and test_housing_benefit_pension_age_properties.py.

#1944 adds two variables:

  • housing_benefit_pension_age_regulations_apply (HB Regs 2006 reg 5; it drives the benefit cap's age exemption);
  • council_tax_reduction_pensioner (SI 2012/2885 reg 3).

Both are true only when no claimant or partner under State Pension age has a UC award, and there is no IS, income-based JSA or income-related ESA.

After both merge:

  • A couple on this PR's Pension Credit route (the SI 2019/37 saving, or before 15 May 2019) has no UC. It stays cap-exempt and is a CTR pensioner. For your 75 + 60 case: CTR 1,500.
  • A mixed-age couple on UC is capped, and in England uses the working-age scheme.

So this PR's body table figures for UC-route couples (CTR 838.11 and so on) change after #1944. No rule here conflicts.

One note for later: your has_mixed_age_couple_pension_credit_saving reads reported legacy benefits and UC, while #1944 reads computed ones. They can disagree when a couple reports income-based JSA after it ended in April 2026. Reading #1944's variable from the saving would create a cycle (saving → is_uc_eligible → UC), so both stay as they are.

🤖 Generated with Claude Code

@vahid-ahmadi

Copy link
Copy Markdown
Collaborator

Reviewed: approve with nits.

The law is right. s.4(1A) is dated 15 May 2019, and the art. 4 saving and the reg 6A(5) new-claim route are each modelled by one shared variable, so no family can get both the Pension Credit and Universal Credit routes.

  1. Should fix: Key the Housing Benefit Guarantee Credit passport on receipt #1927 and Disregard guarantee credit recipients' income and capital in pensioner council tax reduction #1909 are missing from the coordination section. Key the Housing Benefit Guarantee Credit passport on receipt #1927's changelog and housing-benefit notebook say saved mixed-age couples "lose the passport until that saving is modelled", and Disregard guarantee credit recipients' income and capital in pensioner council tax reduction #1909 bases its CTR guarantee-credit disregard on in_receipt_of_guarantee_credit. Both go through is_pension_credit_eligible, which this PR changes. On this branch a saved 76 + 60 couple gets PC £9,889 and full HB. Fix: add both PRs to the section; whichever lands second deletes Key the Housing Benefit Guarantee Credit passport on receipt #1927's text and re-runs both PRs' property tests.
  2. Should fix: has_mixed_age_couple_pension_credit_saving.py:65. birth_year is period.year − age, and Enhanced FRS ages don't advance, so the gate drops one more cohort of real savers each year. That fits the PC-eligible count falling from 24.1k to 19.9k between 2025 and 2026, as the body says. Before merging, file the policyengine-uk-data issue to set the input at build time from survey-year ages, and link it.
  3. Nit: saving_latest_birth_year.yaml. Allowing everyone born in 1954 lets in people born 6 February to December 1954, who reached SPA after 14 May 2019. Say in the description that the gate errs towards inclusion.
  4. Nit: saved couples are always put on the PC route. A 76 + 45 couple with two children, the younger earning £12k, nets £34,264 there against £39,614 on UC. In law PC or HB is still above zero, so the saving hasn't ended and the couple could pick UC. This is a stated modelling choice; a line in the code comment pointing to the "Not modelled" better-off follow-up would help.

Verified: I read SPCA s.4 and SI 2019/37 arts 2 and 4, including the art. 4(2) end of the saving and the art. 4(3)–(5) migration-notice window inserted in 2024, and UC (TP) Regs reg 6A(4)–(5). The YAML passes (20/20) and both property suites pass, including #1901's HB suite (5 passed). Probes give the PC route for 2015–2019 and UC for 2020, and the 75 + 60 figures in the body reproduce. CI is green.

@juaristi22

Copy link
Copy Markdown
Collaborator

Codex review — mergeable with a data follow-up

Reviewed commit 24f59a42a5d09acff62f33112943122eaad9ebf9. COMPLETE; 0 confirmed blocking finding(s). Independent code/test and policy/source reviews were consolidated for the changed behavior and affected dependencies.

policy-1 [SHOULD ADDRESS] Stabilise the saved-status proxy in dataset builds

has_mixed_age_couple_pension_credit_saving.py:63-66 combines current receipt with birth_year. When projection holds survey ages fixed, computed birth year advances and a real protected record can lose the proxy with time, although legal continuity is a historical fact. Populate the existing saving input once from survey-year facts in the data build, and link the data follow-up before relying on long-horizon estimates. This is a limitation of the explicit default proxy; it is not proof that every newly classified record is legally wrong.

policy-2 [SUGGESTION] Keep route choice distinct from statutory entitlement

A protected couple can chooseUC; is_uc_eligible.py instead keeps a reported protected couple on the PC route. The code documents this, together with annual2019 approximation and whole-birth-year1954 inclusion. Preserve that wording and avoid describing the proxy as exact continuity or a better-off-benefit calculation.

Sources: SPCA4, appointed day, saving, HB scope, HB reg5, UC exclusion, new-claim route, NI commencement.

The changed code consistently uses the saving across Pension Credit, Housing Benefit and Universal Credit and tests the modeled mutually exclusive routes. No confirmed blocking defect was found. I consider this incremental correction mergeable with the data follow-up tracked; populate saved status from survey-year facts before relying on long-horizon projections. Preserve the documented approximations and coordinate shared age/receipt/abolition paths with #1907, #1927 and #1910.

Validation: 25 focused tests passed, including explicit saving on/off, reported-PC/HB inference, date boundaries, legacy-benefit exclusions and final PC/HB/UC outcomes. Eight official source originals were inspected and their cached bytes verified. No material evidence gap remains in the changed model scope; this does not certify individual survey records' historical continuity.

Focused tests used an existing cached Python 3.13 environment (Core 3.32.9, NumPy 2.1.3, pandas 2.3.1, microdf-python 1.2.1, Hypothesis 6.168.2, pytest 8.4.2) with this PR’s isolated source snapshot. No dependencies were installed; this was not a freshly synced lock environment or a full-suite/population run. This is a review comment, not a formal GitHub review vote.

Live check before posting (2026-10-02T10:42:58.900585+00:00): same commit, CLEAN; all reported CI checks pass.

MaxGhenis and others added 2 commits October 2, 2026 08:49
…d-age-saving

The Pension Credit age conditions and the mixed-age couple test now read
is_claimant_or_partner in place of is_adult, which #1896's code-health test
forbids. is_uc_eligible keeps #1896's qualifying-claimant test and this
branch's exclusion of families on the Pension Credit route. A pensioner with
an 18 or 19 year old dependant now meets the Pension Credit age conditions
(SPCA 2002 s.17: the claimant and any partner), so that YAML expectation and
the pre-change reference formulas in the property test follow #1896.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis

Copy link
Copy Markdown
Collaborator Author

Thanks @vahid-ahmadi, and for the Codex review. Head is now 65ee721a.

What changed since 24f59a42: the branch merges #1896 (207e225c) and current main, so CI tests the tree that will exist after #1896 lands. #1896 must merge first.

Review items:

  1. Coordination (should fix): Disregard guarantee credit recipients' income and capital in pensioner council tax reduction #1909 and Key the Housing Benefit Guarantee Credit passport on receipt #1927 are now in the Coordination section.
  2. Saved-status proxy (should fix; Codex policy-1): filed as Set the mixed-age couple Pension Credit saving at build time, from survey-year ages policyengine-uk-data#519 and listed under Not modelled.
  3. 1954 gate (nit): Not modelled now says the gate errs towards inclusion.
  4. Route choice (nit; Codex policy-2): unchanged. The comment in is_uc_eligible already says keeping a saved couple on the Pension Credit route is a modelling choice, and the better-off choice stays under Not modelled.

Run locally on the #1896 merge (before the final merge of main): 604 YAML cases across gov/dwp, finance/benefit/family and gov/local_authorities; both property suites; and the code-health tests. CI is running on 65ee721a. An independent delta review of the merge follows before this merges.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants