nestauk / asf_heat_pump_suitability

Project to identify which small areas are likely to be suitable (or unsuitable) for which types of heating technology.
MIT License
4 stars 1 forks source link

Demonstrate use of multi-level ipf with Scottish data #78

Open danlewis85 opened 2 weeks ago

danlewis85 commented 2 weeks ago

Scotland doesn't publish housing stock ages for small areas. This means we cannot take the same approach we have done in England and Wales.

Scotland does however provide some estimates for housing stock from the Scottish housing condition survey at the local authority level.

As housing age is a significant predictor of energy efficiency and EPCs are biased towards newer properties we want to retain some control over this factor.

A potential solution is to use multi-level iterative proportional fitting, which would constrain the weighting solution to the lsoa-level margins where available and a set of lsoas to their respective la-level housing stock age margin.

The algorithm for doing this multi-level adjustment is only (to our knowledge) publicly implemented in R (package: mlfit), therefore this issue will explore the possibility of using this appraoch via an interface with python (rpy2).

An alternative would be to redevelop the functionality in python. However, this would take some time as the existing R package is quite mature. Although the algorithm is reasonably straightforward to reproduce, the data reshaping required is quite involved and would likely take time to get right.

danlewis85 commented 2 weeks ago

Looks like mlfit won't actually deliver the reweighting required.

However, I have come across popgen 2.0 which appears to do exactly what I want (as per).

danlewis85 commented 2 weeks ago

I'm going to look into applying popgen to our problem.