Skip to content

Commit d8e5961

Browse files
Merge pull request #222 from PolicyEngine/calibration-fix
Fix bad SS targets
2 parents 957ee5e + 2bdd4f3 commit d8e5961

2 files changed

Lines changed: 4 additions & 60 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: patch
2+
changes:
3+
fixed:
4+
- Hallucinated calibration targets.

policyengine_uk_data/utils/loss.py

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -194,66 +194,6 @@ def pe_count(*variables):
194194
employer_ni_relief
195195
)
196196

197-
# HMRC Table 6.2 - Salary sacrifice income tax relief by tax rate
198-
# This helps calibrate the distribution of SS users by income level
199-
# 2023-24 values (£m): Basic £1,600, Higher £4,400, Additional £1,200
200-
# Total IT relief from SS: £7,200m
201-
# Use true counterfactual: IT relief = counterfactual IT - baseline IT
202-
income_tax_baseline = sim.calculate("income_tax")
203-
income_tax_cf = counterfactual_sim.calculate("income_tax", time_period)
204-
it_relief = income_tax_cf - income_tax_baseline
205-
206-
# Get tax band from counterfactual adjusted net income (where SS is wages)
207-
adjusted_net_income_cf = counterfactual_sim.calculate(
208-
"adjusted_net_income", time_period
209-
)
210-
basic_rate_threshold = (
211-
sim.tax_benefit_system.parameters.gov.hmrc.income_tax.rates.uk[
212-
0
213-
].threshold(time_period)
214-
)
215-
higher_rate_threshold = (
216-
sim.tax_benefit_system.parameters.gov.hmrc.income_tax.rates.uk[
217-
1
218-
].threshold(time_period)
219-
)
220-
additional_rate_threshold = (
221-
sim.tax_benefit_system.parameters.gov.hmrc.income_tax.rates.uk[
222-
2
223-
].threshold(time_period)
224-
)
225-
226-
# Determine tax band for each person based on counterfactual income
227-
is_basic_rate = (adjusted_net_income_cf > basic_rate_threshold) & (
228-
adjusted_net_income_cf <= higher_rate_threshold
229-
)
230-
is_higher_rate = (adjusted_net_income_cf > higher_rate_threshold) & (
231-
adjusted_net_income_cf <= additional_rate_threshold
232-
)
233-
is_additional_rate = adjusted_net_income_cf > additional_rate_threshold
234-
235-
# Allocate the true IT relief to tax bands
236-
ss_it_relief_basic = it_relief * is_basic_rate
237-
ss_it_relief_higher = it_relief * is_higher_rate
238-
ss_it_relief_additional = it_relief * is_additional_rate
239-
240-
df["hmrc/salary_sacrifice_it_relief_basic"] = household_from_person(
241-
ss_it_relief_basic
242-
)
243-
df["hmrc/salary_sacrifice_it_relief_higher"] = household_from_person(
244-
ss_it_relief_higher
245-
)
246-
df["hmrc/salary_sacrifice_it_relief_additional"] = household_from_person(
247-
ss_it_relief_additional
248-
)
249-
250-
# Total gross salary sacrifice contributions
251-
# This is derived from the IT relief: £7.2bn IT relief at ~30% avg rate
252-
# implies ~£24bn gross contributions (but we target the relief directly)
253-
df["hmrc/salary_sacrifice_contributions"] = household_from_person(
254-
ss_contributions
255-
)
256-
257197
# Population statistics from the ONS.
258198

259199
region = sim.calculate("region", map_to="person")

0 commit comments

Comments
 (0)