Skip to content

Commit

Permalink
Merge pull request #909 from PolicyEngine/econ-assumptions
Browse files Browse the repository at this point in the history
Add economic assumptions
  • Loading branch information
nikhilwoodruff authored Jul 26, 2024
2 parents d5d4d7f + f5b9cb6 commit 526d1f5
Show file tree
Hide file tree
Showing 18 changed files with 208 additions and 41 deletions.
4 changes: 4 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- bump: minor
changes:
changed:
- Simplified uprating indices by moving OBR parameters to gov folder.
2 changes: 1 addition & 1 deletion policyengine_uk/data/datasets/frs/frs.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def generate(self):
RawFRS_2022_23,
"frs_2022",
"FRS 2022-23",
new_url="release://policyengine/non-public-microdata/uk-2024-july/raw_frs_2022.h5",
new_url="release://policyengine/non-public-microdata/uk-2024-july/frs_2022.h5",
)


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
description: Raise energy spending by this percentage.
values:
2000-01-01: 0
metadata:
unit: /1
label: Change to energy spending
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
description: Raise all market incomes by this percentage.
values:
2000-01-01: 0
metadata:
unit: /1
label: Change to GDP per capita
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
description: Raise the interest rate on mortgages by this percentage.
values:
2000-01-01: 0
metadata:
unit: /1
label: Change to interest rates
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
description: Raise rental expenses by this percentage.
values:
2000-01-01: 0
metadata:
unit: /1
label: Change to rents
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
description: Raise transport expenses by this percentage.
values:
2000-01-01: 0
metadata:
unit: /1
label: Change to transport spending
28 changes: 28 additions & 0 deletions policyengine_uk/parameters/gov/obr/average_earnings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
description: OBR forecast for average earnings (2008 = 100%)
values:
2008-01-01: 100.0
2009-01-01: 101.8
2010-01-01: 102.7
2011-01-01: 104.3
2012-01-01: 105.0
2013-01-01: 110.0
2014-01-01: 110.7
2015-01-01: 112.9
2016-01-01: 115.6
2017-01-01: 119.3
2018-01-01: 122.4
2019-01-01: 125.4
2020-01-01: 125.7
2021-01-01: 133.3
2022-01-01: 140.9
2023-01-01: 150.0
2024-01-01: 154.6
2025-01-01: 157.5
2026-01-01: 160.9
2027-01-01: 164.6
2028-01-01: 168.9
metadata:
unit: /1
reference:
- title: OBR March 2024 EFO
href: https://obr.uk/efo/economic-and-fiscal-outlook-march-2024/
22 changes: 22 additions & 0 deletions policyengine_uk/parameters/gov/obr/consumer_price_index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
description: OBR forecast for CPI
values:
2014-01-01: 100
2015-01-01: 100.1
2016-01-01: 101.2
2017-01-01: 104.1
2018-01-01: 106.4
2019-01-01: 108.3
2020-01-01: 108.9
2021-01-01: 113.2
2022-01-01: 124.6
2023-01-01: 131.7
2024-01-01: 133.8
2025-01-01: 135.9
2026-01-01: 138.2
2027-01-01: 140.9
2028-01-01: 143.7
metadata:
unit: /1
reference:
- title: OBR March 2024 EFO
href: https://obr.uk/efo/economic-and-fiscal-outlook-march-2024/
28 changes: 28 additions & 0 deletions policyengine_uk/parameters/gov/obr/house_prices.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
description: OBR forecast for house prices.
values:
2008-01-01: 88.2
2009-01-01: 85.3
2010-01-01: 88.4
2011-01-01: 87.2
2012-01-01: 87.9
2013-01-01: 91.3
2014-01-01: 98.6
2015-01-01: 104.9
2016-01-01: 111.2
2017-01-01: 116.2
2018-01-01: 119.3
2019-01-01: 120.4
2020-01-01: 125.9
2021-01-01: 137.2
2022-01-01: 148.7
2023-01-01: 147.6
2024-01-01: 144.1
2025-01-01: 144.8
2026-01-01: 148.6
2027-01-01: 153.8
2028-01-01: 159.5
metadata:
unit: currency-GBP
reference:
- title: OBR March 2024 EFO
href: https://obr.uk/efo/economic-and-fiscal-outlook-march-2024/
23 changes: 23 additions & 0 deletions policyengine_uk/parameters/gov/obr/mixed_income.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
description: OBR forecast for mixed income (largely self-employment income).
values:
2012-01-01: 103.4
2013-01-01: 111.5
2014-01-01: 114.9
2015-01-01: 124.5
2016-01-01: 128.0
2017-01-01: 140.0
2018-01-01: 144.2
2019-01-01: 151.3
2020-01-01: 153.7
2021-01-01: 158.3
2022-01-01: 161.9
2023-01-01: 171.5
2024-01-01: 178.2
2025-01-01: 185.3
2026-01-01: 193.5
2027-01-01: 202.3
2028-01-01: 211.8
metadata:
reference:
- title: OBR March 2024 EFO
href: https://obr.uk/efo/economic-and-fiscal-outlook-march-2024/
28 changes: 28 additions & 0 deletions policyengine_uk/parameters/gov/obr/mortgage_interest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
description: OBR forecast for household debt service costs.
values:
2008-01-01: 92.7
2009-01-01: 69.0
2010-01-01: 64.0
2011-01-01: 61.6
2012-01-01: 61.3
2013-01-01: 61.0
2014-01-01: 59.2
2015-01-01: 57.7
2016-01-01: 56.9
2017-01-01: 55.8
2018-01-01: 56.9
2019-01-01: 57.4
2020-01-01: 53.1
2021-01-01: 52.3
2022-01-01: 60.5
2023-01-01: 86.6
2024-01-01: 110.8
2025-01-01: 109.2
2026-01-01: 113.2
2027-01-01: 119.7
2028-01-01: 125.2
metadata:
unit: currency-GBP
reference:
- title: OBR March 2024 EFO
href: https://obr.uk/efo/economic-and-fiscal-outlook-march-2024/
23 changes: 23 additions & 0 deletions policyengine_uk/parameters/gov/obr/non_labour_income.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
description: OBR forecast for non-labour income.
values:
2012-01-01: 268.6
2013-01-01: 281.4
2014-01-01: 298.4
2015-01-01: 335.0
2016-01-01: 329.0
2017-01-01: 339.3
2018-01-01: 355.1
2019-01-01: 363.9
2020-01-01: 342.5
2021-01-01: 367.1
2022-01-01: 425.2
2023-01-01: 458.1
2024-01-01: 456.5
2025-01-01: 482.6
2026-01-01: 504.4
2027-01-01: 543.6
2028-01-01: 585.3
metadata:
reference:
- title: OBR March 2024 EFO
href: https://obr.uk/efo/economic-and-fiscal-outlook-march-2024/
1 change: 0 additions & 1 deletion policyengine_uk/reforms/policyengine/budget_change.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ def formula(household, period, parameters):
[equivalised_income <= upper_bounds[i] for i in range(10)],
list(range(1, 11)),
)
print(decile)
# Set negatives to -1.
# This avoids the bottom decile summing to a negative number,
# which would flip the % change in the interface.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ def formula(person, period, parameters):
p = parameters(period).gov.dwp.housing_benefit.non_dep_deduction
weekly_income = person("total_income", period) / WEEKS_IN_YEAR
deduction = p.amount.calc(weekly_income, right=True)
print(weekly_income)
return deduction * WEEKS_IN_YEAR
29 changes: 10 additions & 19 deletions policyengine_uk/variables/household/income/income.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,17 +188,17 @@ class inflation_adjustment(Variable):
unit = "/1"

