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
4 changes: 4 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- bump: patch
changes:
fixed:
- Lag CPI correctly for benefit uprating.
2 changes: 1 addition & 1 deletion policyengine_uk/parameters/gov/benefit_uprating_cpi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ values:
2010-01-01: 114.48
metadata:
label: Benefit uprating index
uprating: gov.economic_assumptions.indices.obr.consumer_price_index
uprating: gov.economic_assumptions.indices.obr.lagged_cpi
27 changes: 27 additions & 0 deletions policyengine_uk/parameters/gov/economic_assumptions/lag_cpi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from policyengine_core.parameters import Parameter, ParameterNode


def add_lagged_cpi(
parameters: ParameterNode,
) -> ParameterNode:
"""
Add lagged average earnings to the economic assumptions.
"""
obr = parameters.gov.economic_assumptions.yoy_growth.obr
cpi = obr.consumer_price_index

lagged_cpi = Parameter(
"gov.economic_assumptions.yoy_growth.obr.lagged_cpi",
data={
"values": {
f"{year}-01-01": cpi(year - 1) for year in range(2010, 2030)
},
},
)

obr.add_child(
"lagged_cpi",
lagged_cpi,
)

return parameters
4 changes: 4 additions & 0 deletions policyengine_uk/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
from policyengine_uk.parameters.gov.economic_assumptions.lag_average_earnings import (
add_lagged_earnings,
)
from policyengine_uk.parameters.gov.economic_assumptions.lag_cpi import (
add_lagged_cpi,
)
from policyengine_core.reforms import Reform
from policyengine_uk.reforms import create_structural_reforms_from_parameters

Expand Down Expand Up @@ -65,6 +68,7 @@ def process_parameters(self, reform=None):
self.apply_reform_set(reform)
self.parameters = add_private_pension_uprating_factor(self.parameters)
self.parameters = add_lagged_earnings(self.parameters)
self.parameters = add_lagged_cpi(self.parameters)
self.parameters = add_triple_lock(self.parameters)
self.parameters = create_economic_assumption_indices(self.parameters)
self.parameters.add_child("baseline", self.parameters.clone())
Expand Down
8 changes: 4 additions & 4 deletions policyengine_uk/tests/microsimulation/reforms_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ reforms:
parameters:
gov.hmrc.income_tax.rates.uk[1].rate: 0.42
- name: Raise personal allowance by ~800GBP/year
expected_impact: 0.8
expected_impact: 0.7
parameters:
gov.hmrc.income_tax.allowances.personal_allowance.amount: 13000
- name: Raise child benefit by 25GBP/week per additional child
expected_impact: -1.3
expected_impact: -1.2
parameters:
gov.hmrc.child_benefit.amount.additional: 25
- name: Reduce Universal Credit taper rate to 20%
expected_impact: -38.3
expected_impact: -38.7
parameters:
gov.dwp.universal_credit.means_test.reduction_rate: 0.2
- name: Raise Class 1 main employee NICs rate to 10%
Expand All @@ -28,6 +28,6 @@ reforms:
parameters:
gov.hmrc.vat.standard_rate: 0.22
- name: Raise additional rate by 3pp
expected_impact: 4.4
expected_impact: 4.5
parameters:
gov.hmrc.income_tax.rates.uk[2].rate: 0.48
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
members: [child1]
extended_childcare_entitlement_eligible: true
output:
extended_childcare_entitlement: 6_917.185
extended_childcare_entitlement: 6857.356

- name: Eligible for 15 hours - All first conditions met
period: 2025
Expand All @@ -24,7 +24,7 @@
members: [child1]
extended_childcare_entitlement_eligible: true
output:
extended_childcare_entitlement: 4_870.2627
extended_childcare_entitlement: 4828.138

- name: Not eligible (one condition not met)
period: 2025
Expand Down Expand Up @@ -54,7 +54,7 @@
members: [child1, child2]
extended_childcare_entitlement_eligible: true
output:
extended_childcare_entitlement: 11_787.447
extended_childcare_entitlement: 11685.494

- name: Not eligible - Family with multiple children but conditions not met
period: 2025
Expand Down Expand Up @@ -89,7 +89,7 @@
family_type: COUPLE_WITH_CHILDREN
extended_childcare_entitlement_eligible: true
output:
extended_childcare_entitlement: 18706.
extended_childcare_entitlement: 18542.85

- name: No expenses for zero hours
period: 2025
Expand Down Expand Up @@ -118,7 +118,7 @@
members: [child1]
extended_childcare_entitlement_eligible: true
output:
extended_childcare_entitlement: 4_611.457 # 20 hours * 38 weeks * £6.07 per hour (2025 rate)
extended_childcare_entitlement: 4571.5703 # 20 hours * 38 weeks * £6.07 per hour (2025 rate)

- name: Child using fewer hours than maximum entitlement - multiple children
period: 2025
Expand All @@ -136,7 +136,7 @@
members: [child1, child2]
extended_childcare_entitlement_eligible: true
output:
extended_childcare_entitlement: 6_705.434 # Updated to match actual calculation
extended_childcare_entitlement: 6647.4365

- name: Benefit unit maximum hours cap applied
period: 2025
Expand All @@ -155,7 +155,7 @@
extended_childcare_entitlement_eligible: true
maximum_extended_childcare_hours_usage: 40
output:
extended_childcare_entitlement: 13835.381
extended_childcare_entitlement: 13714.712


- name: Benefit unit without maximum hours cap applied
Expand All @@ -172,7 +172,7 @@
extended_childcare_entitlement_eligible: true
maximum_extended_childcare_hours_usage: 10
output:
extended_childcare_entitlement: 2_306.6
extended_childcare_entitlement: 2285.7852


- name: Benefit unit without maximum hours cap applied with 3 years old child
Expand All @@ -189,4 +189,4 @@
extended_childcare_entitlement_eligible: true
maximum_extended_childcare_hours_usage: 18
output:
extended_childcare_entitlement: 3_459.5
extended_childcare_entitlement: 3428.678
Loading