Add Scotland and Wales private-rent calibration targets#331
Add Scotland and Wales private-rent calibration targets#331
Conversation
vahid-ahmadi
left a comment
There was a problem hiding this comment.
Two items worth addressing:
-
households.pyrefactor is a no-op — should be removed or completedThe
compute_tenurerefactor changes_TENURE_MAPvalues to(string, country)tuples and generalises the lookup, but the map still only containstenure_england_*keys. No Wales/Scotland entries are added, and no source module provides Wales/Scotland tenure targets. This function is used by the general target registry, not the constituency calibration path — so it's not exercised by anything new in this PR. Should either be removed from the PR or completed with actual new entries. -
Minor inconsistency:
rentvsbenunit_rentThe existing
local_authorities/loss.py:227-228usesbenunit_rentmapped to household level for its private rent targets. This PR usesrent(the household-levelhhrentfrom FRS) directly. These could diverge for multi-benefit-unit households. Probably fine since the constituency path builds its own matrix, but worth a quick check that the same rent concept is intended.
Summary
This addresses #316 with a bounded target-side fix.
The root problem is not just sample size. Constituency calibration currently has no rent or tenure anchors at all, so Scotland and Wales can drift to implausibly low private-rent levels while still matching income, age, and UC targets.
This PR adds country-level Scotland and Wales anchors to the national objective used during constituency calibration:
Target values
2025 private-rented stock targets:
200,700357,7062025 average private rent anchors:
£795/month£999/monthWhy this shape
This does not claim to solve within-country differentiation like Edinburgh versus rural Scotland. We still do not have constituency-level rent targets.
It also deliberately avoids country rent-spend targets, because those would conflict with the current rough UK-wide rent total target. Instead, the PR uses a linear average-rent constraint:
That gives the optimizer the right signal without introducing a contradictory aggregate objective.
Sources
Testing
Passed locally:
uvx ruff check policyengine_uk_data/targets/sources/devolved_housing.py policyengine_uk_data/targets/compute/households.py policyengine_uk_data/targets/compute/other.py policyengine_uk_data/targets/build_loss_matrix.py policyengine_uk_data/tests/test_devolved_housing_targets.py policyengine_uk_data/tests/test_target_registry.pyuv run pytest -q policyengine_uk_data/tests/test_devolved_housing_targets.py policyengine_uk_data/tests/test_target_registry.py policyengine_uk_data/tests/test_housing_targets.py