Skip to content

Commit ab76253

Browse files
Merge pull request #122 from PolicyEngine/nikhilwoodruff/issue121
Update tax-benefit targets
2 parents b779019 + 7de6bdc commit ab76253

6 files changed

Lines changed: 233 additions & 190 deletions

File tree

changelog_entry.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- bump: minor
2+
changes:
3+
changed:
4+
- Tax-benefit targets updated from new DWP forecasts.

policyengine_uk_data/storage/demographics.csv

Lines changed: 136 additions & 135 deletions
Large diffs are not rendered by default.
Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
1-
name,unit,reference,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029
2-
attendance_allowance_count,benefit-unit-m,dwp_benefit_tables_march_2024,1.6,1.6,1.4,1.4,1.4,1.5,1.6,1.7,1.7,1.7,1.8,
3-
carers_allowance_count,benefit-unit-m,dwp_benefit_tables_march_2024,1.2,1.2,1.2,1.2,1.2,1.3,1.3,1.4,1.4,1.5,1.5,
4-
dla_count,benefit-unit-m,dwp_benefit_tables_march_2024,1.8,1.6,1.2,1.2,1.2,1.2,1.2,1.2,1.3,1.3,1.3,
5-
esa_count,benefit-unit-m,dwp_benefit_tables_march_2024,2.2,2.0,1.9,1.8,1.7,1.6,1.5,1.4,1.3,1.3,1.1,
6-
housing_benefit_count,benefit-unit-m,dwp_benefit_tables_march_2024,4.0,3.4,3.0,2.7,2.5,2.4,2.1,1.9,1.8,1.7,1.6,
7-
pension_credit_count,benefit-unit-m,dwp_benefit_tables_march_2024,1.7,1.6,1.5,1.4,1.4,1.3,1.3,1.3,1.2,1.2,1.1,
8-
pip_count,benefit-unit-m,dwp_benefit_tables_march_2024,1.9,2.2,2.4,2.5,2.9,3.2,3.5,3.9,4.2,4.4,4.7,
9-
universal_credit_jobseekers_count,benefit-unit-m,dwp_benefit_tables_march_2024,0.6,0.9,1.9,1.5,1.2,1.3,1.7,1.9,1.9,1.9,1.8,
10-
universal_credit_non_jobseekers_count,benefit-unit-m,dwp_benefit_tables_march_2024,0.7,1.3,2.1,2.6,3.1,3.5,3.8,4.2,4.4,4.5,4.8,
11-
winter_fuel_allowance_count,benefit-unit-m,dwp_benefit_tables_march_2024,11.6,11.4,11.1,11.3,11.4,11.6,10.8,11.0,11.0,10.9,10.9,
12-
attendance_allowance,gbp-bn,dwp_benefit_tables_march_2024,5.7,5.9,5.3,5.3,5.7,6.7,7.7,8.0,8.2,8.4,8.8,
13-
carers_allowance,gbp-bn,dwp_benefit_tables_march_2024,2.9,2.9,3.0,3.1,3.3,3.7,4.2,4.4,4.7,4.9,5.1,
14-
dla,gbp-bn,dwp_benefit_tables_march_2024,8.1,7.2,5.8,5.7,6.0,6.8,7.3,7.5,7.8,8.1,8.2,
15-
esa,gbp-bn,dwp_benefit_tables_march_2024,15.1,13.9,13.4,12.7,12.1,12.7,13.0,11.8,11.3,11.0,9.2,
16-
esa_contrib,gbp-bn,dwp_benefit_tables_march_2024,4.6,4.5,4.6,4.5,4.5,4.9,5.2,5.2,5.2,5.3,5.3,
17-
esa_income,gbp-bn,dwp_benefit_tables_march_2024,10.5,9.3,8.9,8.2,7.6,7.8,7.7,6.6,6.1,5.7,3.9,
18-
housing_benefit,gbp-bn,dwp_benefit_tables_march_2024,20.7,18.4,17.3,16.1,15.6,15.5,14.4,12.4,12.5,12.1,11.2,
19-
pip,gbp-bn,dwp_benefit_tables_march_2024,10.6,12.5,13.7,15.2,17.6,21.6,25.4,27.8,30.2,32.8,35.3,
20-
statutory_maternity_pay,gbp-bn,dwp_benefit_tables_march_2024,2.4,2.5,2.5,2.6,2.7,2.8,3.2,3.3,3.3,3.4,3.5,
21-
capital_gains_tax,gbp-bn,obr_march_2024_efo,,,,,16.9,14.8,15.2,16.2,18.9,21.3,23.5,
22-
child_benefit,gbp-bn,obr_march_2024_efo,,,,,11.6,12.5,13.5,13.5,13.5,13.5,13.5,
23-
council_tax,gbp-bn,obr_march_2024_efo,,,,,40.9,43.6,45.9,48.2,50.7,53.4,56.3,
24-
council_tax_england,gbp-bn,obr_march_2024_efo,,,,,36.3,38.7,40.8,43.0,45.3,47.8,50.4,
25-
council_tax_scotland,gbp-bn,obr_march_2024_efo,,,,,2.7,2.8,2.9,3.0,3.1,3.2,3.3,
26-
council_tax_wales,gbp-bn,obr_march_2024_efo,,,,,1.9,2.0,2.1,2.2,2.3,2.4,2.5,
27-
domestic_rates,gbp-bn,obr_march_2024_efo,,,,,0.4,0.4,0.4,0.4,0.4,0.4,0.4,
28-
fuel_duties,gbp-bn,obr_march_2024_efo,,,,,25.1,24.6,24.7,27.3,27.6,28.0,28.2,
29-
income_tax,gbp-bn,obr_march_2024_efo,,,,,250.5,279.2,302.7,315.8,331.4,348.7,363.3,
30-
jobseekers_allowance,gbp-bn,obr_march_2024_efo,,,,,0.3,0.3,0.2,0.1,0.1,0.1,0.1,
31-
ni_employee,gbp-bn,obr_march_2024_efo,,,,,74.0,70.7,55.5,57.2,59.4,61.4,63.2,
32-
ni_employer,gbp-bn,obr_march_2024_efo,,,,,103.1,108.5,112.7,116.4,120.4,124.7,128.9,
33-
pension_credit,gbp-bn,obr_march_2024_efo,,,,,4.9,5.4,5.8,5.9,5.7,5.4,5.3,
34-
sdlt_residential,gbp-bn,obr_march_2024_efo,,,,,11.7,8.5,9.3,10.2,11.9,13.9,15.9,
35-
stamp_duty_land_tax,gbp-bn,obr_march_2024_efo,,,,,15.4,11.5,12.8,13.8,15.8,18.1,20.4,
36-
state_pension,gbp-bn,obr_march_2024_efo,,,,,109.8,124.6,138.1,146.0,150.5,153.2,158.0,
37-
tax_credits,gbp-bn,obr_march_2024_efo,,,,,8.9,7.3,1.6,-0.1,-0.1,-0.1,-0.1,
38-
tv_licence_fee,gbp-bn,obr_march_2024_efo,,,,,3.7,3.7,3.9,4.0,4.0,4.0,4.1,
39-
universal_credit,gbp-bn,obr_march_2024_efo,,,,,42.6,51.8,67.0,74.3,77.6,80.8,87.2,
40-
universal_credit_jobseekers,gbp-bn,obr_march_2024_efo,,,,,9.2,11.1,17.4,19.3,19.7,20.0,20.1,
41-
universal_credit_non_jobseekers,gbp-bn,obr_march_2024_efo,,,,,33.4,40.7,49.5,55.0,57.9,60.8,67.1,
42-
vat,gbp-bn,obr_march_2024_efo,,,,,159.7,169.6,173.9,180.3,188.0,195.9,204.1,
43-
winter_fuel_allowance,gbp-bn,obr_march_2024_efo,,,,,2.0,2.0,1.9,1.9,1.9,1.9,2.0,
44-
private_school_students,person-k,obr_march_2024_efo,557,557,557,557,557,557,557,557,557,557,557,
1+
name,unit,reference,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029
2+
attendance_allowance_count,benefit-unit-m,dwp_benefit_tables_march_2025,1.4,1.4,1.3,1.3,1.3,1.4,1.5,1.6,1.6,1.7,1.7,1.7
3+
carers_allowance_count,benefit-unit-m,dwp_benefit_tables_march_2026,0.8,0.8,0.9,0.8,0.9,0.9,0.9,1.0,1.0,1.0,1.0,1.0
4+
dla_count,benefit-unit-m,dwp_benefit_tables_march_2027,1.8,1.5,1.2,1.2,1.2,1.2,1.3,1.3,1.3,1.3,1.3,1.3
5+
esa_count,benefit-unit-m,dwp_benefit_tables_march_2028,2.2,2.0,1.9,1.8,1.7,1.6,1.4,1.0,0.8,0.8,0.8,0.8
6+
housing_benefit_count,benefit-unit-m,dwp_benefit_tables_march_2029,4.0,3.4,3.0,2.7,2.5,2.4,2.1,1.6,1.4,1.4,1.4,1.4
7+
pension_credit_count,benefit-unit-m,dwp_benefit_tables_march_2030,1.7,1.6,1.5,1.4,1.4,1.4,1.3,1.4,1.3,1.2,1.2,1.2
8+
pip_count,benefit-unit-m,dwp_benefit_tables_march_2031,1.9,2.2,2.3,2.5,2.8,3.2,3.5,3.8,4.1,4.3,4.5,4.6
9+
universal_credit_jobseekers_count,benefit-unit-m,dwp_benefit_tables_march_2032,0.6,0.8,1.8,1.4,1.1,1.2,1.4,1.6,1.6,1.5,1.5,1.5
10+
universal_credit_non_jobseekers_count,benefit-unit-m,dwp_benefit_tables_march_2033,0.7,1.3,2.2,2.7,3.1,3.6,4.1,4.7,5.1,5.2,5.3,5.4
11+
winter_fuel_allowance_count,benefit-unit-m,dwp_benefit_tables_march_2034,11.6,11.4,11.1,11.3,11.4,11.6,1.3,1.3,1.2,1.2,1.2,1.2
12+
attendance_allowance,gbp-bn,dwp_benefit_tables_march_2035,5.7,5.9,5.3,5.3,5.7,6.7,7.7,8.3,8.9,9.3,9.6,10.0
13+
carers_allowance,gbp-bn,dwp_benefit_tables_march_2036,2.9,2.9,3.0,3.1,3.2,3.7,4.2,4.5,4.8,4.9,5.0,5.1
14+
dla,gbp-bn,dwp_benefit_tables_march_2037,8.1,7.2,5.8,5.7,6.0,6.9,7.6,8.0,8.4,8.7,8.8,8.7
15+
esa,gbp-bn,dwp_benefit_tables_march_2038,15.1,13.9,13.4,12.7,12.1,12.4,12.3,7.9,4.9,5.1,5.2,5.3
16+
esa_contrib,gbp-bn,dwp_benefit_tables_march_2039,4.6,4.5,4.6,4.5,4.5,4.9,5.2,5.0,4.9,5.1,5.2,5.3
17+
esa_income,gbp-bn,dwp_benefit_tables_march_2040,10.5,9.3,8.8,8.2,7.6,7.4,7.1,2.9,0.0,0.0,0.0,0.0
18+
housing_benefit,gbp-bn,dwp_benefit_tables_march_2041,20.7,18.4,17.3,16.1,15.6,15.8,15.4,12.2,11.5,11.7,12.0,12.6
19+
pip,gbp-bn,dwp_benefit_tables_march_2042,10.6,12.5,13.7,15.2,17.6,21.7,25.8,28.5,31.6,33.2,35.0,37.6
20+
statutory_maternity_pay,gbp-bn,dwp_benefit_tables_march_2043,2.4,2.5,2.5,2.6,2.7,2.9,3.0,3.2,3.2,3.3,3.4,3.5
21+
capital_gains_tax,gbp-bn,obr_march_2024_efo,,,,,16.9,14.5,13.3,19.7,19.4,20.2,23.1,25.5
22+
child_benefit,gbp-bn,obr_march_2024_efo,,,,,11.6,12.5,13.5,13.5,13.5,13.5,13.5,
23+
council_tax,gbp-bn,obr_march_2024_efo,,,,,40.9,43.3,46.4,48.9,51.4,54.2,57.0,60.0
24+
council_tax_england,gbp-bn,obr_march_2024_efo,,,,,36.3,38.3,41.2,43.5,45.8,48.4,51.0,53.7
25+
council_tax_scotland,gbp-bn,obr_march_2024_efo,,,,,2.7,2.9,3.0,3.1,3.2,3.3,3.4,3.5
26+
council_tax_wales,gbp-bn,obr_march_2024_efo,,,,,1.9,2.1,2.2,2.3,2.4,2.5,2.6,2.7
27+
domestic_rates,gbp-bn,obr_march_2024_efo,,,,,0.4,0.5,0.5,0.5,0.5,0.5,0.5,0.5
28+
fuel_duties,gbp-bn,obr_march_2024_efo,,,,,25.1,24.8,24.4,24.4,27.0,27.3,27.3,27.0
29+
income_tax,gbp-bn,obr_march_2024_efo,,,,,250.5,275.7,307.1,328.4,354.5,377.1,384.1,396.7
30+
jobseekers_allowance,gbp-bn,obr_march_2024_efo,1.3,0.7,1.0,0.5,0.3,0.3,0.3,0.2,0.3,0.2,0.2,0.3
31+
ni_employee,gbp-bn,obr_march_2024_efo,,,,,74,61.8,43.9,46.1,47.6,49.1,50.7,52.5
32+
ni_employer,gbp-bn,obr_march_2024_efo,,,,,103.1,108.3,115.3,145.8,150.1,154.4,158.9,163.6
33+
pension_credit,gbp-bn,obr_march_2024_efo,5.1,5.1,5.1,4.8,4.9,5.5,5.9,5.9,5.9,5.7,5.7,5.7
34+
sdlt_residential,gbp-bn,obr_march_2024_efo,,,,,11.7,8.6,10.1,11.3,13.4,15.6,17.8,19.3
35+
stamp_duty_land_tax,gbp-bn,obr_march_2024_efo,,,,,15.4,11.6,13.6,14.1,17.2,19.9,22.5,24.5
36+
state_pension,gbp-bn,obr_march_2024_efo,,,,,109.8,124.6,138.1,146,150.5,153.2,158,
37+
tax_credits,gbp-bn,obr_march_2024_efo,,,,,8.9,7.3,1.6,0,0,0,0,0
38+
tv_licence_fee,gbp-bn,obr_march_2024_efo,,,,,3.7,3.7,3.9,4,4,4,4.1,
39+
universal_credit,gbp-bn,obr_march_2024_efo,8.1,18.4,38.2,40.6,41.9,52.1,65.3,75.8,83.1,84.0,85.9,88.9
40+
universal_credit_jobseekers,gbp-bn,obr_march_2024_efo,2.0,3.0,16.6,13.0,9.8,11.1,13.1,15.3,16.0,15.4,15.1,15.5
41+
universal_credit_non_jobseekers,gbp-bn,obr_march_2024_efo,6.2,15.3,21.7,27.6,32.1,41.0,52.2,60.6,67.1,68.6,70.9,73.4
42+
vat,gbp-bn,obr_march_2024_efo,,,,,159.7,168.9,170.3,178.8,186.6,193.9,201.7,209.8
43+
winter_fuel_allowance,gbp-bn,obr_march_2024_efo,2.0,2.0,2.0,2.0,2.0,2.0,0.3,0.3,0.3,0.3,0.3,0.3
44+
private_school_students,person-k,obr_march_2024_efo,557,557,557,557,557,557,557,557,557,557,557,
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
def test_child_limit():
2+
from policyengine_uk import Microsimulation
3+
from policyengine_uk_data.datasets import EnhancedFRS_2022_23
4+
5+
# Initialize simulation
6+
sim = Microsimulation(dataset=EnhancedFRS_2022_23)
7+
8+
population = sim.calculate("people", 2025).sum() / 1e6
9+
POPULATION_TARGET = 69.5 # Expected UK population in millions, per ONS 2022-based estimate here: https://www.ons.gov.uk/peoplepopulationandcommunity/populationandmigration/populationprojections/bulletins/nationalpopulationprojections/2022based
10+
assert (
11+
abs(population / POPULATION_TARGET - 1) < 0.02
12+
), f"Expected UK population of {POPULATION_TARGET:.1f} million, got {population:.1f} million."

