Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/property-allowance-charge-bound.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Work out the winter fuel payment charge in the property allowance election only where it can change the choice. Add `winter_fuel_payment_charge_ceiling`, the most the charge could be whatever benefits are received, and settle each election on income tax before the charge wherever the ceilings on the two routes cannot reverse it. Each household's landlords now decide in their own order, and every household's next decision is compared in one pair of branches, so the elections that turn on the charge are compared on income tax including it together rather than once per round and rank. Where an input or a structural reform replaces income tax, the ceiling, the charge, the payments it recovers or entitlement to them, or a reform neutralises income tax or the ceiling, every election is still compared on income tax including the charge. Routes, income tax and household net income are unchanged; a Microcosm UK 2024-25 microsimulation builds and calculates 2026 household net income in about half the time.
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# The most the winter fuel payment charge could be, whatever benefits anyone
# receives: the largest amount of each payment whose age and residence
# conditions the person meets (SI 2025/969 reg 3; SSI 2024/351 reg 10 as
# substituted by SSI 2025/282), when the charge has effect and total income
# exceeds £35,000 (ITEPA 2003 s.681I(1)(b)), and nothing otherwise. The
# charge itself is never more.

- name: 2025 pensioner in England over the threshold gets the higher amount
# The higher Winter Fuel Payment, £300, whatever their age or household.
# Under 80 and not on a relevant benefit, they are paid and charged £200.
period: 2025
input:
people:
pensioner:
age: 70
total_income_charged_to_tax: 35_001
benunits:
unit:
members: [pensioner]
pension_credit: 0
households:
household:
members: [pensioner]
country: ENGLAND
output:
winter_fuel_payment_charge_ceiling: [300]
winter_fuel_payment_charge: [200]

- name: 2025 total income of exactly £35,000 has no ceiling
# s.681I(1)(b): total income must exceed £35,000.
period: 2025
input:
people:
pensioner:
age: 70
total_income_charged_to_tax: 35_000
households:
household:
members: [pensioner]
country: ENGLAND
output:
winter_fuel_payment_charge_ceiling: [0]

- name: 2025 Pension Credit exempts from the charge but not the ceiling
# s.681I(4): Pension Credit exempts the claimant. The ceiling leaves benefit
# receipt out.
period: 2025
input:
people:
pensioner:
age: 70
total_income_charged_to_tax: 40_000
benunits:
unit:
members: [pensioner]
pension_credit: 100
households:
household:
members: [pensioner]
country: WALES
output:
winter_fuel_payment_charge_ceiling: [300]
winter_fuel_payment_charge: [0]

- name: 2025 pensioner in Scotland gets the higher PAWHP amount
# SSI 2024/351 reg 10 as substituted: £305.10 for 2025-26.
period: 2025
absolute_error_margin: 0.01
input:
people:
pensioner:
age: 70
total_income_charged_to_tax: 40_000
households:
household:
members: [pensioner]
country: SCOTLAND
output:
winter_fuel_payment_charge_ceiling: [305.1]

- name: 2025 working-age person has no ceiling
# Neither payment's age condition is met.
period: 2025
input:
people:
worker:
age: 50
total_income_charged_to_tax: 60_000
households:
household:
members: [worker]
country: ENGLAND
output:
winter_fuel_payment_charge_ceiling: [0]

- name: 2024 has no ceiling before the charge has effect
# FA 2026 Sch. 10 para. 5: the charge has effect from 2025-26.
period: 2024
input:
people:
pensioner:
age: 70
total_income_charged_to_tax: 60_000
households:
household:
members: [pensioner]
country: ENGLAND
output:
winter_fuel_payment_charge_ceiling: [0]
163 changes: 163 additions & 0 deletions policyengine_uk/tests/test_property_income_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from hypothesis import strategies as st

from policyengine_uk import Simulation
from policyengine_uk.model_api import GBP, Person, Reform, Variable, add

pytestmark = pytest.mark.usefixtures("cloned_uk_tax_benefit_system")

Expand Down Expand Up @@ -571,3 +572,165 @@ def test_a_landlord_without_finance_costs_takes_the_allowance_even_where_it_cost
set_pensioner_inputs(sim, drawn, routes & ~claimants)
with_expenses = sim.calculate("income_tax", PENSIONER_YEAR).astype(float)
assert with_expenses[pinned] == pytest.approx(5_187.40, abs=0.01)


