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
1 change: 1 addition & 0 deletions changelog.d/corporate-land-allocation.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed `corporate_land_value` to allocate aggregate corporate land using the current weighted distribution of `corporate_wealth`, and refreshed the aggregate land parameters to the 2024 ONS land totals used by `policyengine-uk-data`.
12 changes: 12 additions & 0 deletions policyengine_uk/parameters/household/wealth/land/value.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ aggregate_household_land_value:
2018-01-01: 3_947_306_000_000
2019-01-01: 3_961_152_000_000
2020-01-01: 4_309_138_000_000
2021-01-01: 5_047_690_687_279
2022-01-01: 5_070_355_908_968
2023-01-01: 4_798_764_603_941
2024-01-01: 5_041_350_906_096
2025-01-01: 5_041_350_906_096
2026-01-01: 5_041_350_906_096
metadata:
unit: currency-GBP
label: Total direct household land value
Expand All @@ -25,6 +31,12 @@ aggregate_corporate_land_value:
2018-01-01: 1_695_825_000_000
2019-01-01: 1_683_117_000_000
2020-01-01: 1_757_818_000_000
2021-01-01: 2_059_094_312_721
2022-01-01: 2_068_340_091_032
2023-01-01: 1_957_550_396_059
2024-01-01: 2_058_649_093_904
2025-01-01: 2_058_649_093_904
2026-01-01: 2_058_649_093_904
metadata:
unit: currency-GBP
label: Total corporate land value
Expand Down
65 changes: 65 additions & 0 deletions policyengine_uk/tests/test_corporate_land_value.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
from policyengine_uk import Simulation
import pytest


def test_corporate_land_value_matches_aggregate_for_weighted_dataset():
sim = Simulation(
situation={
"people": {
"person_1": {"age": {2025: 40}},
"person_2": {"age": {2025: 50}},
},
"benunits": {
"benunit_1": {"members": ["person_1"]},
"benunit_2": {"members": ["person_2"]},
},
"households": {
"household_1": {
"members": ["person_1"],
"corporate_wealth": {2025: 100_000},
"household_weight": {2025: 2},
},
"household_2": {
"members": ["person_2"],
"corporate_wealth": {2025: 300_000},
"household_weight": {2025: 1},
},
},
}
)

corporate_land_value = sim.calculate(
"corporate_land_value", map_to="household", period=2025
)
household_weight = sim.calculate(
"household_weight", map_to="household", period=2025
)
aggregate = sim.tax_benefit_system.parameters(
"2025"
).household.wealth.land.value.aggregate_corporate_land_value

assert corporate_land_value[0] == pytest.approx(aggregate * 0.2)
assert corporate_land_value[1] == pytest.approx(aggregate * 0.6)
assert (corporate_land_value * household_weight).sum() == pytest.approx(aggregate)


def test_corporate_land_value_is_zero_without_corporate_wealth():
sim = Simulation(
situation={
"people": {"person": {"age": {2025: 40}}},
"benunits": {"benunit": {"members": ["person"]}},
"households": {
"household": {
"members": ["person"],
"corporate_wealth": {2025: 0},
"household_weight": {2025: 1},
}
},
}
)

corporate_land_value = sim.calculate(
"corporate_land_value", map_to="household", period=2025
)

assert corporate_land_value[0] == 0
16 changes: 12 additions & 4 deletions policyengine_uk/variables/household/wealth/corporate_land_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,17 @@ class corporate_land_value(Variable):
quantity_type = STOCK

def formula(household, period, parameters):
wealth = parameters(period).household.wealth
corporate_wealth = household("corporate_wealth", period)
corporate_wealth_intensity = (
wealth.land.value.aggregate_corporate_land_value / wealth.corporate_wealth
household_weight = household("household_weight", period)
total_weighted_corporate_wealth = (corporate_wealth * household_weight).sum()
if total_weighted_corporate_wealth == 0:
return corporate_wealth * 0

aggregate_corporate_land_value = parameters(
period
).household.wealth.land.value.aggregate_corporate_land_value
return (
corporate_wealth
/ total_weighted_corporate_wealth
* aggregate_corporate_land_value
)
return corporate_wealth * corporate_wealth_intensity
Loading