policyengine_uk_data/utils/incomes_projection.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,11 @@
2929
statistics = pd.concat(dfs)
3030
statistics = statistics[statistics.value.notnull()]
3131

32-
OBR_BASELINE = { # Policy baseline that targets are based on.
33-
"gov.dwp.winter_fuel_payment.eligibility.require_benefits": False,
34-
}
35-
3632

3733
def create_target_matrix(
3834
dataset: str,
3935
time_period: str,
40-
reform=OBR_BASELINE,
36+
reform=None,
4137
) -> np.ndarray:
4238
"""
4339
Create a target matrix A, s.t. for household weights w, the target vector b and a perfectly calibrated PolicyEngine UK:

policyengine_uk_data/utils/loss.py

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,11 @@
2323
statistics = pd.concat(dfs)
2424
statistics = statistics[statistics.value.notnull()]
2525

26-
OBR_BASELINE = { # Policy baseline that targets are based on.
27-
"gov.dwp.winter_fuel_payment.eligibility.require_benefits": False,
28-
}
29-
3026

3127
def create_target_matrix(
3228
dataset: str,
3329
time_period: str,
34-
reform=OBR_BASELINE,
30+
reform=None,
3531
) -> np.ndarray:
3632
"""
3733
Create a target matrix A, s.t. for household weights w, the target vector b and a perfectly calibrated PolicyEngine UK:
@@ -117,7 +113,7 @@ def pe_count(*variables):
117113
df["obr/pension_credit"] = pe("pension_credit")
118114
df["obr/stamp_duty_land_tax"] = pe("expected_sdlt")
119115
df["obr/state_pension"] = pe("state_pension")
120-
df["obr/tax_credits"] = pe("tax_credits")
116+
# df["obr/tax_credits"] = pe("tax_credits")
121117
df["obr/tv_licence_fee"] = pe("tv_licence")
122118