def formula(household, period, parameters):
cpi = parameters.calibration.uprating.CPI
cpi = parameters.gov.obr.consumer_price_index
current_period_cpi = cpi(period)
now_cpi = cpi(datetime.datetime.now().strftime("%Y-%m-%d"))
now_cpi = cpi(datetime.datetime.now().strftime("%Y-01-01"))
return now_cpi / current_period_cpi


class real_household_net_income(Variable):
label = (
f"real household net income ({datetime.datetime.now().year} prices)"
)
entity = Person
entity = Household
definition_period = YEAR
value_type = float
unit = GBP
Expand All @@ -208,22 +208,6 @@ def formula(household, period, parameters):
return net_income * household("inflation_adjustment", period)


class real_household_net_income(Variable):
label = "Real household net income"
documentation = "Disposable income in January 2015 prices"
entity = Household
definition_period = YEAR
value_type = float
unit = GBP

def formula(household, period, parameters):
def cpi(period):
return parameters(period).calibration.uprating.CPI

multiplier = cpi("2015-01-01") / cpi(period)
return household("household_net_income", period) * multiplier


class hbai_household_net_income_ahc(Variable):
value_type = float
entity = Household
Expand Down Expand Up @@ -360,6 +344,13 @@ class household_market_income(Variable):
"capital_gains",
]

