From 16f87a0b2e2ab16fb17a884dea1ad29e57e22175 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 11 Oct 2026 15:05:25 -0400 Subject: [PATCH 01/13] Model the 25p State Pension age addition at 80 SSCBA 1992 s.79(1) and (3) and Sch 4 Part III para 8 give a person over 80 who is entitled to a retirement pension under that Act 25p a week, which each Up-rating Order leaves out (SI 2026/148 art 3(2)(a)). A new State Pension does not count (s.79(1) as amended by the Pensions Act 2014 Sch 12 para 85). Add gov.dwp.state_pension.age_addition (amount, age) and state_pension_age_addition, and count it in state_pension. The survey's State Pension amount is taken to include the addition, so state_pension_reported_excluding_age_addition takes the data year's legislated addition off before basic_state_pension, new_state_pension and additional_state_pension split it: it is neither counted twice nor uprated as additional pension. It never reduces a carer benefit (SI 1979/597 reg 4(3), Sch 1 row 4), so overlapping_state_pension leaves it out. Fixes #2139. Co-Authored-By: Claude Opus 5.5 --- changelog.d/2139.fixed.md | 1 + docs/book/programs/gov/dwp/state-pension.md | 57 +++++- .../dwp/state_pension/age_addition/age.yaml | 11 ++ .../state_pension/age_addition/amount.yaml | 12 ++ .../gov/dwp/state_pension_age_addition.yaml | 139 ++++++++++++++ .../tests/test_state_pension_components.py | 173 +++++++++++++++--- .../gov/dwp/additional_state_pension.py | 7 +- .../variables/gov/dwp/basic_state_pension.py | 7 +- .../variables/gov/dwp/new_state_pension.py | 7 +- .../gov/dwp/overlapping_state_pension.py | 23 ++- .../gov/dwp/state_pension_age_addition.py | 58 ++++++ ...pension_reported_excluding_age_addition.py | 42 +++++ .../variables/input/state_pension.py | 1 + 13 files changed, 496 insertions(+), 42 deletions(-) create mode 100644 changelog.d/2139.fixed.md create mode 100644 policyengine_uk/parameters/gov/dwp/state_pension/age_addition/age.yaml create mode 100644 policyengine_uk/parameters/gov/dwp/state_pension/age_addition/amount.yaml create mode 100644 policyengine_uk/tests/policy/baseline/gov/dwp/state_pension_age_addition.yaml create mode 100644 policyengine_uk/variables/gov/dwp/state_pension_age_addition.py create mode 100644 policyengine_uk/variables/gov/dwp/state_pension_reported_excluding_age_addition.py diff --git a/changelog.d/2139.fixed.md b/changelog.d/2139.fixed.md new file mode 100644 index 0000000000..1bd5d9bd9b --- /dev/null +++ b/changelog.d/2139.fixed.md @@ -0,0 +1 @@ +- Model the 25p a week State Pension age addition at 80 (SSCBA 1992 s.79) for basic State Pension recipients, never uprated, and take it out of the reported amount before the flat-rate and additional pension split. diff --git a/docs/book/programs/gov/dwp/state-pension.md b/docs/book/programs/gov/dwp/state-pension.md index e4aafcff7c..f70c920f03 100644 --- a/docs/book/programs/gov/dwp/state-pension.md +++ b/docs/book/programs/gov/dwp/state-pension.md @@ -1,6 +1,6 @@ # State Pension -The State Pension is modelled in PolicyEngine UK as three composable +The State Pension is modelled in PolicyEngine UK as four composable person-level variables, summed into the `state_pension` aggregate that flows into household benefits. This page describes the current model and the residual aggregate gap against OBR outturn tracked under @@ -8,7 +8,7 @@ and the residual aggregate gap against OBR outturn tracked under ## Components -Three variables under `gov/dwp/`: +Four variables under `gov/dwp/`: - **`basic_state_pension`** — the pre-2016 flat-rate State Pension paid to people who reached State Pension age before 6 April 2016 @@ -28,10 +28,50 @@ Three variables under `gov/dwp/`: - Both are the reported weekly amount above the type's full rate in the data year, `max(reported - flat_max_for_type, 0)`, uprated by September CPI as described below and multiplied by `WEEKS_IN_YEAR`. - -All three split the amount a person reported in the data year (the -dataset's first year) by the person's `state_pension_type` in the year -simulated, for anyone over State Pension age: +- **`state_pension_age_addition`** — the age addition: 25p a week + (`gov.dwp.state_pension.age_addition.amount`) for a person over the age of + 80 (`age_addition.age`) who is entitled to a retirement pension under the + Social Security Contributions and Benefits Act 1992 + ([s.79](https://www.legislation.gov.uk/ukpga/1992/4/section/79) and + [Sch 4 Part III para 8](https://www.legislation.gov.uk/ukpga/1992/4/schedule/4)), + read as a `BASIC` type with a State Pension reported in the data year. It + is never uprated: each Up-rating Order excludes it (for example + [SI 2026/148 art 3(2)(a)](https://www.legislation.gov.uk/uksi/2026/148/article/3/made)). + A new State Pension gets none, because s.79(1) covers only a retirement + pension "under this Act", words the Pensions Act 2014 inserted + ([Sch 12 para 85](https://www.legislation.gov.uk/ukpga/2014/19/schedule/12/paragraph/85)). + A person is over an age once they have attained it (SSCBA 1992 s.173). + The model reads age on 6 October, the middle of the fiscal year, as it + does for State Pension age, so a person who turns 80 by then gets the + year's £13 in full and one who turns 80 later in the year gets none until + the next. + +The survey records the State Pension in payment. For Family Resources +Survey respondents, `state_pension_reported` is the benefits table's weekly +State Pension amount (benefit code 5) times 52, and policyengine-uk-data maps +no separate code for the age addition (`datasets/frs.py`), so the model +assumes the reported amount of a basic State Pension recipient over 80 +includes it. `state_pension_reported_excluding_age_addition` takes the data +year's addition off, at the legislated 25p from 80, and the other three +components split what is left. The addition is part of `state_pension`, so +it is taxed and means-tested as the pension is: it is an increase of the +pension (s.79(1)), which income tax charges as pension income under +[ITEPA 2003 s.577](https://www.legislation.gov.uk/ukpga/2003/1/section/577) +(the pre-2003 charge in ICTA 1988 s.617(1) reached every benefit under Parts +II to IV of the 1992 Act not excepted, and the age addition was not), and +Pension Credit counts it as retirement pension income +([State Pension Credit Act 2002 s.16(1)(e)](https://www.legislation.gov.uk/ukpga/2002/16/section/16)), +as do Universal Credit (Universal Credit Regulations 2013 regs 66(1)(a) and 67) and +pension-age Housing Benefit (Housing Benefit (State Pension Credit) +Regulations 2006 reg 29(1)(c)). It never reduces Carer's Allowance: an age +addition is adjusted only by reference to another age addition +([Overlapping Benefits Regulations 1979 reg 4(3)](https://www.legislation.gov.uk/uksi/1979/597/regulation/4) +and Sch 1 row 4). + +The basic, new and additional State Pension split the amount a person +reported in the data year (the dataset's first year), less any age addition, +by the person's `state_pension_type` in the year simulated, for anyone over +State Pension age: - The part up to that type's full rate in the data year is basic or new State Pension. It is uprated by the type's full rate: the year's over the @@ -418,9 +458,14 @@ part of the widening. | Protected Payment only computed for BASIC-type recipients | Fixed | #1634 (ASP now extends to NEW) | | `additional_state_pension` split the reported amount by the data year's State Pension type, paying part of it twice for records moving from basic to new cohorts | Fixed | #1921 | | `additional_state_pension` uprated additional pensions and protected payments by the full rate (the triple lock), not September CPI | Fixed | #1941 | +| The 25p age addition at 80 was not modelled: in the reported amount it was uprated as additional pension, and no one who turned 80 later got it | Fixed | #2139 | ### What's still open +- The Category D retirement pension, for people over 80 with no other + retirement pension or one below its rate (SSCBA 1992 s.78(3)), is not + modelled: [#2339](https://github.com/PolicyEngine/policyengine-uk/issues/2339). + - The data year's shortfall in the enhanced FRS: [policyengine-uk-data#493](https://github.com/PolicyEngine/policyengine-uk-data/issues/493). - The pension-age population and new-cohort awards in projected years: diff --git a/policyengine_uk/parameters/gov/dwp/state_pension/age_addition/age.yaml b/policyengine_uk/parameters/gov/dwp/state_pension/age_addition/age.yaml new file mode 100644 index 0000000000..817db0ead0 --- /dev/null +++ b/policyengine_uk/parameters/gov/dwp/state_pension/age_addition/age.yaml @@ -0,0 +1,11 @@ +description: A person entitled to a retirement pension under the Social Security Contributions and Benefits Act 1992 gets the age addition from this age. +values: + 1992-07-01: 80 +metadata: + unit: year + label: State Pension age addition age + reference: + - title: Social Security Contributions and Benefits Act 1992 s.79(1) + href: https://www.legislation.gov.uk/ukpga/1992/4/section/79 + - title: Social Security Contributions and Benefits Act 1992 s.173 (a person is over an age once they have attained it) + href: https://www.legislation.gov.uk/ukpga/1992/4/section/173 diff --git a/policyengine_uk/parameters/gov/dwp/state_pension/age_addition/amount.yaml b/policyengine_uk/parameters/gov/dwp/state_pension/age_addition/amount.yaml new file mode 100644 index 0000000000..6ce0906ad2 --- /dev/null +++ b/policyengine_uk/parameters/gov/dwp/state_pension/age_addition/amount.yaml @@ -0,0 +1,12 @@ +description: The Department for Work and Pensions adds this weekly amount, the age addition, to the retirement pension of a person over the age of 80. Up-rating Orders leave it out of the annual uprating, so it has stayed at 25p. +values: + 1992-07-01: 0.25 +metadata: + period: week + unit: currency-GBP + label: State Pension age addition + reference: + - title: Social Security Contributions and Benefits Act 1992 s.79(3) and Sch 4 Part III para 8 + href: https://www.legislation.gov.uk/ukpga/1992/4/schedule/4 + - title: Social Security Benefits Up-rating Order 2026 art 3(2)(a) (the age addition is not increased) + href: https://www.legislation.gov.uk/uksi/2026/148/article/3/made diff --git a/policyengine_uk/tests/policy/baseline/gov/dwp/state_pension_age_addition.yaml b/policyengine_uk/tests/policy/baseline/gov/dwp/state_pension_age_addition.yaml new file mode 100644 index 0000000000..816b6927de --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/dwp/state_pension_age_addition.yaml @@ -0,0 +1,139 @@ +# The age addition: 25p a week for a person over the age of 80 who is entitled +# to a retirement pension under the Social Security Contributions and Benefits +# Act 1992 (s.79(1) and (3), Sch 4 Part III para 8), never uprated (each +# Up-rating Order excludes it, e.g. SI 2026/148 art 3(2)(a)). A person is over +# an age once they have attained it (s.173). A new State Pension, under Part 1 +# of the Pensions Act 2014, is not a pension under that Act (s.79(1) as amended +# by the Pensions Act 2014 Sch 12 para 85). Annual amount: 0.25 x 52 = 13. + +- name: Case 1, aged 80 on the basic State Pension gets the age addition. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + person1: + age: 80 + state_pension_type: BASIC + state_pension_reported: 9_100 + output: + state_pension_age_addition: 13 + is_SP_age: true + +- name: Case 2, aged 79 gets no age addition. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + person1: + age: 79 + state_pension_type: BASIC + state_pension_reported: 9_100 + output: + state_pension_age_addition: 0 + +- name: Case 3, aged 85 on the new State Pension gets no age addition. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + person1: + age: 85 + state_pension_type: NEW + state_pension_reported: 12_000 + output: + state_pension_age_addition: 0 + +- name: Case 4, below State Pension age gets no age addition. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + person1: + age: 60 + state_pension_reported: 9_100 + output: + state_pension_type: NONE + state_pension_age_addition: 0 + +- name: Case 5, the age addition stays 25p a week in 2026-27. + period: 2026 + absolute_error_margin: 0.01 + input: + people: + person1: + age: 80 + state_pension_type: BASIC + state_pension_reported: 9_100 + output: + state_pension_age_addition: 13 + +- name: Case 6, the age addition stays 25p a week in 2030-31. + period: 2030 + absolute_error_margin: 0.01 + input: + people: + person1: + age: 80 + state_pension_type: BASIC + state_pension_reported: 9_100 + output: + state_pension_age_addition: 13 + +- name: Case 7, no State Pension means no age addition. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + person1: + age: 85 + state_pension_type: BASIC + state_pension_reported: 0 + output: + state_pension_age_addition: 0 + state_pension: 0 + +- name: Case 8, the computed State Pension type of a man aged 80 is basic. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + person1: + age: 80 + gender: MALE + state_pension_reported: 9_100 + output: + state_pension_type: BASIC + state_pension_age_addition: 13 + +- name: Case 9, a reported full basic rate plus 25p is the full rate and the addition. + # 2025-26 basic State Pension £176.45 a week (SI 2025/295 art 4(2)(b)). The + # reported £176.70 a week is the full rate and the age addition, so there is + # no additional State Pension. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + person1: + age: 85 + state_pension_type: BASIC + state_pension_reported: 9_188.4 + output: + basic_state_pension: 9_175.4 + additional_state_pension: 0 + state_pension_age_addition: 13 + state_pension: 9_188.4 + state_pension_reported_excluding_age_addition: 9_175.4 + +- name: Case 10, the age addition does not reduce Carer's Allowance. + # Overlapping Benefits Regulations 1979 reg 4(3) and Sch 1 row 4: an age + # addition is adjusted only by reference to another age addition. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + person1: + age: 85 + state_pension_type: BASIC + state_pension_reported: 9_188.4 + output: + overlapping_state_pension: 9_175.4 diff --git a/policyengine_uk/tests/test_state_pension_components.py b/policyengine_uk/tests/test_state_pension_components.py index 8487b260aa..946c5b4260 100644 --- a/policyengine_uk/tests/test_state_pension_components.py +++ b/policyengine_uk/tests/test_state_pension_components.py @@ -8,7 +8,10 @@ by the period's type, so together they split the reported amount with no overlap and no gap: the part up to the type's full rate is uprated by the full rate, and the part above it (additional pension, protected payments) by -September CPI, as the Up-rating Orders raise it (see add_on_uprating). +September CPI, as the Up-rating Orders raise it (see add_on_uprating). The +age addition, 25p a week from 80 on a basic State Pension, is paid on its own +and never uprated, so the components split the reported amount without it +(see net_weekly). The YAML runner builds simulations without a dataset, where the data year is the period by construction, so these cases build simulations from data. @@ -165,6 +168,32 @@ def approx(expected: float): return pytest.approx(expected, rel=INDEX_ROUNDING, abs=0.01) +# The age addition: 25p a week for a person over the age of 80 entitled to a +# retirement pension under the Social Security Contributions and Benefits Act +# 1992, which a new State Pension is not (s.79(1) and (3), Sch 4 Part III +# para 8), never uprated (e.g. SI 2026/148 art 3(2)(a)). The reported amount +# is taken to include it. +AGE_ADDITION_WEEKLY = 0.25 +AGE_ADDITION_AGE = 80 +AGE_ADDITION = AGE_ADDITION_WEEKLY * WEEKS_IN_YEAR + + +def receives_age_addition(pension_type, age, weekly): + """Basic State Pension type, aged 80 or over and some State Pension.""" + return ( + (np.asarray(pension_type) == "BASIC") + & (np.asarray(age) >= AGE_ADDITION_AGE) + & (np.asarray(weekly) > 0) + ) + + +def net_weekly(person: dict, data_year_type: str) -> float: + """The weekly amount the components split: the reported amount less the + age addition it includes in the data year.""" + receives = receives_age_addition(data_year_type, person["age"], person["weekly"]) + return max(person["weekly"] - AGE_ADDITION_WEEKLY * bool(receives), 0) + + def calculate(sim, variable: str, year: int) -> np.ndarray: return np.asarray(sim.calculate(variable, year)) @@ -222,13 +251,16 @@ def test_protected_payment_above_new_state_pension_follows_period_type(): ], ) def test_unchanged_type_splits_at_its_own_flat_rate(person, pension_type): + """The 90-year-old's reported amount includes the 25p age addition, which + is paid on its own; the 70-year-old, on the new State Pension, gets none.""" sim = projected_simulation([person]) + weekly = net_weekly(person, pension_type) + addition = AGE_ADDITION if pension_type == "BASIC" else 0 for year in YEARS: assert calculate(sim, "state_pension_type", year)[0] == pension_type total = sum(calculate(sim, v, year)[0] for v in COMPONENTS) - assert total == approx( - uprated_reported(sim, year, pension_type, person["weekly"]) - ) + assert total == approx(uprated_reported(sim, year, pension_type, weekly)) + assert calculate(sim, "state_pension_age_addition", year)[0] == addition def test_nothing_is_paid_once_the_record_falls_below_state_pension_age(): @@ -275,19 +307,20 @@ def test_new_in_data_year_and_basic_in_period_is_paid_in_full(): def test_additional_pension_rises_with_september_cpi_not_the_basic_rate(): """A man aged 90 in 2024-25 reached State Pension age in 1999, on the basic State Pension, as does a man aged 90 in any later year. He reports £200 a - week, £30.50 above the 2024-25 full basic rate. The Up-rating Orders raised - the basic State Pension by 4.1% and 4.8% and additional pensions by 1.7% - and 3.8% (SI 2025/295 and SI 2026/148, arts 4(2) and 4(3)(a)), so in - 2026-27 he gets £184.90 a week of basic State Pension and £30.50 x 1.017 x - 1.038 of additional State Pension.""" + week: the 25p age addition and £30.25 above the 2024-25 full basic rate. + The Up-rating Orders raised the basic State Pension by 4.1% and 4.8% and + additional pensions by 1.7% and 3.8% (SI 2025/295 and SI 2026/148, arts + 4(2) and 4(3)(a)), and left the age addition at 25p (art 3(2)(a)), so in + 2026-27 he gets £184.90 a week of basic State Pension, £30.25 x 1.017 x + 1.038 of additional State Pension and 25p.""" person = {"age": 90, "male": True, "months": 3, "weekly": 200} sim = projected_simulation([person]) for year in (DATA_YEAR, 2025, 2026): assert calculate(sim, "state_pension_type", year)[0] == "BASIC" - additional_2025 = (200 - 169.50) * WEEKS_IN_YEAR * 1.017 - additional_2026 = (200 - 169.50) * WEEKS_IN_YEAR * 1.017 * 1.038 + additional_2025 = (199.75 - 169.50) * WEEKS_IN_YEAR * 1.017 + additional_2026 = (199.75 - 169.50) * WEEKS_IN_YEAR * 1.017 * 1.038 assert calculate(sim, "additional_state_pension", DATA_YEAR)[0] == approx( - (200 - 169.50) * WEEKS_IN_YEAR + (199.75 - 169.50) * WEEKS_IN_YEAR ) assert calculate(sim, "additional_state_pension", 2025)[0] == approx( additional_2025 @@ -298,8 +331,9 @@ def test_additional_pension_rises_with_september_cpi_not_the_basic_rate(): assert calculate(sim, "basic_state_pension", 2026)[0] == approx( 184.90 * WEEKS_IN_YEAR ) + assert calculate(sim, "state_pension_age_addition", 2026)[0] == AGE_ADDITION assert calculate(sim, "state_pension", 2026)[0] == approx( - 184.90 * WEEKS_IN_YEAR + additional_2026 + 184.90 * WEEKS_IN_YEAR + additional_2026 + AGE_ADDITION ) @@ -443,10 +477,11 @@ def test_a_september_cpi_scenario_moves_the_add_on(): "age": st.integers(min_value=55, max_value=100), "male": st.booleans(), "months": st.floats(min_value=0, max_value=12, exclude_max=True), - # Include each data-year flat rate, where the split changes. + # Include each data-year flat rate, where the split changes, the + # age addition alone, and the basic rate with the age addition. "weekly": st.one_of( st.floats(min_value=0, max_value=600), - st.sampled_from([0, 169.5, 221.2]), + st.sampled_from([0, 0.25, 169.5, 169.75, 221.2]), ), } ), @@ -459,13 +494,30 @@ def by_type(pension_type: np.ndarray, basic, new) -> np.ndarray: return np.select([pension_type == "BASIC", pension_type == "NEW"], [basic, new], 0) +def data_year_net_weekly(sim, people: list) -> np.ndarray: + """Each record's reported weekly amount less the age addition it includes + in the data year.""" + weekly = np.array([p["weekly"] for p in people]) + included = receives_age_addition( + calculate(sim, "state_pension_type", DATA_YEAR).astype(str), + calculate(sim, "age", DATA_YEAR), + weekly, + ) + return np.maximum(weekly - AGE_ADDITION_WEEKLY * included, 0) + + def assert_components_add_up(sim, people: list, years) -> None: """For each person and year: below State Pension age, no component and type NONE. Over it, only the period type's flat-rate component, which is the - reported amount up to the type's full rate, uprated by the full rate; and, - deflating each component by its own uprating, the three components add up - to exactly the reported amount, with no overlap and no gap.""" - weekly = np.array([p["weekly"] for p in people]) + reported amount net of the age addition up to the type's full rate, + uprated by the full rate; and, deflating each component by its own + uprating, the three components add up to exactly that net amount, with no + overlap and no gap. The age addition is 25p a week exactly when the record + is on the basic State Pension, aged 80 or over and has a State Pension, in + every year; in the data year the four parts add up to the reported amount + whenever it is at least 25p a week.""" + reported_weekly = np.array([p["weekly"] for p in people]) + weekly = data_year_net_weekly(sim, people) for year in years: pension_type = calculate(sim, "state_pension_type", year).astype(str) over_spa = calculate(sim, "is_SP_age", year).astype(bool) @@ -495,6 +547,20 @@ def assert_components_add_up(sim, people: list, years) -> None: assert np.all(additional >= 0) assert np.all(basic <= rates["BASIC"] * WEEKS_IN_YEAR * (1 + 1e-6)) assert np.all(new <= rates["NEW"] * WEEKS_IN_YEAR * (1 + 1e-6)) + addition = calculate(sim, "state_pension_age_addition", year) + receives = receives_age_addition( + pension_type, calculate(sim, "age", year), reported_weekly + ) + assert np.array_equal(addition, receives * AGE_ADDITION), year + if year == DATA_YEAR: + total = basic + new + additional + addition + full_record = over_spa & (reported_weekly >= AGE_ADDITION_WEEKLY) + assert np.allclose( + total[full_record], + reported_weekly[full_record] * WEEKS_IN_YEAR, + rtol=1e-9, + atol=1e-6, + ) @PROPERTY_SETTINGS @@ -566,9 +632,10 @@ def test_add_on_follows_september_cpi_and_nothing_else_changes(people, data): - the add-on is never negative, and never falls as the reported amount rises; - from one year to the next, with the type unchanged, it grows by that year's September CPI rise; - - differential against main: the flat-rate parts are unchanged, the add-on - is unchanged in the data year, and otherwise differs only by uprating with - September CPI instead of the full rate.""" + - differential against main, applied to the reported amount net of the age + addition: the flat-rate parts are unchanged, the add-on is unchanged in + the data year, and otherwise differs only by uprating with September CPI + instead of the full rate.""" extra = data.draw( st.lists( st.floats(min_value=0, max_value=300), @@ -578,7 +645,7 @@ def test_add_on_follows_september_cpi_and_nothing_else_changes(people, data): ) records = paired(people, extra) sim = projected_simulation(records) - weekly = np.array([p["weekly"] for p in records]) + weekly = data_year_net_weekly(sim, records) n = len(people) previous = None for year in YEARS: @@ -729,14 +796,17 @@ def test_situation_new_state_pension_follows_a_dated_rate_reform(reformed): def test_situation_basic_state_pension_follows_a_dated_rate_reform(): + """Aged 90, reporting the full basic rate and the 25p age addition.""" year = 2026 - weekly = LEGISLATED[(year, "BASIC")] + weekly = LEGISLATED[(year, "BASIC")] + AGE_ADDITION_WEEKLY sit = situation(90, "BASIC", weekly, year) reform = {BSP: {f"{year}-01-01.{year}-12-31": 170.0}} result = situation_components(sit, reform, year) assert result["basic_state_pension"] == pytest.approx(170 * WEEKS_IN_YEAR, abs=0.01) assert result["additional_state_pension"] == 0 - assert result["state_pension"] == pytest.approx(170 * WEEKS_IN_YEAR, abs=0.01) + assert result["state_pension"] == pytest.approx( + 170 * WEEKS_IN_YEAR + AGE_ADDITION, abs=0.01 + ) def test_situation_protected_payment_stays_additional_under_a_rate_reform(): @@ -783,11 +853,12 @@ def test_undated_rate_reform_moves_only_the_flat_rate_part( year = 2027 assert calculate(sim, "state_pension_type", year)[0] == pension_type expected = expected_under_rate( - person["weekly"], + net_weekly(person, pension_type), LEGISLATED[(DATA_YEAR, pension_type)], reformed, add_on_uprating(sim, year), ) + addition = AGE_ADDITION if pension_type == "BASIC" else 0 flat_variable = ( "new_state_pension" if pension_type == "NEW" else "basic_state_pension" ) @@ -798,7 +869,7 @@ def test_undated_rate_reform_moves_only_the_flat_rate_part( expected["additional"] ) assert calculate(sim, "state_pension", year)[0] == approx( - expected["flat"] + expected["additional"] + expected["flat"] + expected["additional"] + addition ) @@ -831,3 +902,51 @@ def test_dated_reform_after_the_data_year_is_unchanged_by_the_baseline_split(): assert calculate(sim, "state_pension", 2027)[0] == approx( expected["flat"] + expected["additional"] ) + + +# The age addition (PolicyEngine/policyengine-uk#2139). + + +def test_full_basic_rate_plus_age_addition_is_never_additional_pension(): + """A man aged 85 in 2024-25 reports £169.75 a week: the full basic State + Pension (£169.50, Social Security Benefits Up-rating Order 2024 art 4(2)) + and the 25p age addition. In every year he gets the full basic rate and + 25p, never uprated, and no additional State Pension. Before #2139 the 25p + was additional pension, uprated with it.""" + person = {"age": 85, "male": True, "months": 3, "weekly": 169.75} + sim = projected_simulation([person]) + for year in YEARS: + assert calculate(sim, "state_pension_type", year)[0] == "BASIC" + basic = flat_rates(sim, year)["BASIC"] * WEEKS_IN_YEAR + assert calculate(sim, "basic_state_pension", year)[0] == approx(basic) + assert calculate(sim, "additional_state_pension", year)[0] == 0 + assert calculate(sim, "state_pension_age_addition", year)[0] == AGE_ADDITION + assert calculate(sim, "state_pension", year)[0] == approx(basic + AGE_ADDITION) + + +def test_age_addition_reforms_leave_the_reported_split_alone(): + """An undated reform paying £10 a week from 75 pays it to both records in + every year, but the reported amounts were observed under the legislated + 25p from 80: the 85-year-old's is still split net of 25p, and the + 77-year-old's in full, so the other components do not change.""" + people = [ + {"age": 85, "male": True, "months": 3, "weekly": 169.75}, + {"age": 77, "male": True, "months": 3, "weekly": 169.5}, + ] + baseline = projected_simulation(people) + reformed = Microsimulation( + dataset=year_dataset(people, DATA_YEAR), + reform={ + "gov.dwp.state_pension.age_addition.amount": 10.0, + "gov.dwp.state_pension.age_addition.age": 75, + }, + ) + for year in (DATA_YEAR, 2027, 2030): + assert ( + list(calculate(reformed, "state_pension_age_addition", year)) + == [10 * WEEKS_IN_YEAR] * 2 + ) + for variable in COMPONENTS: + assert calculate(reformed, variable, year) == pytest.approx( + calculate(baseline, variable, year), abs=1e-6 + ), (variable, year) diff --git a/policyengine_uk/variables/gov/dwp/additional_state_pension.py b/policyengine_uk/variables/gov/dwp/additional_state_pension.py index 7ef5d894d6..a864fdb4ab 100644 --- a/policyengine_uk/variables/gov/dwp/additional_state_pension.py +++ b/policyengine_uk/variables/gov/dwp/additional_state_pension.py @@ -24,7 +24,12 @@ def formula(person, period, parameters): data_year = period.start.year else: data_year = period.start.year - reported = person("state_pension_reported", data_year) / WEEKS_IN_YEAR + # The age addition is paid by state_pension_age_addition, so split + # the reported amount without it. + reported = ( + person("state_pension_reported_excluding_age_addition", data_year) + / WEEKS_IN_YEAR + ) # Split by the period's type, as basic_state_pension and # new_state_pension do, so the three components add up to the # reported amount. Survey ages are held fixed across years, so a diff --git a/policyengine_uk/variables/gov/dwp/basic_state_pension.py b/policyengine_uk/variables/gov/dwp/basic_state_pension.py index 23d4a7a883..84e39f7499 100644 --- a/policyengine_uk/variables/gov/dwp/basic_state_pension.py +++ b/policyengine_uk/variables/gov/dwp/basic_state_pension.py @@ -21,7 +21,12 @@ def formula(person, period, parameters): else: data_year = period.start.year - reported = person("state_pension_reported", data_year) / WEEKS_IN_YEAR + # The age addition is paid by state_pension_age_addition, so split + # the reported amount without it. + reported = ( + person("state_pension_reported_excluding_age_addition", data_year) + / WEEKS_IN_YEAR + ) pension_type = person("state_pension_type", period) # state_pension_reported was observed under the legislated rates, so # split it at the baseline's data-year rate, not the reformed one. diff --git a/policyengine_uk/variables/gov/dwp/new_state_pension.py b/policyengine_uk/variables/gov/dwp/new_state_pension.py index f26e4a9cfd..79fa7019c1 100644 --- a/policyengine_uk/variables/gov/dwp/new_state_pension.py +++ b/policyengine_uk/variables/gov/dwp/new_state_pension.py @@ -23,7 +23,12 @@ def formula(person, period, parameters): pension_type = person("state_pension_type", period) eligible = pension_type == pension_type.possible_values.NEW - reported_weekly = person("state_pension_reported", data_year) / WEEKS_IN_YEAR + # The age addition is paid by state_pension_age_addition, so split + # the reported amount without it. + reported_weekly = ( + person("state_pension_reported_excluding_age_addition", data_year) + / WEEKS_IN_YEAR + ) # state_pension_reported was observed under the legislated rates, so # split it at the baseline's data-year rate, not the reformed one. # Otherwise a reform that also sets the data year's rate (an undated diff --git a/policyengine_uk/variables/gov/dwp/overlapping_state_pension.py b/policyengine_uk/variables/gov/dwp/overlapping_state_pension.py index f48729090d..70b03718bc 100644 --- a/policyengine_uk/variables/gov/dwp/overlapping_state_pension.py +++ b/policyengine_uk/variables/gov/dwp/overlapping_state_pension.py @@ -9,7 +9,8 @@ class overlapping_state_pension(Variable): "The State Pension by which Carer's Allowance and Carer Support Payment " "are reduced. A new State Pension under Part 1 of the Pensions Act 2014 " "overlaps in full, including any protected payment above the full rate. " - "An old State Pension overlaps without its additional pension. When " + "An old State Pension overlaps without its additional pension or its " + "age addition. When " "only a reported total is available, the model estimates its basic " "component up to the full basic rate and treats the excess as " "additional pension. This split cannot identify basic-pension " @@ -22,25 +23,35 @@ class overlapping_state_pension(Variable): reference = ( "https://www.legislation.gov.uk/uksi/1979/597/regulation/4", "https://www.legislation.gov.uk/uksi/1979/597/regulation/12", + "https://www.legislation.gov.uk/uksi/1979/597/schedule/1", "https://www.legislation.gov.uk/ssi/2023/302/regulation/16", ) def formula(person, period, parameters): state_pension = person("state_pension", period) additional = person("additional_state_pension", period) + # An age addition is adjusted only by reference to another age + # addition (SI 1979/597 reg 4(3); Sch 1 row 4, "except any age + # addition"), so it never reduces a carer benefit. + age_addition = person("state_pension_age_addition", period) components = add( person, period, - ["basic_state_pension", "new_state_pension", "additional_state_pension"], + [ + "basic_state_pension", + "new_state_pension", + "additional_state_pension", + "state_pension_age_addition", + ], ) pension_type = person("state_pension_type", period) old_system = pension_type == pension_type.possible_values.BASIC # state_pension can scale its components (a contributed reform does), - # so take the additional pension as a share of them. - additional_share = np.divide( - additional, + # so take the parts that do not overlap as a share of them. + not_overlapping_share = np.divide( + old_system * additional + age_addition, components, out=np.zeros_like(components, dtype=float), where=components > 0, ) - return state_pension * (1 - old_system * additional_share) + return state_pension * (1 - not_overlapping_share) diff --git a/policyengine_uk/variables/gov/dwp/state_pension_age_addition.py b/policyengine_uk/variables/gov/dwp/state_pension_age_addition.py new file mode 100644 index 0000000000..08e94edcb7 --- /dev/null +++ b/policyengine_uk/variables/gov/dwp/state_pension_age_addition.py @@ -0,0 +1,58 @@ +from policyengine_uk.model_api import * + + +def state_pension_data_year(person, period) -> int: + """The year state_pension_reported was observed: the dataset's first year, + or the period itself in a simulation without a dataset.""" + simulation = person.simulation + if simulation.dataset is not None: + try: + return min(simulation.dataset.years) + except Exception: + return period.start.year + return period.start.year + + +def receives_age_addition(person, period, age_addition_age, data_year): + """Whether a person gets the age addition in ``period``: over the age of 80 + and entitled to a retirement pension under the Social Security + Contributions and Benefits Act 1992 (s.79(1)). A person is over an age once + they have attained it (s.173). Entitlement is read as a basic State Pension + type with a State Pension reported in the data year: a new State Pension, + under Part 1 of the Pensions Act 2014, is not a pension "under this Act" + (s.79(1) as amended by the Pensions Act 2014 Sch 12 para 85).""" + pension_type = person("state_pension_type", period) + basic = pension_type == pension_type.possible_values.BASIC + has_pension = person("state_pension_reported", data_year) > 0 + over_age = person("age", period) >= age_addition_age + return basic & has_pension & over_age + + +class state_pension_age_addition(Variable): + label = "State Pension age addition" + documentation = ( + "The age addition: 25p a week added to a retirement pension under the " + "Social Security Contributions and Benefits Act 1992 (the basic State " + "Pension) once its recipient is over 80, and never uprated. A new " + "State Pension gets none. The model is annual and, as for State " + "Pension age, reads age on 6 October, the middle of the fiscal year: " + "a person who turns 80 by then gets the whole year's addition, and one " + "who turns 80 later in the year gets none until the next." + ) + entity = Person + definition_period = YEAR + value_type = float + unit = GBP + reference = ( + "https://www.legislation.gov.uk/ukpga/1992/4/section/79", + "https://www.legislation.gov.uk/ukpga/1992/4/section/173", + "https://www.legislation.gov.uk/ukpga/1992/4/schedule/4", + "https://www.legislation.gov.uk/ukpga/2014/19/schedule/12/paragraph/85", + "https://www.legislation.gov.uk/uksi/2026/148/article/3/made", + ) + + def formula(person, period, parameters): + p = parameters(period).gov.dwp.state_pension.age_addition + data_year = state_pension_data_year(person, period) + receives = receives_age_addition(person, period, p.age, data_year) + return receives * p.amount * WEEKS_IN_YEAR diff --git a/policyengine_uk/variables/gov/dwp/state_pension_reported_excluding_age_addition.py b/policyengine_uk/variables/gov/dwp/state_pension_reported_excluding_age_addition.py new file mode 100644 index 0000000000..297bb5e0a4 --- /dev/null +++ b/policyengine_uk/variables/gov/dwp/state_pension_reported_excluding_age_addition.py @@ -0,0 +1,42 @@ +from policyengine_uk.model_api import * +from policyengine_uk.variables.gov.dwp.state_pension_age_addition import ( + receives_age_addition, +) + + +class state_pension_reported_excluding_age_addition(Variable): + label = "reported State Pension excluding the age addition" + documentation = ( + "state_pension_reported less the age addition it is taken to include. " + "The survey records the State Pension a person receives, which for a " + "basic State Pension recipient over 80 includes the 25p a week age " + "addition. basic_state_pension, new_state_pension and " + "additional_state_pension split this amount, and " + "state_pension_age_addition pays the addition, so it is neither " + "counted twice nor uprated as additional pension." + ) + entity = Person + definition_period = YEAR + value_type = float + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/1992/4/section/79" + + def formula(person, period, parameters): + reported = person("state_pension_reported", period) + # state_pension_reported was observed under the legislated rules, so + # take off the legislated age addition, not a reformed one, as the + # components split it at the legislated full rate + # (PolicyEngine/policyengine-uk#2122). + baseline = getattr(person.simulation, "baseline", None) + legislated = ( + baseline.tax_benefit_system.parameters + if baseline is not None + else parameters + ) + p = legislated(period).gov.dwp.state_pension.age_addition + included = ( + receives_age_addition(person, period, p.age, period) + * p.amount + * WEEKS_IN_YEAR + ) + return max_(reported - included, 0) diff --git a/policyengine_uk/variables/input/state_pension.py b/policyengine_uk/variables/input/state_pension.py index e853011939..347194740a 100644 --- a/policyengine_uk/variables/input/state_pension.py +++ b/policyengine_uk/variables/input/state_pension.py @@ -23,6 +23,7 @@ def formula(person, period, parameters): "basic_state_pension", "additional_state_pension", "new_state_pension", + "state_pension_age_addition", ], ) * uprating From f4e18b1a5925f7c4706d283c28d303831a003714 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 11 Oct 2026 16:01:38 -0400 Subject: [PATCH 02/13] Read age addition entitlement from the components as well; update carer overlap tests A simulation given basic or additional State Pension directly, with no reported amount, now gets the age addition at 80 too. The carer overlap tests' 80-year-olds report amounts that include the 25p: it moves from additional pension to the age addition, and in case 8 it no longer reduces Carer's Allowance (SI 1979/597 reg 4(3); Sch 1 row 4). Co-Authored-By: Claude Opus 5.5 --- ...carers_allowance_overlapping_benefits.yaml | 16 ++++++-- .../gov/dwp/state_pension_age_addition.yaml | 28 ++++++++++++++ ...t_carer_overlapping_benefits_properties.py | 15 +++++++- .../gov/dwp/state_pension_age_addition.py | 38 +++++++++++-------- ...pension_reported_excluding_age_addition.py | 9 ++--- 5 files changed, 79 insertions(+), 27 deletions(-) diff --git a/policyengine_uk/tests/policy/baseline/gov/dwp/carers_allowance_overlapping_benefits.yaml b/policyengine_uk/tests/policy/baseline/gov/dwp/carers_allowance_overlapping_benefits.yaml index 72cf06ab25..8a24135b10 100644 --- a/policyengine_uk/tests/policy/baseline/gov/dwp/carers_allowance_overlapping_benefits.yaml +++ b/policyengine_uk/tests/policy/baseline/gov/dwp/carers_allowance_overlapping_benefits.yaml @@ -92,7 +92,9 @@ country: ENGLAND output: state_pension_type: BASIC - state_pension: 7_000 + # Aged 80 on an old State Pension, so the 25p age addition is paid too + # (SSCBA 1992 s.79); it does not overlap (SI 1979/597 reg 4(3)). + state_pension: 7_000 + 0.25 * 52 overlapping_state_pension: 2_000 carers_allowance: 86.45 * 52 - 2_000 @@ -119,8 +121,11 @@ care_hours: 35 country: ENGLAND output: + # The reported amount of a person aged 80 includes the 25p age addition + # (SSCBA 1992 s.79), paid on its own. basic_state_pension: 184.90 * 52 - additional_state_pension: 13_000 - 184.90 * 52 + additional_state_pension: 13_000 - 0.25 * 52 - 184.90 * 52 + state_pension_age_addition: 0.25 * 52 overlapping_state_pension: 184.90 * 52 carers_allowance: 0 @@ -133,8 +138,11 @@ care_hours: 35 country: ENGLAND output: - overlapping_state_pension: 3_000 - carers_allowance: 86.45 * 52 - 3_000 + # The 25p age addition in the reported amount does not overlap: an age + # addition is adjusted only by reference to another age addition (SI + # 1979/597 reg 4(3); Sch 1 row 4, "except any age addition"). + overlapping_state_pension: 3_000 - 0.25 * 52 + carers_allowance: 86.45 * 52 - (3_000 - 0.25 * 52) - name: Case 9, a reported new State Pension below the allowance. period: 2026 diff --git a/policyengine_uk/tests/policy/baseline/gov/dwp/state_pension_age_addition.yaml b/policyengine_uk/tests/policy/baseline/gov/dwp/state_pension_age_addition.yaml index 816b6927de..40751d4452 100644 --- a/policyengine_uk/tests/policy/baseline/gov/dwp/state_pension_age_addition.yaml +++ b/policyengine_uk/tests/policy/baseline/gov/dwp/state_pension_age_addition.yaml @@ -137,3 +137,31 @@ state_pension_reported: 9_188.4 output: overlapping_state_pension: 9_175.4 + +- name: Case 11, State Pension components supplied directly also bring the age addition. + period: 2026 + absolute_error_margin: 0.01 + input: + people: + person1: + age: 82 + state_pension_type: BASIC + basic_state_pension: 2_000 + output: + state_pension_age_addition: 13 + state_pension: 2_013 + +- name: Case 12, a reported amount of exactly the age addition is the age addition. + period: 2026 + absolute_error_margin: 0.01 + input: + people: + person1: + age: 85 + state_pension_type: BASIC + state_pension_reported: 13 + output: + basic_state_pension: 0 + additional_state_pension: 0 + state_pension_age_addition: 13 + state_pension: 13 diff --git a/policyengine_uk/tests/test_carer_overlapping_benefits_properties.py b/policyengine_uk/tests/test_carer_overlapping_benefits_properties.py index 8bb3314a77..355508bd56 100644 --- a/policyengine_uk/tests/test_carer_overlapping_benefits_properties.py +++ b/policyengine_uk/tests/test_carer_overlapping_benefits_properties.py @@ -215,6 +215,9 @@ def rates(sim): * WEEKS, "basic": float(parameters.gov.dwp.state_pension.basic_state_pension.amount) * WEEKS, + "age_addition": float(parameters.gov.dwp.state_pension.age_addition.amount) + * WEEKS, + "age_addition_age": float(parameters.gov.dwp.state_pension.age_addition.age), "min_hours": float(parameters.gov.dwp.carers_allowance.min_hours), "carer_addition": float( parameters.gov.dwp.pension_credit.guarantee_credit.carer.addition @@ -246,9 +249,17 @@ def reference(people, sim, extra=None): # The model's split of a reported amount: an old State Pension # above the full basic rate is additional pension, which does not # overlap. A new State Pension overlaps in full, protected payment - # included, and there is none before pensionable age. + # included, and there is none before pensionable age. From 80 an + # old State Pension is taken to include the 25p age addition, + # which does not overlap either (SI 1979/597 reg 4(3)). + with_age_addition = ( + pension_type == "BASIC" + and person["age"] >= r["age_addition_age"] + and pension > 0 + ) + basic_reported = max(pension - r["age_addition"] * with_age_addition, 0) state_pension = { - "BASIC": min(pension, r["basic"]), + "BASIC": min(basic_reported, r["basic"]), "NEW": pension, "NONE": 0, }[pension_type] diff --git a/policyengine_uk/variables/gov/dwp/state_pension_age_addition.py b/policyengine_uk/variables/gov/dwp/state_pension_age_addition.py index 08e94edcb7..c824f4053e 100644 --- a/policyengine_uk/variables/gov/dwp/state_pension_age_addition.py +++ b/policyengine_uk/variables/gov/dwp/state_pension_age_addition.py @@ -13,19 +13,16 @@ def state_pension_data_year(person, period) -> int: return period.start.year -def receives_age_addition(person, period, age_addition_age, data_year): - """Whether a person gets the age addition in ``period``: over the age of 80 - and entitled to a retirement pension under the Social Security - Contributions and Benefits Act 1992 (s.79(1)). A person is over an age once - they have attained it (s.173). Entitlement is read as a basic State Pension - type with a State Pension reported in the data year: a new State Pension, - under Part 1 of the Pensions Act 2014, is not a pension "under this Act" - (s.79(1) as amended by the Pensions Act 2014 Sch 12 para 85).""" +def over_age_on_basic_state_pension(person, period, age_addition_age): + """Over the age of 80 with a basic State Pension type. The age addition + goes to a person over 80 entitled to a retirement pension under the Social + Security Contributions and Benefits Act 1992 (s.79(1)); a person is over + an age once they have attained it (s.173). A new State Pension, under Part + 1 of the Pensions Act 2014, is not a pension "under this Act" (s.79(1) as + amended by the Pensions Act 2014 Sch 12 para 85).""" pension_type = person("state_pension_type", period) basic = pension_type == pension_type.possible_values.BASIC - has_pension = person("state_pension_reported", data_year) > 0 - over_age = person("age", period) >= age_addition_age - return basic & has_pension & over_age + return basic & (person("age", period) >= age_addition_age) class state_pension_age_addition(Variable): @@ -34,10 +31,13 @@ class state_pension_age_addition(Variable): "The age addition: 25p a week added to a retirement pension under the " "Social Security Contributions and Benefits Act 1992 (the basic State " "Pension) once its recipient is over 80, and never uprated. A new " - "State Pension gets none. The model is annual and, as for State " - "Pension age, reads age on 6 October, the middle of the fiscal year: " - "a person who turns 80 by then gets the whole year's addition, and one " - "who turns 80 later in the year gets none until the next." + "State Pension gets none. Entitlement to the pension is read from a " + "State Pension reported in the data year or, in a simulation given " + "the components directly, basic or additional State Pension in the " + "year. The model is annual and, as for State Pension age, reads age " + "on 6 October, the middle of the fiscal year: a person who turns 80 " + "by then gets the whole year's addition, and one who turns 80 later " + "in the year gets none until the next." ) entity = Person definition_period = YEAR @@ -54,5 +54,11 @@ class state_pension_age_addition(Variable): def formula(person, period, parameters): p = parameters(period).gov.dwp.state_pension.age_addition data_year = state_pension_data_year(person, period) - receives = receives_age_addition(person, period, p.age, data_year) + reported = person("state_pension_reported", data_year) > 0 + components = ( + add(person, period, ["basic_state_pension", "additional_state_pension"]) > 0 + ) + receives = over_age_on_basic_state_pension(person, period, p.age) & ( + reported | components + ) return receives * p.amount * WEEKS_IN_YEAR diff --git a/policyengine_uk/variables/gov/dwp/state_pension_reported_excluding_age_addition.py b/policyengine_uk/variables/gov/dwp/state_pension_reported_excluding_age_addition.py index 297bb5e0a4..8fd548c218 100644 --- a/policyengine_uk/variables/gov/dwp/state_pension_reported_excluding_age_addition.py +++ b/policyengine_uk/variables/gov/dwp/state_pension_reported_excluding_age_addition.py @@ -1,6 +1,6 @@ from policyengine_uk.model_api import * from policyengine_uk.variables.gov.dwp.state_pension_age_addition import ( - receives_age_addition, + over_age_on_basic_state_pension, ) @@ -34,9 +34,8 @@ def formula(person, period, parameters): else parameters ) p = legislated(period).gov.dwp.state_pension.age_addition - included = ( - receives_age_addition(person, period, p.age, period) - * p.amount - * WEEKS_IN_YEAR + receives = over_age_on_basic_state_pension(person, period, p.age) & ( + reported > 0 ) + included = receives * p.amount * WEEKS_IN_YEAR return max_(reported - included, 0) From 10272030e588b070e4c91bdbde517d5b1eae3daa Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 11 Oct 2026 16:05:36 -0400 Subject: [PATCH 03/13] Check the data-year identity with the float32 tolerance Co-Authored-By: Claude Opus 5.5 --- policyengine_uk/tests/test_state_pension_components.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/policyengine_uk/tests/test_state_pension_components.py b/policyengine_uk/tests/test_state_pension_components.py index 8fd84040d4..56845f4ced 100644 --- a/policyengine_uk/tests/test_state_pension_components.py +++ b/policyengine_uk/tests/test_state_pension_components.py @@ -558,8 +558,7 @@ def assert_components_add_up(sim, people: list, years) -> None: assert np.allclose( total[full_record], reported_weekly[full_record] * WEEKS_IN_YEAR, - rtol=1e-9, - atol=1e-6, + **FLOAT32, ) From 5234997ea042993ab398ffcba30685164e41e90d Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 11 Oct 2026 22:57:34 -0400 Subject: [PATCH 04/13] Compare the age addition with the reported amount the model holds; expect none on a new State Pension MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI run 38170838155 failed three of the age addition tests. None was a model defect: - The two components-add-up properties drew a weekly amount of 8.3e-246 (and 2.2e-313). state_pension_reported is a float variable, stored in float32, so the simulation holds it as nil and rightly pays no age addition; the reference read the float64 draw and expected 25p. The reference now reads each report as the simulation holds it, and the two CI examples (and a tiny amount float32 does hold) are pinned as examples. - The age addition reform test expected £10 a week for both records in 2030-31. Held at 77, the second record is on the new State Pension by then, and the age addition belongs only to a retirement pension under the 1992 Act (s.79(1)), reformed or not. The test now asserts each year's type and expects the addition only on the basic State Pension. Co-Authored-By: Claude Opus 5.5 --- .../tests/test_state_pension_components.py | 55 +++++++++++++++---- 1 file changed, 43 insertions(+), 12 deletions(-) diff --git a/policyengine_uk/tests/test_state_pension_components.py b/policyengine_uk/tests/test_state_pension_components.py index 56845f4ced..1ab2c4dde5 100644 --- a/policyengine_uk/tests/test_state_pension_components.py +++ b/policyengine_uk/tests/test_state_pension_components.py @@ -22,7 +22,7 @@ import numpy as np import pandas as pd import pytest -from hypothesis import HealthCheck, given, settings +from hypothesis import HealthCheck, example, given, settings from hypothesis import strategies as st from policyengine_uk import Microsimulation @@ -494,10 +494,19 @@ def by_type(pension_type: np.ndarray, basic, new) -> np.ndarray: return np.select([pension_type == "BASIC", pension_type == "NEW"], [basic, new], 0) +def stored_weekly(people: list) -> np.ndarray: + """Each record's reported weekly amount as the simulation holds it. + state_pension_reported is a float variable, which the model stores in + float32, so an amount too small for float32 (Hypothesis draws amounts down + to 5e-324 a week) is held as nil: the record reports no State Pension.""" + annual = np.array([p["weekly"] * WEEKS_IN_YEAR for p in people], np.float32) + return annual.astype(float) / WEEKS_IN_YEAR + + def data_year_net_weekly(sim, people: list) -> np.ndarray: """Each record's reported weekly amount less the age addition it includes in the data year.""" - weekly = np.array([p["weekly"] for p in people]) + weekly = stored_weekly(people) included = receives_age_addition( calculate(sim, "state_pension_type", DATA_YEAR).astype(str), calculate(sim, "age", DATA_YEAR), @@ -516,7 +525,7 @@ def assert_components_add_up(sim, people: list, years) -> None: is on the basic State Pension, aged 80 or over and has a State Pension, in every year; in the data year the four parts add up to the reported amount whenever it is at least 25p a week.""" - reported_weekly = np.array([p["weekly"] for p in people]) + reported_weekly = stored_weekly(people) weekly = data_year_net_weekly(sim, people) for year in years: pension_type = calculate(sim, "state_pension_type", year).astype(str) @@ -562,8 +571,21 @@ def assert_components_add_up(sim, people: list, years) -> None: ) +# Reported amounts too small for float32, held as nil (CI run 38170838155 +# found the first), and a tiny amount float32 still holds, at 80 on the basic +# State Pension. +TINY_REPORTS = [ + [{"age": 80, "male": False, "months": 0.0, "weekly": 8.266518416092618e-246}], + [{"age": 80, "male": False, "months": 0.0, "weekly": 2.2250738585e-313}], + [{"age": 85, "male": True, "months": 3.0, "weekly": 1e-30}], +] + + @PROPERTY_SETTINGS @given(people=PEOPLE) +@example(people=TINY_REPORTS[0]) +@example(people=TINY_REPORTS[1]) +@example(people=TINY_REPORTS[2]) def test_components_add_up_to_uprated_reported_amount(people): """Data projected with ages held fixed, every year from 2024-25 to 2030-31.""" sim = projected_simulation(people) @@ -928,10 +950,14 @@ def test_full_basic_rate_plus_age_addition_is_never_additional_pension(): def test_age_addition_reforms_leave_the_reported_split_alone(): - """An undated reform paying £10 a week from 75 pays it to both records in - every year, but the reported amounts were observed under the legislated - 25p from 80: the 85-year-old's is still split net of 25p, and the - 77-year-old's in full, so the other components do not change.""" + """An undated reform paying £10 a week from 75 pays it to both records + while they are on the basic State Pension, but the reported amounts were + observed under the legislated 25p from 80: the 85-year-old's is still + split net of 25p, and the 77-year-old's in full, so the other components + do not change. Held at 77, the second record is on the new State Pension + by 2030-31, and a new State Pension gets no age addition, reformed or not: + the addition belongs to a retirement pension under the 1992 Act + (s.79(1)).""" people = [ {"age": 85, "male": True, "months": 3, "weekly": 169.75}, {"age": 77, "male": True, "months": 3, "weekly": 169.5}, @@ -944,11 +970,16 @@ def test_age_addition_reforms_leave_the_reported_split_alone(): "gov.dwp.state_pension.age_addition.age": 75, }, ) - for year in (DATA_YEAR, 2027, 2030): - assert ( - list(calculate(reformed, "state_pension_age_addition", year)) - == [10 * WEEKS_IN_YEAR] * 2 - ) + types = { + DATA_YEAR: ["BASIC", "BASIC"], + 2027: ["BASIC", "BASIC"], + 2030: ["BASIC", "NEW"], + } + for year, year_types in types.items(): + assert list(calculate(reformed, "state_pension_type", year)) == year_types + assert list(calculate(reformed, "state_pension_age_addition", year)) == [ + 10 * WEEKS_IN_YEAR if t == "BASIC" else 0 for t in year_types + ], year for variable in COMPONENTS: assert calculate(reformed, variable, year) == pytest.approx( calculate(baseline, variable, year), abs=1e-6 From 03adbc9d8f0d3e6f0075009fe6b33f58cd05ec07 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 11 Oct 2026 23:45:31 -0400 Subject: [PATCH 05/13] Say precisely why the model taxes the age addition with the pension ITEPA 2003 s.577(2) lists the SSCBA 1992 retirement pension sections but not s.79, so the docs now say the model taxes the age addition as part of the pension it increases (s.79(1)), and that s.677 does not exempt it. Co-Authored-By: Claude Opus 5.5 --- docs/book/programs/gov/dwp/state-pension.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/book/programs/gov/dwp/state-pension.md b/docs/book/programs/gov/dwp/state-pension.md index 26f617c509..edd6c4fdd5 100644 --- a/docs/book/programs/gov/dwp/state-pension.md +++ b/docs/book/programs/gov/dwp/state-pension.md @@ -54,12 +54,14 @@ assumes the reported amount of a basic State Pension recipient over 80 includes it. `state_pension_reported_excluding_age_addition` takes the data year's addition off, at the legislated 25p from 80, and the other three components split what is left. The addition is part of `state_pension`, so -it is taxed and means-tested as the pension is: it is an increase of the -pension (s.79(1)), which income tax charges as pension income under +it is taxed and means-tested as the pension is. It is an increase of the +pension (s.79(1)), so the model taxes it with the pension it increases: [ITEPA 2003 s.577](https://www.legislation.gov.uk/ukpga/2003/1/section/577) -(the pre-2003 charge in ICTA 1988 s.617(1) reached every benefit under Parts -II to IV of the 1992 Act not excepted, and the age addition was not), and -Pension Credit counts it as retirement pension income +charges the retirement pensions under SSCBA 1992 ss.44, 48A to 48BB, 51 and +78 as pension income, without naming s.79, and s.677 does not exempt the age +addition (the pre-2003 charge in ICTA 1988 s.617(1) reached every benefit +under Parts II to IV of the 1992 Act not excepted, and the age addition was +not excepted). Pension Credit counts it as retirement pension income ([State Pension Credit Act 2002 s.16(1)(e)](https://www.legislation.gov.uk/ukpga/2002/16/section/16)), as do Universal Credit (Universal Credit Regulations 2013 regs 66(1)(a) and 67) and pension-age Housing Benefit (Housing Benefit (State Pension Credit) From f7e8df354d4c50ed48c24d29975d3b00f94cc22a Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Tue, 20 Oct 2026 18:09:11 -0400 Subject: [PATCH 06/13] Count the age addition in the Carer Support Payment overlap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SSI 2023/302 reg 16(3)(a) and (6) overlap Carer Support Payment with a Retirement Pension "payable under Part II and Part III of the 1992 Act, excluding any additional pension or graduated retirement benefit". The age addition (SSCBA 1992 s.79, Part III) is not excluded, unlike for Carer's Allowance (SI 1979/597 reg 4(3)). Split the overlap into overlapping_state_pension (Carer's Allowance, unchanged) and carer_support_payment_overlapping_state_pension, sharing one helper. Correct CSP Case 6 to £2,013 and add the under-80 case. Document the two edges the review named: a report below 25p a week, and the contributed state_pension_increase reform scaling the addition. Co-Authored-By: Claude Opus 5.5 --- docs/book/programs/gov/dwp/state-pension.md | 16 +++- .../overlapping_benefits.yaml | 5 +- ..._support_payment_overlapping_benefits.yaml | 21 ++++- .../gov/dwp/overlapping_state_pension.py | 79 +++++++++++-------- ...pport_payment_overlapping_state_pension.py | 33 ++++++++ 5 files changed, 116 insertions(+), 38 deletions(-) create mode 100644 policyengine_uk/variables/gov/social_security_scotland/carer_support_payment_overlapping_state_pension.py diff --git a/docs/book/programs/gov/dwp/state-pension.md b/docs/book/programs/gov/dwp/state-pension.md index 0eaf9f31b8..a9d2b42271 100644 --- a/docs/book/programs/gov/dwp/state-pension.md +++ b/docs/book/programs/gov/dwp/state-pension.md @@ -68,7 +68,21 @@ pension-age Housing Benefit (Housing Benefit (State Pension Credit) Regulations 2006 reg 29(1)(c)). It never reduces Carer's Allowance: an age addition is adjusted only by reference to another age addition ([Overlapping Benefits Regulations 1979 reg 4(3)](https://www.legislation.gov.uk/uksi/1979/597/regulation/4) -and Sch 1 row 4). +and Sch 1 row 4), so `overlapping_state_pension` leaves it out. It does +reduce Scotland's Carer Support Payment: that payment overlaps with a +Retirement Pension, defined as "a pension payable under Part II and Part III +of the 1992 Act, excluding any additional pension or graduated retirement +benefit" +([SSI 2023/302 reg 16(3)(a) and (6)](https://www.legislation.gov.uk/ssi/2023/302/regulation/16)), +and the age addition is in Part III. So +`carer_support_payment_overlapping_state_pension` keeps it in. + +Two edges. A basic State Pension recipient over 80 whose reported amount is +below the addition (under 25p a week) has a reported amount of nil once the +addition is taken off, and is paid the £13 a year, which is more than they +reported. And the contributed `gov.contrib.cec.state_pension_increase` +reform scales `state_pension` as a whole, age addition included, although no +Up-rating Order raises the age addition. The basic, new and additional State Pension split the amount a person reported in the data year (the dataset's first year), less any age addition, diff --git a/policyengine_uk/parameters/gov/social_security_scotland/carer_support_payment/overlapping_benefits.yaml b/policyengine_uk/parameters/gov/social_security_scotland/carer_support_payment/overlapping_benefits.yaml index d695aa181e..1f5fc63b61 100644 --- a/policyengine_uk/parameters/gov/social_security_scotland/carer_support_payment/overlapping_benefits.yaml +++ b/policyengine_uk/parameters/gov/social_security_scotland/carer_support_payment/overlapping_benefits.yaml @@ -11,13 +11,14 @@ metadata: values: # Reg. 16(3) lists State Pension (all of a Pensions Act 2014 Part 1 # pension) and Retirement Pension (excluding additional pension and - # graduated retirement benefit), incapacity benefit, severe disablement + # graduated retirement benefit, but with any age addition, reg. 16(6)), + # incapacity benefit, severe disablement # allowance, maternity allowance, contribution-based JSA and contributory # ESA. Its other overlapping benefits (unemployability supplement, widow's # and bereavement benefits, war widow's pension, industrial death benefit, # training allowance) are not held by the model. 2023-11-19: - - overlapping_state_pension + - carer_support_payment_overlapping_state_pension - incapacity_benefit - sda - maternity_allowance diff --git a/policyengine_uk/tests/policy/baseline/gov/social_security_scotland/carer_support_payment_overlapping_benefits.yaml b/policyengine_uk/tests/policy/baseline/gov/social_security_scotland/carer_support_payment_overlapping_benefits.yaml index dae6cb22bc..5bd8bda971 100644 --- a/policyengine_uk/tests/policy/baseline/gov/social_security_scotland/carer_support_payment_overlapping_benefits.yaml +++ b/policyengine_uk/tests/policy/baseline/gov/social_security_scotland/carer_support_payment_overlapping_benefits.yaml @@ -102,7 +102,7 @@ carer_support_payment: 86.45 * 52 - 3_000 scottish_carer_supplement: 11.70 * 52 -- name: Case 6, the additional pension in an old State Pension does not overlap. +- name: Case 6, the additional pension in an old State Pension does not overlap; at 80 its age addition does (SSI 2023/302 reg 16(6)). period: 2026 absolute_error_margin: 0.01 input: @@ -112,7 +112,24 @@ care_hours: 35 country: SCOTLAND output: + state_pension_age_addition: 0.25 * 52 + carer_support_payment_overlapping_state_pension: 2_000 + 0.25 * 52 + # Carer's Allowance still leaves the age addition out (SI 1979/597 reg 4(3)). overlapping_state_pension: 2_000 + carer_support_payment: 86.45 * 52 - 2_000 - 0.25 * 52 + +- name: Case 6a, below 80 there is no age addition, so only the basic State Pension overlaps. + period: 2026 + absolute_error_margin: 0.01 + input: + age: 79 + basic_state_pension: 2_000 + additional_state_pension: 5_000 + care_hours: 35 + country: SCOTLAND + output: + state_pension_age_addition: 0 + carer_support_payment_overlapping_state_pension: 2_000 carer_support_payment: 86.45 * 52 - 2_000 - name: Case 7, a new State Pension overlaps in full, protected payment included. @@ -125,7 +142,7 @@ care_hours: 35 country: SCOTLAND output: - overlapping_state_pension: 7_000 + carer_support_payment_overlapping_state_pension: 7_000 carer_support_payment: 0 scottish_carer_supplement: 0 diff --git a/policyengine_uk/variables/gov/dwp/overlapping_state_pension.py b/policyengine_uk/variables/gov/dwp/overlapping_state_pension.py index 70b03718bc..a133a3b35b 100644 --- a/policyengine_uk/variables/gov/dwp/overlapping_state_pension.py +++ b/policyengine_uk/variables/gov/dwp/overlapping_state_pension.py @@ -1,18 +1,53 @@ from policyengine_uk.model_api import * +def state_pension_overlapping_part(person, period, age_addition_overlaps: bool): + """The State Pension that overlaps with a carer benefit. + + A new State Pension overlaps in full, including any protected payment + above the full rate. An old State Pension overlaps without its additional + pension, and with or without its age addition as the carer benefit's own + rules say. state_pension can scale its components (a contributed reform + does), so the parts that do not overlap are taken as a share of them. + """ + state_pension = person("state_pension", period) + additional = person("additional_state_pension", period) + age_addition = person("state_pension_age_addition", period) + components = add( + person, + period, + [ + "basic_state_pension", + "new_state_pension", + "additional_state_pension", + "state_pension_age_addition", + ], + ) + pension_type = person("state_pension_type", period) + old_system = pension_type == pension_type.possible_values.BASIC + not_overlapping = old_system * additional + if not age_addition_overlaps: + not_overlapping = not_overlapping + age_addition + not_overlapping_share = np.divide( + not_overlapping, + components, + out=np.zeros_like(components, dtype=float), + where=components > 0, + ) + return state_pension * (1 - not_overlapping_share) + + class overlapping_state_pension(Variable): value_type = float entity = Person - label = "State Pension that overlaps with carer benefits" + label = "State Pension that overlaps with Carer's Allowance" documentation = ( - "The State Pension by which Carer's Allowance and Carer Support Payment " - "are reduced. A new State Pension under Part 1 of the Pensions Act 2014 " - "overlaps in full, including any protected payment above the full rate. " - "An old State Pension overlaps without its additional pension or its " - "age addition. When " - "only a reported total is available, the model estimates its basic " - "component up to the full basic rate and treats the excess as " + "The State Pension by which Carer's Allowance is reduced. A new State " + "Pension under Part 1 of the Pensions Act 2014 overlaps in full, " + "including any protected payment above the full rate. An old State " + "Pension overlaps without its additional pension or its age addition. " + "When only a reported total is available, the model estimates its " + "basic component up to the full basic rate and treats the excess as " "additional pension. This split cannot identify basic-pension " "increments above that rate or additional pension within a partial " "pension below it. A State Pension supplied directly, with no " @@ -24,34 +59,12 @@ class overlapping_state_pension(Variable): "https://www.legislation.gov.uk/uksi/1979/597/regulation/4", "https://www.legislation.gov.uk/uksi/1979/597/regulation/12", "https://www.legislation.gov.uk/uksi/1979/597/schedule/1", - "https://www.legislation.gov.uk/ssi/2023/302/regulation/16", ) def formula(person, period, parameters): - state_pension = person("state_pension", period) - additional = person("additional_state_pension", period) # An age addition is adjusted only by reference to another age # addition (SI 1979/597 reg 4(3); Sch 1 row 4, "except any age - # addition"), so it never reduces a carer benefit. - age_addition = person("state_pension_age_addition", period) - components = add( - person, - period, - [ - "basic_state_pension", - "new_state_pension", - "additional_state_pension", - "state_pension_age_addition", - ], - ) - pension_type = person("state_pension_type", period) - old_system = pension_type == pension_type.possible_values.BASIC - # state_pension can scale its components (a contributed reform does), - # so take the parts that do not overlap as a share of them. - not_overlapping_share = np.divide( - old_system * additional + age_addition, - components, - out=np.zeros_like(components, dtype=float), - where=components > 0, + # addition"), so it never reduces Carer's Allowance. + return state_pension_overlapping_part( + person, period, age_addition_overlaps=False ) - return state_pension * (1 - not_overlapping_share) diff --git a/policyengine_uk/variables/gov/social_security_scotland/carer_support_payment_overlapping_state_pension.py b/policyengine_uk/variables/gov/social_security_scotland/carer_support_payment_overlapping_state_pension.py new file mode 100644 index 0000000000..cc90c205a5 --- /dev/null +++ b/policyengine_uk/variables/gov/social_security_scotland/carer_support_payment_overlapping_state_pension.py @@ -0,0 +1,33 @@ +from policyengine_uk.model_api import * +from policyengine_uk.variables.gov.dwp.overlapping_state_pension import ( + state_pension_overlapping_part, +) + + +class carer_support_payment_overlapping_state_pension(Variable): + value_type = float + entity = Person + label = "State Pension that overlaps with Carer Support Payment" + documentation = ( + "The State Pension by which Carer Support Payment is reduced. A new " + "State Pension overlaps in full, including any protected payment above " + "the full rate. An old State Pension (a Retirement Pension) overlaps " + "without its additional pension but with its age addition: the " + "regulations exclude only additional pension and graduated retirement " + "benefit. The model's reported-total split and input convention are " + "those of overlapping_state_pension." + ) + definition_period = YEAR + unit = GBP + reference = "https://www.legislation.gov.uk/ssi/2023/302/regulation/16" + + def formula(person, period, parameters): + # SSI 2023/302 reg 16(3)(a) lists "State Pension or Retirement + # Pension", and reg 16(6) defines Retirement Pension as "a pension + # payable under Part II and Part III of the 1992 Act, excluding any + # additional pension or graduated retirement benefit". The age + # addition is in Part III (SSCBA 1992 s.79) and is not excluded, so, + # unlike for Carer's Allowance (SI 1979/597 reg 4(3)), it overlaps. + return state_pension_overlapping_part( + person, period, age_addition_overlaps=True + ) From bc81c88913d9430365e9c9ca03a122d4c4410dd2 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Wed, 21 Oct 2026 14:12:45 -0400 Subject: [PATCH 07/13] Give Carer Support Payment its own reference overlap in the carer property test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From the independent delta review of 9ace2cafd: the test rebuilt one overlapping amount for both carer benefits and left the 25p age addition out of it, so its explicit example of a Scottish carer aged 80 with basic and additional State Pension failed by £13 once Carer Support Payment counted the addition (SSI 2023/302 reg 16(6)). The reference now adds the age addition to the Carer Support Payment overlap only, as the regulations do, and keeps it out of Carer's Allowance (SI 1979/597 reg 4(3)). Co-Authored-By: Claude Opus 5.5 --- ...t_carer_overlapping_benefits_properties.py | 37 ++++++++++++++----- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/policyengine_uk/tests/test_carer_overlapping_benefits_properties.py b/policyengine_uk/tests/test_carer_overlapping_benefits_properties.py index 355508bd56..8c45afad05 100644 --- a/policyengine_uk/tests/test_carer_overlapping_benefits_properties.py +++ b/policyengine_uk/tests/test_carer_overlapping_benefits_properties.py @@ -8,7 +8,10 @@ benefit paid with an old State Pension are left out (regs 4(2)(f) and 12). The Carer Support Payment Regulations (SSI 2023/302) reg 16(2)-(3) reduce Carer Support Payment in the same way, to £0 where the overlapping benefit is at -least as much. +least as much, with one difference: reg 16(6) leaves only additional pension +and graduated retirement benefit out of an old State Pension, so the 25p age +addition at 80 overlaps Carer Support Payment, while it never overlaps Carer's +Allowance (SI 1979/597 reg 4(3)). Invariants, for carers in England, Wales and Scotland in 2026, who qualify by hours or by a reported award, with State Pension supplied directly, by @@ -227,10 +230,11 @@ def rates(sim): def reference(people, sim, extra=None): - """Unadjusted and overlapping amounts rebuilt from the drawn inputs.""" + """Unadjusted amounts, and the overlapping amounts for Carer's Allowance + and for Carer Support Payment, rebuilt from the drawn inputs.""" extra = extra or [0.0] * len(people) r = rates(sim) - unadjusted_ca, unadjusted_csp, overlapping = [], [], [] + unadjusted_ca, unadjusted_csp, overlapping, overlapping_csp = [], [], [], [] for i, person in enumerate(people): qualifies = ( person["care_hours"] >= r["min_hours"] @@ -242,6 +246,10 @@ def reference(people, sim, extra=None): pension_type = pension_type_for(person) pension = person["pension"] + extra[i] mode = person["mode"] + # The 25p age addition (SSCBA 1992 s.79): an old State Pension from 80. + # It overlaps Carer Support Payment (SSI 2023/302 reg 16(6)) but not + # Carer's Allowance (SI 1979/597 reg 4(3)). + age_addition = 0.0 if mode == "direct": # The model's convention: with no components, all of it overlaps. state_pension = pension @@ -251,13 +259,14 @@ def reference(people, sim, extra=None): # overlap. A new State Pension overlaps in full, protected payment # included, and there is none before pensionable age. From 80 an # old State Pension is taken to include the 25p age addition, - # which does not overlap either (SI 1979/597 reg 4(3)). + # which overlaps Carer Support Payment only. with_age_addition = ( pension_type == "BASIC" and person["age"] >= r["age_addition_age"] and pension > 0 ) - basic_reported = max(pension - r["age_addition"] * with_age_addition, 0) + age_addition = r["age_addition"] * with_age_addition + basic_reported = max(pension - age_addition, 0) state_pension = { "BASIC": min(basic_reported, r["basic"]), "NEW": pension, @@ -269,15 +278,25 @@ def reference(people, sim, extra=None): "NEW": pension + person["additional"], "NONE": 0, }[pension_type] + # Components given directly bring the addition whenever there is + # a basic or additional State Pension. + age_addition = r["age_addition"] * ( + pension_type == "BASIC" + and person["age"] >= r["age_addition_age"] + and (pension > 0 or person["additional"] > 0) + ) else: state_pension = 0 # sda is not drawn, so the other overlapping benefits are the four # reported contributory benefits. - overlapping.append(state_pension + sum(person["other"].values())) + other = sum(person["other"].values()) + overlapping.append(state_pension + other) + overlapping_csp.append(state_pension + age_addition + other) return ( np.array(unadjusted_ca), np.array(unadjusted_csp), np.array(overlapping), + np.array(overlapping_csp), ) @@ -325,7 +344,7 @@ def test_overlap_bounds_and_reference(people): ca, csp = calc(sim, "carers_allowance"), calc(sim, "carer_support_payment") ca_pre = calc(sim, "carers_allowance_pre_overlap") csp_pre = calc(sim, "carer_support_payment_pre_overlap") - ref_ca_pre, ref_csp_pre, ref_overlap = reference(people, sim) + ref_ca_pre, ref_csp_pre, ref_overlap, ref_overlap_csp = reference(people, sim) # Components are assigned using age and gender, independently of the # model's calculated type. Check the default-birthday reference as well. @@ -349,12 +368,12 @@ def test_overlap_bounds_and_reference(people): np.testing.assert_allclose(ca_pre, ref_ca_pre, atol=TOLERANCE) np.testing.assert_allclose(csp_pre, ref_csp_pre, atol=TOLERANCE) np.testing.assert_allclose(ca_overlap, ref_overlap, atol=TOLERANCE) - np.testing.assert_allclose(csp_overlap, ref_overlap, atol=TOLERANCE) + np.testing.assert_allclose(csp_overlap, ref_overlap_csp, atol=TOLERANCE) np.testing.assert_allclose( ca, np.maximum(ref_ca_pre - ref_overlap, 0), atol=TOLERANCE ) np.testing.assert_allclose( - csp, np.maximum(ref_csp_pre - ref_overlap, 0), atol=TOLERANCE + csp, np.maximum(ref_csp_pre - ref_overlap_csp, 0), atol=TOLERANCE ) # 5. Scottish Carer Supplement only, and in full, with a payable CSP. From 8eb9a0af7c9c70b07461d4181139c2b141806c81 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Wed, 28 Oct 2026 14:33:32 -0400 Subject: [PATCH 08/13] Pin a reported Scottish carer at 80 in the overlap property test The age addition is part of a reported old State Pension from 80 and overlaps Carer Support Payment (SSI 2023/302 reg 16(6)), so a 3,000 report overlaps in full and the payment is 4,495.40 - 3,000. Co-Authored-By: Claude Opus 5.5 --- .../tests/test_carer_overlapping_benefits_properties.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/policyengine_uk/tests/test_carer_overlapping_benefits_properties.py b/policyengine_uk/tests/test_carer_overlapping_benefits_properties.py index 8c45afad05..1f2e5b8a69 100644 --- a/policyengine_uk/tests/test_carer_overlapping_benefits_properties.py +++ b/policyengine_uk/tests/test_carer_overlapping_benefits_properties.py @@ -338,6 +338,9 @@ def pinned(age, country, mode, pension, additional=0.0, gender="MALE"): ] ) @example(people=[pinned(80, "WALES", "reported", 3_000)]) +# A reported old State Pension from 80 in Scotland: the 25p addition is part +# of the report and overlaps Carer Support Payment, so 2,987 + 13 overlaps. +@example(people=[pinned(80, "SCOTLAND", "reported", 3_000, gender="FEMALE")]) @example(people=[pinned(70, "ENGLAND", "direct", 4_495.4)]) def test_overlap_bounds_and_reference(people): sim = build(people) From 1e5771c12eb63098ff0679c81254c2f5824732a9 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Mon, 2 Nov 2026 07:30:40 -0500 Subject: [PATCH 09/13] Document the State Pension's 52 weeks and test survey data to Income Tax The State Pension components read state_pension_reported back at 52 weeks a year and split it at the full weekly rate, so a dataset must annualise the State Pension at 52 weeks. policyengine-uk-data used 365.25 / 7, so every full-rate pensioner carried an add-on they do not get, which put people whose only income is the full new State Pension on the Pension Tax Allowance's taper, paying tax (policyengine-uk-data#644 fixes the data). state_pension_reported now says so, and new tests follow a 2024-25 survey record to Income Tax: a full-rate reporter has no add-on in any year; Steph pays no Income Tax in 2027-28 to 2029-30, the same as when her State Pension is given directly; and near the full new rate only the add-on is taxed, at most 8/15 of it. Co-Authored-By: Claude Opus 5.5 --- .../state-pension-reported-weeks.changed.md | 1 + .../test_state_pension_reported_weeks.py | 193 ++++++++++++++++++ .../gov/dwp/state_pension_reported.py | 9 + 3 files changed, 203 insertions(+) create mode 100644 changelog.d/state-pension-reported-weeks.changed.md create mode 100644 policyengine_uk/tests/test_state_pension_reported_weeks.py diff --git a/changelog.d/state-pension-reported-weeks.changed.md b/changelog.d/state-pension-reported-weeks.changed.md new file mode 100644 index 0000000000..615785998d --- /dev/null +++ b/changelog.d/state-pension-reported-weeks.changed.md @@ -0,0 +1 @@ +Document that state_pension_reported is the weekly State Pension times 52, the weeks the State Pension components read it back at, and test the route from a survey's weekly amount to Income Tax under the Pension Tax Allowance. diff --git a/policyengine_uk/tests/test_state_pension_reported_weeks.py b/policyengine_uk/tests/test_state_pension_reported_weeks.py new file mode 100644 index 0000000000..7d74b0eade --- /dev/null +++ b/policyengine_uk/tests/test_state_pension_reported_weeks.py @@ -0,0 +1,193 @@ +"""The State Pension a survey reports, read back at 52 weeks a year. + +basic_state_pension, new_state_pension and additional_state_pension divide +state_pension_reported by policyengine-core's 52 weeks a year and split the +weekly amount at the full rate of the person's type in the data year. A dataset +must therefore annualise the State Pension at 52 weeks. At 365.25 / 7, which +policyengine-uk-data used until policyengine-uk-data#644, every full-rate +pensioner read 0.34% above the full rate and carried an add-on they do not +get, which put people whose only income is the full new State Pension on the +Pension Tax Allowance's taper, paying tax. + +These cases build simulations from 2024-25 data projected forward, as survey +data is (ages held fixed), and check the route from a reported weekly amount to +Income Tax: + +- a pensioner reporting exactly the data year's full rate has no add-on in any + year; +- Steph, whose only income is the full new State Pension, pays no Income Tax + in 2027-28 to 2029-30, as HM Treasury's explainer says, and the same as when + her State Pension is given directly; +- near the full new rate, no one reporting at most the full rate pays Income + Tax, and above it the tax never exceeds 8/15 of the add-on (20% on it plus a + third of it off the allowance). + +policyengine-core holds amounts as float32, so £11,502.40 reads back about a +ten-thousandth of a penny above £221.20 a week; comparisons allow a penny. +""" + +import numpy as np +import pandas as pd +import pytest +from hypothesis import HealthCheck, given, settings +from hypothesis import strategies as st + +from policyengine_uk import Microsimulation, Simulation +from policyengine_uk.data import UKSingleYearDataset +from policyengine_uk.system import system + +DATA_YEAR = 2024 +PTA_YEARS = [2027, 2028, 2029] +WEEKS_IN_YEAR = 52 +# Ages held through the projection: reached State Pension age in 2020 (new +# State Pension) and in 2005 (basic State Pension). +AGE = {"NEW": 70, "BASIC": 85} +PENNY = 0.01 + + +def survey_simulation(weekly, pension_types) -> Microsimulation: + """2024-25 data with one pensioner per household, reporting `weekly` a + week of State Pension annualised at 52 weeks, and nothing else.""" + ids = np.arange(len(weekly)) + person = pd.DataFrame( + { + "person_id": ids, + "person_benunit_id": ids, + "person_household_id": ids, + "age": [AGE[t] for t in pension_types], + "gender": "FEMALE", + "state_pension_reported": np.asarray(weekly) * WEEKS_IN_YEAR, + } + ) + household = pd.DataFrame( + { + "household_id": ids, + "household_weight": np.ones(len(ids)), + "region": "LONDON", + "tenure_type": "OWNED_OUTRIGHT", + "rent": 0.0, + "council_tax": 0.0, + } + ) + return Microsimulation( + dataset=UKSingleYearDataset( + person=person, + benunit=pd.DataFrame({"benunit_id": ids}), + household=household, + fiscal_year=DATA_YEAR, + ) + ) + + +def calculate(sim, variable, year) -> np.ndarray: + # A Microsimulation returns a weighted series, a Simulation an array. + values = sim.calculate(variable, year) + return np.asarray(getattr(values, "values", values)) + + +def full_rates(year) -> dict: + p = system.parameters.gov.dwp.state_pension + return { + "NEW": p.new_state_pension.amount(year), + "BASIC": p.basic_state_pension.amount(year), + } + + +@pytest.fixture(scope="module") +def full_rate_reporters(): + types = ["NEW", "BASIC"] + rates = full_rates(DATA_YEAR) + return survey_simulation([rates[t] for t in types], types), types + + +@pytest.mark.parametrize("year", range(DATA_YEAR, 2031)) +def test_full_rate_reporters_have_no_add_on_in_any_year(full_rate_reporters, year): + sim, types = full_rate_reporters + rates = full_rates(year) + + assert calculate(sim, "state_pension_type", year).astype(str).tolist() == types + assert np.all(calculate(sim, "additional_state_pension", year) < PENNY) + assert calculate(sim, "new_state_pension", year)[0] == pytest.approx( + WEEKS_IN_YEAR * rates["NEW"], abs=PENNY + ) + assert calculate(sim, "basic_state_pension", year)[1] == pytest.approx( + WEEKS_IN_YEAR * rates["BASIC"], abs=PENNY + ) + + +@pytest.mark.parametrize("year", PTA_YEARS) +def test_steph_pays_no_income_tax_from_survey_data_or_given_directly( + full_rate_reporters, year +): + """Steph's only income is the full new State Pension: £13,036.40 in + 2027-28, 52 weeks at £250.70. The Pension Tax Allowance removes all her + tax, whether her State Pension comes from a survey's weekly amount or is + given directly.""" + sim, _ = full_rate_reporters + threshold = WEEKS_IN_YEAR * full_rates(year)["NEW"] + personal_allowance = system.parameters( + f"{year}-04-30" + ).gov.hmrc.income_tax.allowances.personal_allowance.amount + tax_before_allowance = 0.2 * (threshold - personal_allowance) + + direct = Simulation( + situation={ + "people": { + "steph": { + "age": {year: AGE["NEW"]}, + "state_pension": {year: threshold}, + } + }, + "benunits": {"benunit": {"members": ["steph"]}}, + "households": { + "household": {"members": ["steph"], "region": {year: "LONDON"}} + }, + } + ) + + from_survey = { + v: calculate(sim, v, year)[0] + for v in ("state_pension", "income_tax", "pension_tax_allowance") + } + given_directly = {v: calculate(direct, v, year)[0] for v in from_survey} + + assert from_survey["state_pension"] == pytest.approx(threshold, abs=PENNY) + assert from_survey["income_tax"] == pytest.approx(0, abs=PENNY) + # Not vacuous: without the allowance she would pay basic-rate tax. + assert tax_before_allowance > 90 + assert from_survey["pension_tax_allowance"] == pytest.approx( + tax_before_allowance, abs=PENNY + ) + for v in from_survey: + assert from_survey[v] == pytest.approx(given_directly[v], abs=PENNY), v + + +@settings( + max_examples=10, + deadline=None, + derandomize=True, + suppress_health_check=[HealthCheck.too_slow], +) +@given( + offsets=st.lists( + st.one_of( + st.floats(min_value=-5, max_value=5, allow_nan=False), + st.sampled_from([0.0, -0.01, 0.01]), + ), + min_size=1, + max_size=40, + ) +) +def test_near_the_full_rate_only_the_add_on_is_taxed(offsets): + """New State Pension reporters within £5 a week of the full rate, with no + other income, in each year of the allowance.""" + offsets = np.asarray(offsets) + rates = full_rates(DATA_YEAR) + sim = survey_simulation(rates["NEW"] + offsets, ["NEW"] * len(offsets)) + at_or_below = offsets <= 0 + for year in PTA_YEARS: + add_on = calculate(sim, "additional_state_pension", year) + tax = calculate(sim, "income_tax", year) + assert np.all(add_on[at_or_below] < PENNY), year + assert np.all(tax[at_or_below] < PENNY), year + assert np.all(tax <= 8 / 15 * add_on + PENNY), year diff --git a/policyengine_uk/variables/gov/dwp/state_pension_reported.py b/policyengine_uk/variables/gov/dwp/state_pension_reported.py index 3fdf232e62..851ee34f00 100644 --- a/policyengine_uk/variables/gov/dwp/state_pension_reported.py +++ b/policyengine_uk/variables/gov/dwp/state_pension_reported.py @@ -5,6 +5,15 @@ class state_pension_reported(Variable): value_type = float entity = Person label = "Reported income from the State Pension" + documentation = ( + "The State Pension a survey reports, as an annual amount: the weekly " + "amount times 52. basic_state_pension, new_state_pension and " + "additional_state_pension divide it by 52 and split the weekly amount " + "at the full rate of the person's type in the data year, so a dataset " + "must annualise weekly amounts at 52 weeks. At 365.25 / 7, a full-rate " + "pensioner reads 0.34% above the full rate and gets the excess as " + "additional State Pension or a protected payment." + ) definition_period = YEAR unit = GBP From f10a566621ef4798d983787ead84c5382c71043d Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Mon, 2 Nov 2026 08:07:28 -0500 Subject: [PATCH 10/13] Say which type and which year's rate split the reported State Pension The components split state_pension_reported at the data year's full rate for the type the person has in the year being calculated, not their type in the data year (Sol review of #2818). The tests hold ages whose type never changes. Correct the float32 note to about a thousandth of a penny a week. Co-Authored-By: Claude Opus 5.5 --- .../tests/test_state_pension_reported_weeks.py | 12 +++++++----- .../variables/gov/dwp/state_pension_reported.py | 9 +++++---- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/policyengine_uk/tests/test_state_pension_reported_weeks.py b/policyengine_uk/tests/test_state_pension_reported_weeks.py index 7d74b0eade..2f22044d97 100644 --- a/policyengine_uk/tests/test_state_pension_reported_weeks.py +++ b/policyengine_uk/tests/test_state_pension_reported_weeks.py @@ -2,16 +2,17 @@ basic_state_pension, new_state_pension and additional_state_pension divide state_pension_reported by policyengine-core's 52 weeks a year and split the -weekly amount at the full rate of the person's type in the data year. A dataset -must therefore annualise the State Pension at 52 weeks. At 365.25 / 7, which +weekly amount at the data year's full rate for the type the person has in the +year being calculated. A dataset must therefore annualise the State Pension at +52 weeks. At 365.25 / 7, which policyengine-uk-data used until policyengine-uk-data#644, every full-rate pensioner read 0.34% above the full rate and carried an add-on they do not get, which put people whose only income is the full new State Pension on the Pension Tax Allowance's taper, paying tax. These cases build simulations from 2024-25 data projected forward, as survey -data is (ages held fixed), and check the route from a reported weekly amount to -Income Tax: +data is (ages held fixed, at ages whose type stays the same in every year), and +check the route from a reported weekly amount to Income Tax: - a pensioner reporting exactly the data year's full rate has no add-on in any year; @@ -23,7 +24,8 @@ third of it off the allowance). policyengine-core holds amounts as float32, so £11,502.40 reads back about a -ten-thousandth of a penny above £221.20 a week; comparisons allow a penny. +thousandth of a penny above £221.20 a week (0.0012p, or 0.063p a year); +comparisons allow a penny. """ import numpy as np diff --git a/policyengine_uk/variables/gov/dwp/state_pension_reported.py b/policyengine_uk/variables/gov/dwp/state_pension_reported.py index 851ee34f00..2eb40271d8 100644 --- a/policyengine_uk/variables/gov/dwp/state_pension_reported.py +++ b/policyengine_uk/variables/gov/dwp/state_pension_reported.py @@ -9,10 +9,11 @@ class state_pension_reported(Variable): "The State Pension a survey reports, as an annual amount: the weekly " "amount times 52. basic_state_pension, new_state_pension and " "additional_state_pension divide it by 52 and split the weekly amount " - "at the full rate of the person's type in the data year, so a dataset " - "must annualise weekly amounts at 52 weeks. At 365.25 / 7, a full-rate " - "pensioner reads 0.34% above the full rate and gets the excess as " - "additional State Pension or a protected payment." + "at the data year's full rate for the type the person has in the year " + "being calculated, so a dataset must annualise weekly amounts at 52 " + "weeks. At 365.25 / 7, a full-rate pensioner reads 0.34% above the " + "full rate and gets the excess as additional State Pension or a " + "protected payment." ) definition_period = YEAR unit = GBP From 54cffcec8e37a2efdc3f99af01a026c8a2a52f5e Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Mon, 2 Nov 2026 08:08:48 -0500 Subject: [PATCH 11/13] Name the simulated year in the State Pension split docs Co-Authored-By: Claude Opus 5.5 --- policyengine_uk/tests/test_state_pension_reported_weeks.py | 4 ++-- policyengine_uk/variables/gov/dwp/state_pension_reported.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/policyengine_uk/tests/test_state_pension_reported_weeks.py b/policyengine_uk/tests/test_state_pension_reported_weeks.py index 2f22044d97..1537fec5a7 100644 --- a/policyengine_uk/tests/test_state_pension_reported_weeks.py +++ b/policyengine_uk/tests/test_state_pension_reported_weeks.py @@ -3,8 +3,8 @@ basic_state_pension, new_state_pension and additional_state_pension divide state_pension_reported by policyengine-core's 52 weeks a year and split the weekly amount at the data year's full rate for the type the person has in the -year being calculated. A dataset must therefore annualise the State Pension at -52 weeks. At 365.25 / 7, which +simulated year. A dataset must therefore annualise the State Pension at 52 +weeks. At 365.25 / 7, which policyengine-uk-data used until policyengine-uk-data#644, every full-rate pensioner read 0.34% above the full rate and carried an add-on they do not get, which put people whose only income is the full new State Pension on the diff --git a/policyengine_uk/variables/gov/dwp/state_pension_reported.py b/policyengine_uk/variables/gov/dwp/state_pension_reported.py index 2eb40271d8..1acf348c62 100644 --- a/policyengine_uk/variables/gov/dwp/state_pension_reported.py +++ b/policyengine_uk/variables/gov/dwp/state_pension_reported.py @@ -9,8 +9,8 @@ class state_pension_reported(Variable): "The State Pension a survey reports, as an annual amount: the weekly " "amount times 52. basic_state_pension, new_state_pension and " "additional_state_pension divide it by 52 and split the weekly amount " - "at the data year's full rate for the type the person has in the year " - "being calculated, so a dataset must annualise weekly amounts at 52 " + "at the data year's full rate for the type the person has in the " + "simulated year, so a dataset must annualise weekly amounts at 52 " "weeks. At 365.25 / 7, a full-rate pensioner reads 0.34% above the " "full rate and gets the excess as additional State Pension or a " "protected payment." From 496ee5285939dd4e738c72fe9637126da5d80ce1 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 2 Nov 2026 20:33:37 +0000 Subject: [PATCH 12/13] Report the age addition with the full basic rate in the reported weeks test #2340 reads a basic State Pension recipient aged 80 or over as reporting the 25p age addition. The basic reporter is 85, so it now reports the full basic rate plus the addition, and the test checks that the model pays the addition at the data year's 25p in every year. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01LwQq6GwwVa9CRxP94r4i4J --- .../test_state_pension_reported_weeks.py | 36 ++++++++++++++----- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/policyengine_uk/tests/test_state_pension_reported_weeks.py b/policyengine_uk/tests/test_state_pension_reported_weeks.py index 1537fec5a7..323d2ca3e8 100644 --- a/policyengine_uk/tests/test_state_pension_reported_weeks.py +++ b/policyengine_uk/tests/test_state_pension_reported_weeks.py @@ -1,10 +1,11 @@ """The State Pension a survey reports, read back at 52 weeks a year. -basic_state_pension, new_state_pension and additional_state_pension divide -state_pension_reported by policyengine-core's 52 weeks a year and split the -weekly amount at the data year's full rate for the type the person has in the -simulated year. A dataset must therefore annualise the State Pension at 52 -weeks. At 365.25 / 7, which +basic_state_pension, new_state_pension and additional_state_pension take +state_pension_reported less any age addition +(state_pension_reported_excluding_age_addition), divide it by +policyengine-core's 52 weeks a year and split the weekly amount at the data +year's full rate for the type the person has in the simulated year. A dataset +must therefore annualise the State Pension at 52 weeks. At 365.25 / 7, which policyengine-uk-data used until policyengine-uk-data#644, every full-rate pensioner read 0.34% above the full rate and carried an add-on they do not get, which put people whose only income is the full new State Pension on the @@ -14,8 +15,14 @@ data is (ages held fixed, at ages whose type stays the same in every year), and check the route from a reported weekly amount to Income Tax: -- a pensioner reporting exactly the data year's full rate has no add-on in any - year; +- a pensioner reporting the data year's full rate has no add-on in any + year. The new State Pension reporter is 70 and reports the full new rate. + The basic State Pension reporter is 85. With ages held fixed, the model + gives these women the basic type in every year to 2030-31 only from 78. At + 85 a basic State Pension recipient is over 80, so DWP pays her the 25p a + week age addition with the full basic rate. She reports both, and the model + pays the full rate as basic State Pension and the 25p, never uprated, as the + age addition; - Steph, whose only income is the full new State Pension, pays no Income Tax in 2027-28 to 2029-30, as HM Treasury's explainer says, and the same as when her State Pension is given directly; @@ -95,11 +102,19 @@ def full_rates(year) -> dict: } +# The weekly age addition in the data year. DWP pays it to a basic State +# Pension recipient aged 80 or over and never uprates it. +AGE_ADDITION = system.parameters.gov.dwp.state_pension.age_addition.amount(DATA_YEAR) + + @pytest.fixture(scope="module") def full_rate_reporters(): + """A new State Pension reporter at the full new rate, and a basic State + Pension reporter, aged 85, at the full basic rate plus the age addition.""" types = ["NEW", "BASIC"] rates = full_rates(DATA_YEAR) - return survey_simulation([rates[t] for t in types], types), types + weekly = [rates["NEW"], rates["BASIC"] + AGE_ADDITION] + return survey_simulation(weekly, types), types @pytest.mark.parametrize("year", range(DATA_YEAR, 2031)) @@ -115,6 +130,11 @@ def test_full_rate_reporters_have_no_add_on_in_any_year(full_rate_reporters, yea assert calculate(sim, "basic_state_pension", year)[1] == pytest.approx( WEEKS_IN_YEAR * rates["BASIC"], abs=PENNY ) + # The data year's 25p in every year, so not uprated, and none on the new + # State Pension. + assert calculate(sim, "state_pension_age_addition", year).tolist() == ( + pytest.approx([0, WEEKS_IN_YEAR * AGE_ADDITION], abs=PENNY) + ) @pytest.mark.parametrize("year", PTA_YEARS) From caeab613dc0c67461a7ea961bc842a1a1e0755e1 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Mon, 2 Nov 2026 17:36:08 -0500 Subject: [PATCH 13/13] Align #2818's State Pension text with the stacked formulas state_pension_reported's documentation says the three components divide the report by 52, but on this tree they read it less any age addition. Say so. Rewrite the test docstring's sentence on the ages at which the model gives a woman the basic type. Text only. Co-Authored-By: Claude Opus 5.5 --- .../tests/test_state_pension_reported_weeks.py | 2 +- .../variables/gov/dwp/state_pension_reported.py | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/policyengine_uk/tests/test_state_pension_reported_weeks.py b/policyengine_uk/tests/test_state_pension_reported_weeks.py index 323d2ca3e8..ff770b5e2f 100644 --- a/policyengine_uk/tests/test_state_pension_reported_weeks.py +++ b/policyengine_uk/tests/test_state_pension_reported_weeks.py @@ -18,7 +18,7 @@ - a pensioner reporting the data year's full rate has no add-on in any year. The new State Pension reporter is 70 and reports the full new rate. The basic State Pension reporter is 85. With ages held fixed, the model - gives these women the basic type in every year to 2030-31 only from 78. At + gives a woman aged 78 or over the basic type in every year to 2030-31. At 85 a basic State Pension recipient is over 80, so DWP pays her the 25p a week age addition with the full basic rate. She reports both, and the model pays the full rate as basic State Pension and the 25p, never uprated, as the diff --git a/policyengine_uk/variables/gov/dwp/state_pension_reported.py b/policyengine_uk/variables/gov/dwp/state_pension_reported.py index 1acf348c62..c9b9974073 100644 --- a/policyengine_uk/variables/gov/dwp/state_pension_reported.py +++ b/policyengine_uk/variables/gov/dwp/state_pension_reported.py @@ -8,11 +8,12 @@ class state_pension_reported(Variable): documentation = ( "The State Pension a survey reports, as an annual amount: the weekly " "amount times 52. basic_state_pension, new_state_pension and " - "additional_state_pension divide it by 52 and split the weekly amount " - "at the data year's full rate for the type the person has in the " - "simulated year, so a dataset must annualise weekly amounts at 52 " - "weeks. At 365.25 / 7, a full-rate pensioner reads 0.34% above the " - "full rate and gets the excess as additional State Pension or a " + "additional_state_pension take it less any age addition " + "(state_pension_reported_excluding_age_addition), divide it by 52 and " + "split the weekly amount at the data year's full rate for the type the " + "person has in the simulated year, so a dataset must annualise weekly " + "amounts at 52 weeks. At 365.25 / 7, a full-rate pensioner reads 0.34% " + "above the full rate and gets the excess as additional State Pension or a " "protected payment." ) definition_period = YEAR