diff --git a/changelog.d/whd-takeup.added.md b/changelog.d/whd-takeup.added.md new file mode 100644 index 0000000000..8eacfc5d0e --- /dev/null +++ b/changelog.d/whd-takeup.added.md @@ -0,0 +1 @@ +Warm Home Discount receipt rates by group (85% for Pension Credit households, 70% for other qualifying benefits), from DESNZ's 2026 impact assessment, so the rebate no longer goes to every household modelled as receiving a qualifying benefit. diff --git a/policyengine_uk/parameters/gov/ofgem/warm_home_discount/receipt_rate/index.yaml b/policyengine_uk/parameters/gov/ofgem/warm_home_discount/receipt_rate/index.yaml new file mode 100644 index 0000000000..ab6461d9b0 --- /dev/null +++ b/policyengine_uk/parameters/gov/ofgem/warm_home_discount/receipt_rate/index.yaml @@ -0,0 +1,3 @@ +description: Share of households receiving a qualifying benefit in England and Wales that go on to receive the Warm Home Discount rebate. Receipt falls short of eligibility mainly because the benefit recipient, their partner or appointee must be named on the electricity bill, and because some households fail the data match between DWP and supplier records. +metadata: + label: Warm Home Discount receipt rate diff --git a/policyengine_uk/parameters/gov/ofgem/warm_home_discount/receipt_rate/other_benefits.yaml b/policyengine_uk/parameters/gov/ofgem/warm_home_discount/receipt_rate/other_benefits.yaml new file mode 100644 index 0000000000..e2e74e6d85 --- /dev/null +++ b/policyengine_uk/parameters/gov/ofgem/warm_home_discount/receipt_rate/other_benefits.yaml @@ -0,0 +1,12 @@ +description: Share of households receiving a qualifying benefit other than Pension Credit in England and Wales that receive the Warm Home Discount rebate. The Department for Energy Security and Net Zero bases this on delivery experience of the scheme, where around 70% of recipients of other means-tested benefits become rebate recipients. The impact assessment tests 60% and 80% as low and high sensitivities. +values: + 2025-04-01: 0.7 +metadata: + unit: /1 + period: year + label: Warm Home Discount receipt rate, other qualifying benefit households + reference: + - title: "DESNZ, Continuing the Warm Home Discount 2026-2031: final stage impact assessment (DESNZ002(F)-26-EAC, 30 January 2026), para. 40 (page 11) and Table 8 (page 16)" + href: https://assets.publishing.service.gov.uk/media/6978a8b51c24881f40a4d675/continuing-the-warm-home-discount-scheme-impact-assessment.pdf#page=11 + - title: "DESNZ, Continuing the Warm Home Discount 2026-2031: final stage impact assessment, para. 105 and Table 13 (pages 29 and 31; 60% and 80% sensitivities)" + href: https://assets.publishing.service.gov.uk/media/6978a8b51c24881f40a4d675/continuing-the-warm-home-discount-scheme-impact-assessment.pdf#page=29 diff --git a/policyengine_uk/parameters/gov/ofgem/warm_home_discount/receipt_rate/pension_credit.yaml b/policyengine_uk/parameters/gov/ofgem/warm_home_discount/receipt_rate/pension_credit.yaml new file mode 100644 index 0000000000..3aa5376543 --- /dev/null +++ b/policyengine_uk/parameters/gov/ofgem/warm_home_discount/receipt_rate/pension_credit.yaml @@ -0,0 +1,10 @@ +description: Share of households receiving Pension Credit in England and Wales that receive the Warm Home Discount rebate. The Department for Energy Security and Net Zero bases this on delivery experience of the scheme, where around 85% of Pension Credit recipients become rebate recipients. The model applies it to every household where any benefit unit receives Pension Credit. +values: + 2025-04-01: 0.85 +metadata: + unit: /1 + period: year + label: Warm Home Discount receipt rate, Pension Credit households + reference: + - title: "DESNZ, Continuing the Warm Home Discount 2026-2031: final stage impact assessment (DESNZ002(F)-26-EAC, 30 January 2026), para. 40 (page 11) and Table 8 (page 16)" + href: https://assets.publishing.service.gov.uk/media/6978a8b51c24881f40a4d675/continuing-the-warm-home-discount-scheme-impact-assessment.pdf#page=11 diff --git a/policyengine_uk/tests/policy/baseline/gov/ofgem/warm_home_discount_receipt.yaml b/policyengine_uk/tests/policy/baseline/gov/ofgem/warm_home_discount_receipt.yaml new file mode 100644 index 0000000000..d217697c37 --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/ofgem/warm_home_discount_receipt.yaml @@ -0,0 +1,172 @@ +# Warm Home Discount receipt. DESNZ's 2026 impact assessment (para. 40) says +# around 85% of Pension Credit recipients and around 70% of recipients of +# other means-tested benefits become rebate recipients. A household receives +# the rebate when its receipt draw is below its group's rate. Each case sets +# every qualifying benefit explicitly so that only the named one is received. + +- name: Pension Credit household with a receipt draw of 0.84 receives the rebate (0.84 < 85% Pension Credit receipt rate) + period: 2026 + input: + people: + person: + age: 70 + benunits: + benunit: + members: [person] + pension_credit: 1000 + universal_credit: 0 + housing_benefit: 0 + esa_income: 0 + jsa_income: 0 + income_support: 0 + households: + household: + members: [person] + region: LONDON + warm_home_discount_random_draw: 0.84 + output: + would_receive_warm_home_discount: true + warm_home_discount: 150 + +- name: Pension Credit household with a receipt draw of 0.86 doesn't receive the rebate (0.86 >= 85%) + period: 2026 + input: + people: + person: + age: 70 + benunits: + benunit: + members: [person] + pension_credit: 1000 + universal_credit: 0 + housing_benefit: 0 + esa_income: 0 + jsa_income: 0 + income_support: 0 + households: + household: + members: [person] + region: LONDON + warm_home_discount_random_draw: 0.86 + output: + would_receive_warm_home_discount: false + warm_home_discount: 0 + +- name: Universal Credit household with a receipt draw of 0.69 receives the rebate (0.69 < 70% receipt rate for other benefits) + period: 2026 + input: + people: + person: + age: 40 + benunits: + benunit: + members: [person] + pension_credit: 0 + universal_credit: 1000 + housing_benefit: 0 + esa_income: 0 + jsa_income: 0 + income_support: 0 + households: + household: + members: [person] + region: LONDON + warm_home_discount_random_draw: 0.69 + output: + would_receive_warm_home_discount: true + warm_home_discount: 150 + +- name: Universal Credit household with a receipt draw of 0.71 doesn't receive the rebate (0.71 >= 70%) + period: 2026 + input: + people: + person: + age: 40 + benunits: + benunit: + members: [person] + pension_credit: 0 + universal_credit: 1000 + housing_benefit: 0 + esa_income: 0 + jsa_income: 0 + income_support: 0 + households: + household: + members: [person] + region: LONDON + warm_home_discount_random_draw: 0.71 + output: + would_receive_warm_home_discount: false + warm_home_discount: 0 + +- name: Universal Credit household with a receipt draw of 0.8 doesn't receive the rebate, though a Pension Credit household would (0.70 <= 0.8 < 0.85) + period: 2026 + input: + people: + person: + age: 40 + benunits: + benunit: + members: [person] + pension_credit: 0 + universal_credit: 1000 + housing_benefit: 0 + esa_income: 0 + jsa_income: 0 + income_support: 0 + households: + household: + members: [person] + region: LONDON + warm_home_discount_random_draw: 0.8 + output: + would_receive_warm_home_discount: false + warm_home_discount: 0 + +- name: Pension Credit household with a receipt draw of 0.8 receives the rebate (0.8 < 0.85) + period: 2026 + input: + people: + person: + age: 70 + benunits: + benunit: + members: [person] + pension_credit: 1000 + universal_credit: 0 + housing_benefit: 0 + esa_income: 0 + jsa_income: 0 + income_support: 0 + households: + household: + members: [person] + region: LONDON + warm_home_discount_random_draw: 0.8 + output: + would_receive_warm_home_discount: true + warm_home_discount: 150 + +- name: Universal Credit household with no receipt draw set receives the rebate (draw defaults to 0 outside representative data) + period: 2026 + input: + people: + person: + age: 40 + benunits: + benunit: + members: [person] + pension_credit: 0 + universal_credit: 1000 + housing_benefit: 0 + esa_income: 0 + jsa_income: 0 + income_support: 0 + households: + household: + members: [person] + region: LONDON + output: + would_receive_warm_home_discount: true + warm_home_discount: 150 diff --git a/policyengine_uk/tests/test_warm_home_discount_receipt.py b/policyengine_uk/tests/test_warm_home_discount_receipt.py new file mode 100644 index 0000000000..8c45d66076 --- /dev/null +++ b/policyengine_uk/tests/test_warm_home_discount_receipt.py @@ -0,0 +1,151 @@ +"""Warm Home Discount receipt draws follow how a simulation was built, not +how much weight it carries. + +A constituency or region filtered from the national data (as policyengine.py's +RowFilterStrategy does) carries well under a million households of weight and +is still data: each household keeps the draw, rebate and HBAI income it has in +the national run. Household situations get a draw of 0, below any receipt +rate, so calculators show the rebate unless the draw is set. +""" + +import numpy as np +import pandas as pd +import pytest + +from policyengine_uk import Microsimulation, Simulation +from policyengine_uk.data import UKMultiYearDataset, UKSingleYearDataset +from policyengine_uk.utils.data_source import built_from_data +from policyengine_uk.utils.stochastic import splitmix64_uniform + +YEAR = 2026 +REGIONS = np.array(["LONDON", "NORTH_EAST", "WALES", "SOUTH_WEST"]) +# 400 households at this weight carry about 1.6m households of weight; one +# region (a quarter of them) about 0.4m, under the old cutoff of a million. +NATIONAL_SCALE = 3_500 +OUTPUTS = ( + "warm_home_discount_random_draw", + "would_receive_warm_home_discount", + "warm_home_discount", + "hbai_household_net_income", +) + + +def tables(n: int = 400) -> dict: + """n single adults aged 35 with no earnings, all on Universal Credit, in + England and Wales.""" + ids = np.arange(n) + rng = np.random.default_rng(0) + person = pd.DataFrame( + { + "person_id": ids * 10 + 1, + "person_benunit_id": ids, + "person_household_id": ids, + "age": np.full(n, 35), + "employment_income": np.zeros(n), + } + ) + benunit = pd.DataFrame( + { + "benunit_id": ids, + "would_claim_uc": np.ones(n, dtype=bool), + "universal_credit_pre_benefit_cap": np.full(n, 5_000.0), + "uc_benefit_cap_reduction": np.zeros(n), + } + ) + household = pd.DataFrame( + { + "household_id": ids, + "household_weight": NATIONAL_SCALE * rng.lognormal(0, 0.5, n), + "region": REGIONS[ids % len(REGIONS)], + } + ) + return {"person": person, "benunit": benunit, "household": household} + + +def simulation(t: dict) -> Microsimulation: + # Copies: building encodes enum columns in place. + year = UKSingleYearDataset( + person=t["person"].copy(), + benunit=t["benunit"].copy(), + household=t["household"].copy(), + fiscal_year=YEAR, + ) + return Microsimulation(dataset=UKMultiYearDataset(datasets=[year])) + + +def region_of(t: dict, region: str) -> dict: + """Keep one region's households with their benefit units and people.""" + household = t["household"][t["household"].region == region] + person = t["person"][t["person"].person_household_id.isin(household.household_id)] + benunit = t["benunit"][t["benunit"].benunit_id.isin(person.person_benunit_id)] + return { + "person": person.reset_index(drop=True), + "benunit": benunit.reset_index(drop=True), + "household": household.reset_index(drop=True), + } + + +def values(sim, variable: str) -> np.ndarray: + return np.asarray(sim.calculate(variable, YEAR)) + + +@pytest.fixture(scope="module") +def national(): + t = tables() + assert t["household"].household_weight.sum() > 1e6 + return t, simulation(t) + + +def test_national_data_gets_hashed_draws(national): + t, sim = national + ids = t["household"].household_id.values + expected = splitmix64_uniform(ids, salt=2).astype(np.float32) + assert np.array_equal(values(sim, "warm_home_discount_random_draw"), expected) + rebate = values(sim, "warm_home_discount") + # Everyone is on Universal Credit; about 70% receive the rebate. + assert set(np.unique(rebate)) == {0, 150} + assert 0.6 < (rebate > 0).mean() < 0.8 + + +def test_region_filtered_from_data_matches_the_national_run(national): + """Each household in a region filtered from the data keeps its draw, + rebate and HBAI income from the national run, including the households + whose draw is above the receipt rate and so get no rebate.""" + t, sim = national + region = region_of(t, "LONDON") + assert region["household"].household_weight.sum() < 1e6 + regional = simulation(region) + assert built_from_data(regional) + kept = np.isin(t["household"].household_id, region["household"].household_id) + for variable in OUTPUTS: + assert np.array_equal( + values(regional, variable), values(sim, variable)[kept] + ), variable + rebate = values(regional, "warm_home_discount") + assert (rebate == 0).any() and (rebate == 150).any() + + +def test_situations_receive_the_rebate_unless_the_draw_is_set(): + situation = { + "people": {"adult": {"age": {YEAR: 35}}}, + "benunits": { + "benunit": { + "members": ["adult"], + "would_claim_uc": {YEAR: True}, + "universal_credit_pre_benefit_cap": {YEAR: 5_000}, + "uc_benefit_cap_reduction": {YEAR: 0}, + } + }, + "households": { + "household": { + "members": ["adult"], + "region": {YEAR: "LONDON"}, + # A situation is not data, even with the weight of a nation. + "household_weight": {YEAR: 1e9}, + } + }, + } + sim = Simulation(situation=situation) + assert not built_from_data(sim) + assert values(sim, "warm_home_discount_random_draw")[0] == 0 + assert values(sim, "warm_home_discount")[0] == 150 diff --git a/policyengine_uk/variables/gov/ofgem/warm_home_discount.py b/policyengine_uk/variables/gov/ofgem/warm_home_discount.py index b482cae829..529c2d749b 100644 --- a/policyengine_uk/variables/gov/ofgem/warm_home_discount.py +++ b/policyengine_uk/variables/gov/ofgem/warm_home_discount.py @@ -10,7 +10,8 @@ class warm_home_discount(Variable): "Home Discount scheme in England and Wales, in the year containing " "the winter it is paid for. A household qualifies if any member " "receives a qualifying means-tested benefit; the rebate is paid " - "without a claim. Suppliers fund the rebate from their customers' " + "without a claim, but not every qualifying household receives it " + "(see would_receive_warm_home_discount). Suppliers fund the rebate from their customers' " "bills, so it is not government spending, and it is not included in " "household_benefits or household_net_income. HBAI counts it as " "miscellaneous income, so it is included in " @@ -34,4 +35,5 @@ def formula(household, period, parameters): if len(benefits) == 0: return household.empty_array() receives_benefit = add(household, period, benefits) > 0 - return in_scheme_area * receives_benefit * p.amount + receives_rebate = household("would_receive_warm_home_discount", period) + return in_scheme_area * receives_benefit * receives_rebate * p.amount diff --git a/policyengine_uk/variables/gov/ofgem/warm_home_discount_random_draw.py b/policyengine_uk/variables/gov/ofgem/warm_home_discount_random_draw.py new file mode 100644 index 0000000000..1575f0642d --- /dev/null +++ b/policyengine_uk/variables/gov/ofgem/warm_home_discount_random_draw.py @@ -0,0 +1,29 @@ +from policyengine_uk.model_api import * +from policyengine_uk.utils.data_source import built_from_data +from policyengine_uk.utils.stochastic import splitmix64_uniform + + +class warm_home_discount_random_draw(Variable): + label = "Warm Home Discount receipt random draw" + documentation = ( + "Uniform draw on [0, 1) that decides whether a household receiving a " + "qualifying benefit also receives the Warm Home Discount rebate. " + "Deterministic hash of the household id in simulations built from " + "data, including a region or constituency filtered from them; 0 in " + "household situations, so a qualifying household receives the rebate " + "unless this is set. Datasets and situations can override it." + ) + entity = Household + definition_period = YEAR + value_type = float + default_value = 0.0 + + def formula(household, period, parameters): + # Hashed draws in every simulation built from data, however little + # weight it carries: a constituency filtered from the national data is + # still data. Household situations get 0, which is below any receipt + # rate, so calculators show the rebate unless the draw is set. + if not built_from_data(household.simulation): + return np.zeros(household.count) + ids = household("household_id", period) + return splitmix64_uniform(ids, salt=2) diff --git a/policyengine_uk/variables/gov/ofgem/would_receive_warm_home_discount.py b/policyengine_uk/variables/gov/ofgem/would_receive_warm_home_discount.py new file mode 100644 index 0000000000..c5fb34c977 --- /dev/null +++ b/policyengine_uk/variables/gov/ofgem/would_receive_warm_home_discount.py @@ -0,0 +1,23 @@ +from policyengine_uk.model_api import * + + +class would_receive_warm_home_discount(Variable): + label = "Would receive the Warm Home Discount if eligible" + documentation = ( + "Whether a household receiving a qualifying benefit would receive the " + "Warm Home Discount rebate. The rebate is paid without a claim after " + "DWP data is matched with supplier records, but not every recipient " + "is matched or named on the electricity bill. Households where any " + "benefit unit receives Pension Credit use the Pension Credit receipt " + "rate; other households use the rate for other qualifying benefits." + ) + entity = Household + definition_period = YEAR + value_type = bool + + def formula(household, period, parameters): + p = parameters(period).gov.ofgem.warm_home_discount.receipt_rate + receives_pension_credit = add(household, period, ["pension_credit"]) > 0 + rate = where(receives_pension_credit, p.pension_credit, p.other_benefits) + draw = household("warm_home_discount_random_draw", period) + return draw < rate