# Reviews r1 and r2 of #2695. winter_fuel_payment_charge_ceiling bounds the
# charge as the model works it out, and the election settles choices on tax
# before the charge only where that ceiling cannot reverse them. Where an
# input or a structural reform replaces income tax, the ceiling, the charge,
# the payments it recovers or entitlement to them, or neutralises income tax
# or the ceiling, every choice is still compared on income tax including the
# charge. Each landlord below has £3,300 of receipts and £200 of expenses in
# England, so total income £800 lower with the allowance, and lower tax
# before the charge with expenses; the charge on the expenses route makes the
# allowance cheaper.
CHARGE_YEAR = 2026


class winter_fuel_payment_charge(Variable):
"""A reform's charge: half the payment, over £30,000 of total income."""

value_type = float
entity = Person
label = "Winter fuel payment charge, tapered"
definition_period = "year"
unit = GBP

def formula(person, period, parameters):
p = parameters(period).gov.hmrc.income_tax.charges.winter_fuel_payment
payment = add(
person,
period,
["winter_fuel_payment", "pension_age_winter_heating_payment"],
)
on_relevant_benefit = add(person, period, p.relevant_benefits) > 0
over_threshold = person("total_income", period) > 30_000
return p.in_effect * 0.5 * payment * over_threshold * ~on_relevant_benefit


class tapered_charge(Reform):
def apply(self):
self.update_variable(winter_fuel_payment_charge)


class neutralised_ceiling(Reform):
def apply(self):
self.neutralize_variable("winter_fuel_payment_charge_ceiling")


class neutralised_income_tax(Reform):
def apply(self):
self.neutralize_variable("income_tax")


def landlord(age, **values):
person = dict(
age=age,
property_rental_income=3_300,
property_income=3_100,
property_finance_costs=1_200,
)
person.update(values)
return {
"people": {
"landlord": {name: {CHARGE_YEAR: value} for name, value in person.items()}
},
"households": {
"home": {"members": ["landlord"], "region": {CHARGE_YEAR: "NORTH_WEST"}}
},
}


def taxes_on_route(situation, reform, uses_allowance):
situation["people"]["landlord"]["uses_property_allowance"] = {
CHARGE_YEAR: uses_allowance
}
sim = Simulation(situation=situation, reform=reform)
return [
float(sim.calculate(variable, CHARGE_YEAR)[0])
for variable in ("income_tax", "income_tax_before_winter_fuel_payment_charge")
]


CHARGE_BEYOND_THE_CEILING = {
# Review r1's case: a payment given to someone under pensionable age.
"payment_given_under_pensionable_age": (
60,
dict(employment_income=32_000, winter_fuel_payment=200),
None,
),
"entitlement_given_under_pensionable_age": (
60,
dict(employment_income=32_000, winter_fuel_payment_eligible=True),
None,
),
# Tax before the charge is £400 lower with expenses, beyond the £300
# higher Winter Fuel Payment, but the £500 payment given exceeds it.
"payment_given_above_the_largest_amount": (
70,
dict(
private_pension_income=32_000,
property_finance_costs=2_800,
winter_fuel_payment=500,
),
None,
),
"charge_tapered_by_a_reform": (
70,
dict(private_pension_income=27_000),
tapered_charge,
),
# Total income £35,100 with expenses and £34,300 with the allowance, so
# the £200 charge falls only on the expenses route.
"ceiling_given_as_nothing": (
70,
dict(private_pension_income=32_000, winter_fuel_payment_charge_ceiling=0),
None,
),
"ceiling_neutralised_by_a_reform": (
70,
dict(private_pension_income=32_000),
neutralised_ceiling,
),
}


@pytest.mark.parametrize(
"age, values, reform",
CHARGE_BEYOND_THE_CEILING.values(),
ids=CHARGE_BEYOND_THE_CEILING,
)
def test_a_charge_beyond_the_ceiling_is_still_compared(age, values, reform):
chosen = Simulation(situation=landlord(age, **values), reform=reform)
route = bool(chosen.calculate("uses_property_allowance", CHARGE_YEAR)[0])
tax, before_charge = taxes_on_route(landlord(age, **values), reform, route)
other_tax, other_before_charge = taxes_on_route(
landlord(age, **values), reform, not route
)
assert tax < other_tax
# Tax before the charge alone would choose the other route.
assert before_charge > other_before_charge


INCOME_TAX_THE_SAME_ON_BOTH_ROUTES = {
"income_tax_given_as_an_input": (dict(income_tax=6_000), None),
# Review r2: a neutralised variable keeps the parts it adds.
"income_tax_neutralised_by_a_reform": (dict(), neutralised_income_tax),
}


@pytest.mark.parametrize(
"values, reform",
INCOME_TAX_THE_SAME_ON_BOTH_ROUTES.values(),
ids=INCOME_TAX_THE_SAME_ON_BOTH_ROUTES,
)
def test_income_tax_the_same_on_both_routes_leaves_the_default(values, reform):
"""Income tax is the same on both routes, so the choice is a tie and the
default, expenses for receipts above the allowance, stands, although tax
before the charge is lower with the allowance."""
values = dict(employment_income=40_000, property_finance_costs=100, **values)
sim = Simulation(situation=landlord(50, **values), reform=reform)
assert not sim.calculate("uses_property_allowance", CHARGE_YEAR)[0]
_, before_charge_using = taxes_on_route(landlord(50, **values), reform, True)
_, before_charge_not_using = taxes_on_route(landlord(50, **values), reform, False)
assert before_charge_using < before_charge_not_using
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
"""The winter fuel payment charge never exceeds its ceiling.

The property allowance election (uses_property_allowance) settles a choice on
income tax before the charge wherever the most the charge could be on either
route (winter_fuel_payment_charge_ceiling) cannot reverse it. That is the
choice income tax including the charge gives only if, for every person on
every route, the charge is between nothing and the ceiling, and nothing where
the ceiling is nothing.

Invariants, in 2025 and 2026, for households of one or two families in each
of the four countries, with adults either side of State Pension age and of 80,
total income either side of £35,000, Pension Credit and Universal Credit
claimed or not, and landlords with and without finance costs, on the model's
own routes and with everyone using the property allowance or nobody:

1. The charge is never negative and never more than the ceiling.
2. Where the ceiling is nothing, so is the charge.
"""

import numpy as np
from hypothesis import HealthCheck, given, settings
from hypothesis import strategies as st

from policyengine_uk import Simulation

COUNTRIES = ["ENGLAND", "WALES", "SCOTLAND", "NORTHERN_IRELAND"]
AGES = [50, 65, 66, 70, 79, 80, 85]
PENSIONS = [0, 11_500, 34_000, 35_000, 36_000, 60_000]
PROPERTY_RECEIPTS = [0, 900, 3_300, 12_000]
FINANCE_COSTS = [0, 675, 1_200, 6_000]
PROPERTY_SETTINGS = settings(
max_examples=6,
deadline=None,
derandomize=True,
suppress_health_check=[HealthCheck.too_slow, HealthCheck.data_too_large],
)
ROUTES = [None, True, False]


@st.composite
def adult(draw):
receipts = draw(st.sampled_from(PROPERTY_RECEIPTS))
return dict(
age=draw(st.sampled_from(AGES)),
private_pension_income=draw(st.sampled_from(PENSIONS)),
employment_income=draw(st.sampled_from([0, 0, 20_000])),
property_rental_income=receipts,
property_income=receipts * draw(st.sampled_from([0.8, 0.95])),
property_finance_costs=draw(st.sampled_from(FINANCE_COSTS)) if receipts else 0,
)


@st.composite
def household(draw):
families = [
dict(
adults=[draw(adult()) for _ in range(draw(st.integers(1, 2)))],
claims_pc=draw(st.booleans()),
claims_uc=draw(st.booleans()),
)
for _ in range(draw(st.integers(1, 2)))
]
return dict(families=families, country=draw(st.sampled_from(COUNTRIES)))


def situation(households, year, uses_allowance):
people, benunits, homes = {}, {}, {}
for h, home in enumerate(households):
members = []
for f, family in enumerate(home["families"]):
names = []
for a, values in enumerate(family["adults"]):
name = f"p{h}_{f}_{a}"
people[name] = {
variable: {year: value} for variable, value in values.items()
}
if uses_allowance is not None:
people[name]["uses_property_allowance"] = {year: uses_allowance}
names.append(name)
benunits[f"b{h}_{f}"] = {
"members": names,
"would_claim_pc": {year: family["claims_pc"]},
"would_claim_uc": {year: family["claims_uc"]},
}
members += names
homes[f"h{h}"] = {"members": members, "country": {year: home["country"]}}
return {"people": people, "benunits": benunits, "households": homes}


@PROPERTY_SETTINGS
@given(st.lists(household(), min_size=1, max_size=4), st.sampled_from([2025, 2026]))
def test_the_charge_never_exceeds_its_ceiling(households, year):
for uses_allowance in ROUTES:
simulation = Simulation(situation=situation(households, year, uses_allowance))
charge = np.asarray(simulation.calculate("winter_fuel_payment_charge", year))
ceiling = np.asarray(
simulation.calculate("winter_fuel_payment_charge_ceiling", year)
)
assert (charge >= 0).all(), (uses_allowance, charge, households)
assert (charge <= ceiling + 1e-4).all(), (uses_allowance, charge, ceiling)
assert (charge[ceiling == 0] == 0).all(), (uses_allowance, charge, ceiling)
Loading
Loading