Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Scottish private-rent targets: PIPR is BRMA-grain, so council cells cannot bind by translation

Open
#1,090 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
data

Research direction

Start with the ons.rent.private_rent target, the CrossGrainBridge abstraction, and AREA_TYPES to understand the current grain and boundary-frame rules. Read the parity register and the proposed overlap resource and rebuild-tool requirements before choosing between BRMA-grain rows and a signed exception. Done means the overlap is committed with tests, the deferral reason records that translation is invalid, and no unsupported council targets are bound.

Written by the indexing model from the issue text.

Description

The gap

ONS's Price Index of Private Rents (PIPR) publishes Scottish rent levels for the 18 Broad Rental Market Areas (codes S33000001–S33000018), not for the 32 council areas. Microcosm's ons.rent.private_rent target is bound at local-authority grain, so all 32 Scottish cells are signed deferred (private_rent_pipr_scotland_brma_grain), and the parity register routes the concern cross_grain_private_rent_scotland_brma. Its fence says to keep the cells deferred "until a source-backed BRMA-to-LA bridge with an explicit aggregation rule exists". #736 lists this gap with no issue of its own.

A census crosswalk now exists (built for PolicyEngine/policyengine-uk-data#516 and #1087), so the question is whether a rule such as "household-weighted mean of BRMA rents per council" can lift the deferral.

What the overlap looks like

Built from Scotland's Census 2022 and the official BRMA geography (2022 output-area centroids in the Scottish Government's BRMA polygons, corrected by Rent Service Scotland's postcode lookup, FOI 202300368850):

  • 63 BRMA × council intersections hold 322,995 private-rented households.
  • 18 of the 32 councils fall in more than one BRMA, and 16 of the 18 BRMAs cover more than one council.
  • 29 councils and 17 BRMAs form one connected block; the three Ayrshire councils and the Ayrshires BRMA are the only group that separates. No finer grouping makes BRMAs a union of whole councils. Much of the joining is slivers: dropping intersections under 1% of both sides leaves 11 blocks, one of which still holds five BRMAs and seven councils.
  • Four councils are the same place as one BRMA to within 1% of private-rented households in both directions: Dumfries and Galloway, Fife, West Lothian and Scottish Borders.

What the weighted-mean rule would get wrong

For a council that sits inside one BRMA, the rule returns that BRMA's mean unchanged, so every council sharing a BRMA gets the same rent. Rent Service Scotland's market evidence for the year to September 2021 (FOI 202200303624: 31,833 lettings with BRMA, rent and postcode district) shows how far that is from the councils' own rents:

Council BRMA Rule ÷ council's own mean
Midlothian Lothian +30.9%
Clackmannanshire Forth Valley +26.8%
East Lothian Lothian +23.1%
Falkirk Forth Valley +20.5%
Stirling Forth Valley −15.2%
Orkney Islands Highland and Islands +13.6%
Na h-Eileanan Siar Highland and Islands +13.3%
East Renfrewshire Greater Glasgow / Renfrewshire and Inverclyde −12.5%
Angus Dundee and Angus +11.1%

Across the 31 councils with at least 30 records, the median absolute gap is 3.3%, 12 exceed 5% and 9 exceed 10%. The four coincident councils are within 0.1%.

Proposed outcome

  1. Commit the overlap as a source-backed resource with a rebuild tool and tests.
  2. Record that no rule turning BRMA rents into council targets satisfies the fence: any such rule gives a council a value that only BRMA averages determine, which is the allocation the fence forbids. CrossGrainBridge cannot carry it either: it equates additive totals over a partition of legs, and a mean over overlapping geographies is neither.
  3. Keep the 32 cells deferred, with the reason updated: the crosswalk exists; the missing piece is a target grain, not a translation.

Routes left open

  • BRMA-grain target rows. Keep PIPR's geography on the target side (12 × BRMA mean × BRMA private renters) and aggregate the model side with the overlap shares. This uses all 18 published rents and allocates nothing, but AREA_TYPES is ("constituency", "la"), so it needs a new area type through the rowwise surface.
  • A signed exception for the four coincident councils. Their BRMA rent is their own rent to within about 2% in the worst case. Binding them means letting a fact on the BRMA boundary set reach a local-authority cell, which the boundary-frame gate added in #795 refuses by design.
Dominant language
Python
Stars
0
Forks
4
Avg merge
1d 15h
Merged PRs (30d)
104

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PolicyEngine/microcosm

All issues in PolicyEngine/microcosm

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.