123119
uc = sim.calculate("universal_credit")
@@ -153,6 +149,38 @@ def pe_count(*variables):
153149
"NORTHERN_IRELAND": "northern_ireland",
154150
}
155151
age = sim.calculate("age")
152+
153+
# Ensure local populations are consistent with national population
154+
local_population_total = 0
155+
for pe_region_name, region_name in region_to_target_name_map.items():
156+
for lower_age in range(0, 90, 10):
157+
upper_age = lower_age + 10
158+
name = f"ons/{region_name}_age_{lower_age}_{upper_age - 1}"
159+
local_population_total += (
160+
demographics[demographics.name == name][
161+
str(time_period)
162+
].values[0]
163+
* 1e3
164+
)
165+
166+
population_scaling_factor = (
167+
demographics[demographics.name == "ons/uk_population"][
168+
str(time_period)
169+
].values[0]
170+
* 1e6
171+
/ local_population_total
172+
) * 0.9
173+
174+
for pe_region_name, region_name in region_to_target_name_map.items():
175+
for lower_age in range(0, 90, 10):
176+
upper_age = lower_age + 10
177+
name = f"ons/{region_name}_age_{lower_age}_{upper_age - 1}"
178+
statistics.loc[
179+
(statistics.name == name)
180+
& (statistics.time_period == int(time_period)),
181+
"value",
182+
] *= population_scaling_factor
183+
156184
for pe_region_name, region_name in region_to_target_name_map.items():
157185
for lower_age in range(0, 90, 10):
158186
upper_age = lower_age + 10
@@ -164,6 +192,8 @@ def pe_count(*variables):
164192
)
165193
df[name] = household_from_person(person_in_criteria)
166194

195+
df["ons/uk_population"] = household_from_person(age >= 0)
196+
167197
targets = (
168198
statistics[statistics.time_period == int(time_period)]
169199
.set_index("name")

0 commit comments

Comments
 (0)