# Synthetic Non-Domestic Buildings Dataset — Quick Guide

This dataset provides a **synthetic micro-population** of non-domestic premises across Great Britain.  
Each row represents a *synthetic premises record* generated to match the **number**, **geographic distribution**, and **broad statistical behaviour** of the real (confidential) data, while protecting privacy.

The synthetic population is produced using a **bucketed conditional generation** approach:

---

## 1. Buckets: how the synthetic population is structured

The real data are grouped into **base buckets**, defined by:

- **Nation** (EW / SCT)  
- **Base geographic unit** (MSOA for England & Wales, IZ for Scotland)  
- **Activity group** (e.g. Offices, Education, Retail)

For each such bucket, the synthetic dataset contains **exactly the same number of rows** as the real data.  
We do *not* invent new buckets, and buckets with zero real premises remain empty.

---

## 2. Zoom levels: where the synthetic values come from

For each base bucket, the generator attempts to learn plausible numeric values from progressively wider pools of real data:

1. **`-` (Base level)**  
   MSOA/IZ × activity group  
   *Most specific; used when ≥10 usable real records exist.*

2. **`g` (Geographic zoom)**  
   LAD × activity group  
   *Used when the base bucket has insufficient data.*

3. **`gt` (Geographic + activity-class zoom)**  
   LAD × activity class  
   *Wider pool; used when both finer levels have <10 usable records.*

4. **`gta` (Approximate fallback)**  
   Indicates zoom `gt` also failed to pass distributional checks  
   *Values are still generated, but should be interpreted cautiously (see below).*

The zoom level used for each row is stored in the `zoom` column.

---

## 3. Interpreting zoom levels

**`zoom = "-"`**  
→ Synthetic values trained on the closest matching real data.  
→ Highest expected fidelity.

**`zoom = "g"`**  
→ Local geography preserved (same LAD), but MSOA/IZ detail diluted.  
→ Still good for LAD-level analysis.

**`zoom = "gt"`**  
→ Falls back to LAD × activity class.  
→ Useful when activity groups are sparse locally.

**`zoom = "gta"`** (approximate)  
→ No zoom level passed internal distribution checks (KS tests).  
→ Synthetic values are still provided to retain coverage.  
→ Diagnostics columns (KS statistics, correlation differences, mean-bias) help assess local quality.  
→ Users may choose to exclude or down-weight these rows, depending on their application.

---

## 4. Missing / null rows: what they mean

A bucket may still produce **rows with all numeric fields missing**:

- This happens only when **no zoom level** had at least **10 usable real records** even at the broadest level.
- These rows exist *only* to preserve the correct **cardinality** of each bucket.
- They should be excluded from quantitative analysis, as they contain no valid synthetic information.

---

## 5. Diagnostics: understanding statistical quality

Several per-bucket diagnostics are included:

- **`ks_<variable>_stat`** — Kolmogorov–Smirnov statistic vs. the real data pool  
- **`corr_diff_*`** — differences in key correlations between real and synthetic data  
- **`mean_bias_all`, `mean_rel_bias_all`** — absolute and relative mean differences (core variables)

These help identify buckets where synthetic values closely match the behaviour of real data and those that are approximate (`gta`) or low-support (null numeric rows).

---

## 6. Summary

- The synthetic population preserves **counts**, **geographic distribution**, and **broad statistical structure** of the real premises data.  
- **Zooming** controls how widely the model borrows information when buckets have sparse data.  
- **`gta`** rows provide full coverage while signalling reduced statistical fidelity.  
- **Null-numeric rows** occur only where the real data are too sparse even after zooming.

For most aggregate or LAD-level analysis, strict zooms (`-`, `g`, `gt`) provide high-quality synthetic substitutes, while diagnostics help users decide how to treat approximate (`gta`) or null buckets.


---

## 7. Variable Dictionary

- **`msoa_code`** - Middle Super Output Area Code 
- **`lad_code`** - Local Authority District Code	
- **`activity_group_name`**	- CaRBE Activity Class Grouping (see NBD Final Report for details)
- **`zoom`** - Synthetic data zoom level (see above)
- **`floor_area_m2`** - Floor area of premises (m2)
- **`storeys`**	- No. of storeys
- **`wall_construction`** - Predominant construction of wall element	
- **`age_band`** - Date range of premises construction
- **`main_heating_fuel`** - Main fuel used for heating (may not be only fuel used)
- **`building_env`** - Main space conditioning system	
- **`ac_present`**	- Air conditioning system present on premises
- **`u_value`** - Average premises U-value
- **`annual_kwh_elec_per_m2`**	- Annual electricity Energy Use Intensity (kwh/m2/year)
- **`building_mix`** - Flag indicating whether premises shares a building with other domestic or non-domestic premies
- **`f2f_ht`** - Floor to floor height (m)