def formula(person, period, parameters):
total = add(person, period, household_market_income.adds)
contrib = parameters(
period
).gov.contrib.policyengine.economy.gdp_per_capita
return total * (contrib + 1)


class household_income_decile(Variable):
label = "household income decile"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class mortgage_interest_repayment(Variable):
documentation = "Total amount spent on mortgage interest repayments"
definition_period = YEAR
unit = GBP
uprating = "gov.obr.mortgage_interest"


class mortgage_capital_repayment(Variable):
Expand All @@ -52,6 +53,7 @@ class mortgage_capital_repayment(Variable):
label = "mortgage capital repayments"
definition_period = YEAR
unit = GBP
uprating = "gov.obr.house_prices"


class council_tax(Variable):
Expand Down
28 changes: 9 additions & 19 deletions policyengine_uk/variables/input/income.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class employment_income_before_lsr(Variable):
label = "employment income before labor supply responses"
unit = GBP
definition_period = YEAR
uprating = "calibration.programs.employment_income.budgetary_impact.UNITED_KINGDOM"
uprating = "gov.obr.average_earnings"


class private_pension_income(Variable):
Expand All @@ -37,9 +37,7 @@ class private_pension_income(Variable):
unit = GBP
reference = "Income Tax (Earnings and Pensions) Act 2003 s. 1(1)(b)"
quantity_type = FLOW
uprating = (
"calibration.programs.private_pension_income.budgetary_impact.ENGLAND"
)
uprating = "gov.obr.non_labour_income"

def formula(person, period, parameters):
# Don't have data, use the old pension income
Expand All @@ -62,9 +60,7 @@ class pension_income(Variable):
unit = GBP
reference = "Income Tax (Earnings and Pensions) Act 2003 s. 1(1)(b)"
quantity_type = FLOW
uprating = (
"calibration.programs.private_pension_income.budgetary_impact.ENGLAND"
)
uprating = "gov.obr.non_labour_income"


class state_pension(Variable):
Expand Down Expand Up @@ -105,7 +101,7 @@ class self_employment_income(Variable):
unit = GBP
reference = "Income Tax (Trading and Other Income) Act 2005 s. 1(1)(a)"
quantity_type = FLOW
uprating = "calibration.programs.self_employment_income.budgetary_impact.UNITED_KINGDOM"
uprating = "gov.obr.mixed_income"


class property_income(Variable):
Expand All @@ -117,9 +113,7 @@ class property_income(Variable):
reference = "Income Tax (Trading and Other Income) Act 2005 s. 1(1)(b)"
unit = GBP
quantity_type = FLOW
uprating = (
"calibration.programs.property_income.budgetary_impact.UNITED_KINGDOM"
)
uprating = "gov.obr.non_labour_income"


class savings_interest_income(Variable):
Expand All @@ -131,7 +125,7 @@ class savings_interest_income(Variable):
reference = "Income Tax (Trading and Other Income) Act 2005 s. 365(1)(a)"
unit = GBP
quantity_type = FLOW
uprating = "calibration.programs.savings_interest_income.budgetary_impact.UNITED_KINGDOM"
uprating = "gov.obr.non_labour_income"


class dividend_income(Variable):
Expand All @@ -143,9 +137,7 @@ class dividend_income(Variable):
reference = "Income Tax (Trading and Other Income) Act 2005 s. 365(1)(b-d)"
unit = GBP
quantity_type = FLOW
uprating = (
"calibration.programs.dividend_income.budgetary_impact.UNITED_KINGDOM"
)
uprating = "gov.obr.non_labour_income"


class sublet_income(Variable):
Expand All @@ -155,9 +147,7 @@ class sublet_income(Variable):
documentation = "Income from subletting properties"
definition_period = YEAR
unit = GBP
uprating = (
"calibration.programs.property_income.budgetary_impact.UNITED_KINGDOM"
)
uprating = "gov.obr.non_labour_income"


class miscellaneous_income(Variable):
Expand All @@ -167,7 +157,7 @@ class miscellaneous_income(Variable):
documentation = "Income from any other source"
definition_period = YEAR
unit = GBP
uprating = "calibration.programs.employment_income.budgetary_impact.UNITED_KINGDOM"
uprating = "gov.obr.non_labour_income"


class private_transfer_income(Variable):
Expand Down

0 comments on commit 526d1f5

Please sign in to comment.