From a8acbca16a90018e1499c3bec81abf5cc4f75ab8 Mon Sep 17 00:00:00 2001 From: Nikhil Woodruff Date: Wed, 24 Jul 2024 08:41:45 +0100 Subject: [PATCH] Add economic assumptions --- .../gov/contrib/policyengine/economy/energy_bills.yaml | 6 ++++++ .../gov/contrib/policyengine/economy/gdp_per_capita.yaml | 6 ++++++ .../gov/contrib/policyengine/economy/interest_rates.yaml | 6 ++++++ .../parameters/gov/contrib/policyengine/economy/rent.yaml | 6 ++++++ .../gov/contrib/policyengine/economy/transport.yaml | 6 ++++++ policyengine_uk/variables/household/income/income.py | 7 ++++++- 6 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 policyengine_uk/parameters/gov/contrib/policyengine/economy/energy_bills.yaml create mode 100644 policyengine_uk/parameters/gov/contrib/policyengine/economy/gdp_per_capita.yaml create mode 100644 policyengine_uk/parameters/gov/contrib/policyengine/economy/interest_rates.yaml create mode 100644 policyengine_uk/parameters/gov/contrib/policyengine/economy/rent.yaml create mode 100644 policyengine_uk/parameters/gov/contrib/policyengine/economy/transport.yaml diff --git a/policyengine_uk/parameters/gov/contrib/policyengine/economy/energy_bills.yaml b/policyengine_uk/parameters/gov/contrib/policyengine/economy/energy_bills.yaml new file mode 100644 index 000000000..ddea73fc7 --- /dev/null +++ b/policyengine_uk/parameters/gov/contrib/policyengine/economy/energy_bills.yaml @@ -0,0 +1,6 @@ +description: Raise energy spending by this percentage. +values: + 2000-01-01: 0 +metadata: + unit: /1 + label: Change to energy spending \ No newline at end of file diff --git a/policyengine_uk/parameters/gov/contrib/policyengine/economy/gdp_per_capita.yaml b/policyengine_uk/parameters/gov/contrib/policyengine/economy/gdp_per_capita.yaml new file mode 100644 index 000000000..eca2c4b7f --- /dev/null +++ b/policyengine_uk/parameters/gov/contrib/policyengine/economy/gdp_per_capita.yaml @@ -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 \ No newline at end of file diff --git a/policyengine_uk/parameters/gov/contrib/policyengine/economy/interest_rates.yaml b/policyengine_uk/parameters/gov/contrib/policyengine/economy/interest_rates.yaml new file mode 100644 index 000000000..e6213c256 --- /dev/null +++ b/policyengine_uk/parameters/gov/contrib/policyengine/economy/interest_rates.yaml @@ -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 \ No newline at end of file diff --git a/policyengine_uk/parameters/gov/contrib/policyengine/economy/rent.yaml b/policyengine_uk/parameters/gov/contrib/policyengine/economy/rent.yaml new file mode 100644 index 000000000..949947ac9 --- /dev/null +++ b/policyengine_uk/parameters/gov/contrib/policyengine/economy/rent.yaml @@ -0,0 +1,6 @@ +description: Raise rental expenses by this percentage. +values: + 2000-01-01: 0 +metadata: + unit: /1 + label: Change to rents \ No newline at end of file diff --git a/policyengine_uk/parameters/gov/contrib/policyengine/economy/transport.yaml b/policyengine_uk/parameters/gov/contrib/policyengine/economy/transport.yaml new file mode 100644 index 000000000..ce5f4335e --- /dev/null +++ b/policyengine_uk/parameters/gov/contrib/policyengine/economy/transport.yaml @@ -0,0 +1,6 @@ +description: Raise transport expenses by this percentage. +values: + 2000-01-01: 0 +metadata: + unit: /1 + label: Change to transport spending \ No newline at end of file diff --git a/policyengine_uk/variables/household/income/income.py b/policyengine_uk/variables/household/income/income.py index 1e0a7cbd8..f999a44e7 100644 --- a/policyengine_uk/variables/household/income/income.py +++ b/policyengine_uk/variables/household/income/income.py @@ -190,7 +190,7 @@ class inflation_adjustment(Variable): def formula(household, period, parameters): cpi = parameters.calibration.uprating.CPI 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 @@ -360,6 +360,11 @@ 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"