Skip to content

Commit

Permalink
Add fuel duty revenue projections and increase imputation granularity (
Browse files Browse the repository at this point in the history
…#831)

* Add docker step

* Versioning

* Remove push action from PRs

* Add requirements.txt

* Update carbon tax intensities for 2024 data

* Versioning

* Temporarily suspend fuel duty parameters

* Add fuel duty revenues

* Versioning

* Fix tests

* Reduce consumer incidence
  • Loading branch information
nikhilwoodruff authored Mar 5, 2024
1 parent 4407653 commit e29a512
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 13 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:
added:
- Fuel duty revenue projections
2 changes: 1 addition & 1 deletion policyengine_uk/data/datasets/frs/enhanced_frs.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def generate(self):
target_values,
X_input,
frs_household_weight,
max_iterations=5,
max_iterations=8,
)
else:
quantiles = None
Expand Down
28 changes: 28 additions & 0 deletions policyengine_uk/data/datasets/frs/imputations/consumption.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,33 @@ def generate_lcfs_table(
].dropna()


def uprate_lcfs_table(
household: pd.DataFrame, time_period: str
) -> pd.DataFrame:
from policyengine_uk.system import system

fuel_duty_revenue = (
system.parameters.calibration.programs.fuel_duty.revenue
)
fuel_duty_rate = system.parameters.gov.hmrc.fuel_duty.petrol_and_diesel
start_period = 2020
start_index = fuel_duty_revenue(start_period) / fuel_duty_rate(
start_period
)
end_index = fuel_duty_revenue(time_period) / fuel_duty_rate(time_period)
fuel_uprating = end_index / start_index
household["petrol_spending"] *= fuel_uprating
household["diesel_spending"] *= fuel_uprating

cpi = system.parameters.calibration.uprating.CPI
cpi_uprating = cpi(time_period) / cpi(start_period)

for variable in IMPUTATIONS:
if variable not in ["petrol_spending", "diesel_spending"]:
household[variable] *= cpi_uprating
return household


def save_imputation_models():
consumption = Imputation()
lcfs_household = pd.read_csv(
Expand All @@ -115,6 +142,7 @@ def save_imputation_models():
LCFS_TAB_FOLDER / "lcfs_2020_dvper_ukanon202021.tab", delimiter="\t"
)
household = generate_lcfs_table(lcfs_person, lcfs_household)
household = uprate_lcfs_table(household, "2023")
consumption.train(
household[PREDICTOR_VARIABLES],
household[IMPUTATIONS],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
alcohol_and_tobacco_consumption: 20649078205.153564
clothing_and_footwear_consumption: 20963698388.085712
communication_consumption: 16271364314.480564
diesel_spending: 6376596007.607264
diesel_spending: 8267208905.41007
domestic_energy_consumption: 34019184412.316296
education_consumption: 12218834004.851433
food_and_non_alcoholic_beverages_consumption: 101271123549.67178
health_consumption: 9779703005.577099
household_furnishings_consumption: 50520352854.88441
housing_water_and_electricity_consumption: 124038611200.9107
miscellaneous_consumption: 54415069695.58299
petrol_spending: 10060152807.35514
petrol_spending: 13042912673.083202
recreation_consumption: 65969989192.65327
restaurants_and_hotels_consumption: 26464397527.409103
transport_consumption: 89217063076.27383
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
description: Fuel duty revenues.
values:
2020-01-01: 20_934_000_000
2021-01-01: 25_943_000_000
2022-01-01: 24_799_033_375
2023-01-01: 24_799_033_375
2024-01-01: 24_348_775_447
2025-01-01: 26_621_382_708
2026-01-01: 26_262_427_712
2027-01-01: 26_034_425_644
metadata:
unit: currency-GBP
label: Fuel duty revenues
reference:
- title: OBR forecast
href: https://obr.uk/forecasts-in-depth/tax-by-tax-spend-by-spend/fuel-duties
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
- name: Petrol only in 2022.
period: 2022
absolute_error_margin: 0.1
absolute_error_margin: 1
input:
petrol_spending: 1_200
diesel_spending: 0
output:
petrol_litres: 1200 / 1.491
petrol_litres: 1200 / 1.4910
diesel_litres: 0
fuel_duty: 804.83 / 0.508 * 0.5795
fuel_duty: 1322
- name: No fuel spending, no fuel duty.
period: 2023
absolute_error_margin: 0.1
Expand All @@ -26,8 +26,8 @@
diesel_spending: 350
output:
petrol_litres: 800 / 1.6703
diesel_litres: 350 / 1.7897
fuel_duty: (478.96 + 195.56) / 0.508 * 0.5295
diesel_litres: 350 / 1.4559
fuel_duty: (478.96 + 240.40) / 0.33 * 0.5295
- name: Petrol and diesel in 2021.
period: 2021
absolute_error_margin: 0.1
Expand All @@ -37,5 +37,5 @@
output:
petrol_litres: 800 / 1.0669
diesel_litres: 350 / 1.1186
fuel_duty: (749.84 + 312.89) / 0.508 * 0.5795
fuel_duty: (749.84 + 312.89) / 0.33 * 0.5795

Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
input:
petrol_spending: 100
output:
fuel_duty: 54.32 / 0.51
fuel_duty: 54.32 / 0.33

- name: Reduction from 5p cut
period: 2021
absolute_error_margin: 1
input:
gov.hmrc.fuel_duty.petrol_and_diesel: 0.5295
petrol_spending: 100
baseline_fuel_duty: 54.32 / 0.51
baseline_fuel_duty: 54.32 / 0.33
output:
change_in_fuel_duty: -5 / 0.51
change_in_fuel_duty: -5 / 0.33
2 changes: 1 addition & 1 deletion policyengine_uk/variables/gov/hmrc/fuel_duty/fuel_duty.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from policyengine_uk.model_api import *


STATUTORY_CONSUMER_INCIDENCE = 0.508
STATUTORY_CONSUMER_INCIDENCE = 0.33
ECONOMIC_CONSUMER_INCIDENCE = 1


Expand Down

0 comments on commit e29a512

Please sign in to comment.