The question
Insurers price location aggressively but publish nothing about how. This model reverse-engineers the territorial effect from the outside: it takes the open data an insurer's territory model plausibly summarises — vehicle crime, area deprivation, traffic intensity, who lives there — and regresses it against the only ground truth that exists publicly: published premium indices (WTW/Confused.com quarterly index, MoneySuperMarket regional figures), transcribed into a 137-row anchor panel under a strict no-invented-figures rule — every £ figure traces to an explicitly published, cited source.
A deliberate design choice follows from that: the model predicts a relative territorial index — each area's premium as a multiple of the national average — not absolute £ directly. Modelling the ratio strips out the national price level and its drift over time, isolating the thing the project is actually about: the effect of place. Absolute £ is reconstructed at the end by pinning to the latest published national average (£558.55).
The model
The core is a deliberately small model — ordinary least squares on the log relative index, with area-clustered standard errors — because the calibration sample is honest but small (106 observations across 30 areas). The sophistication is spent on auditing it rather than growing it:
Every feature enters as a rank percentile (0–100), ranked within comparable groups (within nation, or England+Wales vs Scotland for crime, whose recording definitions differ). Percentiles bound extrapolation — no outlier area can blow the prediction up — and make three nations' incompatible source scales comparable by construction.
Nothing is in the premium model by intuition. A candidate feature must show an independent partial correlation (p < 0.05) at acceptable collinearity (VIF < 10), or win a leave-one-area-out head-to-head. The gate has real veto power — it has said no more often than yes:
| Feature | Verdict | Evidence |
|---|---|---|
| Young-driver share | DRIVER | strongest independent predictor (partial r ≈ +0.55) — kept as a composition control |
| IMD crime sub-domain | DRIVER | partial r +0.43, p=3.7×10⁻⁶ — replaced overall deprivation, which collapsed to p=0.78 once its crime component stood alone |
| Vehicle crime rate | DRIVER | independent significant keeper in every wave |
| Cars per household | DRIVER | composition control, negative sign (car-dense suburbs price lower) |
| AADF traffic intensity | DRIVER | kept on LOAO head-to-head: dropping it worsens MAE £76.51 → £82.54 |
| Population density | GATED OUT | always collinear with the urban-intensity features — replaced by point-level AADF, which resolved the "it's just a density model" critique |
| Flood risk | GATED OUT | wrong-signed for car premiums (r = −0.94 — it tracks rurality, which is cheap); ingested for all three nations, shown as a map diagnostic, banked as evidence for a future home-insurance line |
| Road casualties / KSI | GATED OUT | no independent signal once traffic exposure is controlled |
| IMD income sub-domain | GATED OUT | VIF 33 — redundant within the deprivation family |
Demographics enter as controls, so each area gets three numbers: the full premium, a place-only counterfactual (demographics held at the national median), and the composition uplift between them. Composition alone explains more of the spread (R² 0.88) than place alone (R² 0.82) — who lives there beats what happens there. That is reported as a finding, not hidden as an inconvenience.
Each area's premium decomposes through an exact LMDI (logarithmic-mean) waterfall: a £ step per factor from a typical-GB baseline (every feature at the median), summing to the headline premium exactly — no residual, independent of factor ordering — with a train/serve-consistency test guarding the served map against stale coefficients.
Intervals come from a 200-rep cluster bootstrap (resampling anchor areas, not rows)
— but coefficient uncertainty alone gave an implausibly tight £241 median width, so bands are
widened by the out-of-sample LOAO residual variance to an honest median width of
£373. Every one of the 41,729 areas ships with its
premium_low/premium_high.
Pipeline
Four make-target stages, each writing intermediate Parquet files, so every step is inspectable and re-runnable. One module per source, pure-function cores with isolated I/O, ~one pytest file per module. All spatial maths in the British National Grid (EPSG:27700); reprojection to WGS84 happens only at final map output.
Ten source modules → data/interim/*.parquet. Each pulls one open source (bulk CSV, ArcGIS REST, SPARQL, WFS, SFTP), validates it, and normalises to the 2011 LSOA / Data-Zone geography that all sources share.
Join everything onto the boundary master list — one row per area: crime rates per 1k population per year, severity-weighted casualties, deprivation ranks, traffic intensity, demographics. Missing features reweight per-row rather than being zero-filled.
Percentile features + calibrated coefficients → £. Reads the
calibration, reconstructs each area's premium, place-only counterfactual, waterfall
contributions, intervals and quintile — writes lsoa_risk.parquet and the
GeoJSON the map serves.
The regression and its audit. Anchor-panel ingest, OLS with clustered SEs, ridge cross-validation, leave-one-area-out, temporal back-test, VIF/partial-correlation feature gate — then re-runs M3 and the map bake so served data can never lag the coefficients.
Topology-aware simplification (mapshaper) of 41,729 polygons into the static GeoJSON a React + MapLibre frontend streams from GitHub Pages — no server in production; the FastAPI app is a local dev convenience only.
Data sources
Everything is public and licensed under the Open Government Licence. The unglamorous core decision: standardise on 2011 census geography — the lowest common denominator that deprivation indices, boundaries and Scottish Data Zones all share.
| Source | Access | Feeds | The interesting transform |
|---|---|---|---|
| ONS / ScotGov boundariesarea_boundaries.parquet | ArcGIS REST | spatial backbone | Paginated ESRI features → ring-winding repair → unified GB schema; areas computed in EPSG:27700; make_valid is always the last geometry op (re-simplifying after it once re-broke Scottish areas) |
| data.police.ukvehicle_crime.parquet | bulk archive | vehicle_crime (E+W) | 36 months of street-level vehicle crime, already LSOA-coded → incidents per 1k residents per year |
| Recorded Crime in Scotlandscotland_vehicle_crime.parquet | SPARQL | vehicle_crime (Scot) | Council-level theft-of/from-vehicle counts disaggregated to Data Zones by population share; ranked within Scotland only — recording definitions differ from E+W, so absolute rates are never compared cross-border |
| IoD2019 / WIMD / SIMDdeprivation.parquet | CSV · ArcGIS · workbook | imd_crime + diagnostics | Three incompatible national indices → within-nation percentile ranks; the crime sub-domain is the premium driver (Wales has no pure crime domain — its Community Safety domain is the documented nearest analogue) |
| DfT AADF count pointsaadf.parquet | bulk ZIP | aadf_intensity | ~22k GB traffic count points → KD-tree radius query: mean annual daily flow of points within 2 km of each area centroid (nearest-point fallback recorded for audit) |
| Census 2021 / 2022demographics.parquet | Nomis · UKDS | young_driver_share · cars_per_household | E+W age bands split uniformly-within-band for the 17–24 share; Scotland's 2022 tables publish exact single-year counts on 2011 Data Zones — no crosswalk needed |
| DfT STATS19collisions.parquet | bulk CSV | diagnostics only | Severity-weighted collisions (slight 1 / serious 3 / fatal 8); Scottish rows carry no area code natively → point-in-polygon spatial join |
| EA · NRW · SEPA floodflood.parquet | SFTP · WFS · REST | diagnostic only | High+Medium flood extents (326k England features) dissolved then areal-overlaid against every area → % of area at risk; within-nation ranked because "Medium" means 1-in-100yr to the EA and 1-in-200yr to SEPA |
| DfT LA road traffictraffic.parquet | bulk CSV | diagnostic only | The cautionary tale: local-authority traffic per resident is an inverse-density proxy (rural motorway corridors score highest) — demoted, and the reason point-level AADF exists |
| ONSPDpostcode_lookup.parquet | bulk ZIP | postcode search | Postcodes filtered to GB; one unified column maps each postcode to its LSOA or Data Zone (the newer NSPL product dropped that column in 2026 — hence ONSPD) |
Calibration ground truth (not a feature): a 137-row anchor panel hand-transcribed from the WTW/Confused.com quarterly price index and MoneySuperMarket's published regional figures, pooled with a source fixed-effect — 106 matched observations across 30 areas survive into the regression.
Honesty
Evolution
The current form is the residue of arguments the data won:
Sources & access
Every source is open and OGL-licensed, but "open" spans five very different access routes — from a one-click bulk download to a credentialed SFTP drop that had to be requested by email: