Skip to content

Implementation

Jip Claassens edited this page Mar 31, 2026 · 1 revision

Home | Algorithm | Data


IGOR is implemented in the GeoDMS modelling framework using the .dms scripting language. The entry point is Reference_data.dms.


Container structure

Reference_data
├── Checks              — data-quality diagnostics and fallback triggers
├── Impl
│   ├── Iter            — unit defining iteration names (Iter_1 … Iter_N)
│   ├── Q_asr_RAW       — raw LAU census aggregation from microdata
│   └── Q_asr_shares_based_on_NUTS3  — fallback shares at NUTS3 level
├── E_is                — cell-level sex shares (with fallback logic)
├── E_ib                — cell-level broad-age shares (with fallback logic)
├── Q_asr               — final (possibly corrected) LAU population pyramids
├── Iters
│   ├── Iter_0          — initialization: B_asr = 1 everywhere
│   ├── Iter_1          — first IPF iteration (via Iter_T template)
│   ├── …
│   └── Iter_N          — last IPF iteration
├── Result              — alias pointing to Iters/Iter_N; holds diagnostics
├── StoreResults        — writes output GeoTIFFs to disk
└── Iter_T              — template: one IPF iteration (A_i, X_asi, B_asr)

Key containers in detail

Iter_T — single iteration template

Iter_T is a GeoDMS template that takes the name of the previous iteration container as a parameter and computes:

  1. A_i_raw / A_i — cell balancing factor (with MakeDefined(..., 0f) guard)
  2. X_asi — population per SexAgeClass per IPF unit
  3. B_asr_raw — updated region factors (multiplicative update + zero guard)
  4. B_asr — normalized region factors (divided by B_asr_raw/Max_elem)

The Iters container instantiates Iter_T for each iteration via for_each_ne, chaining them so each iteration receives the previous one's B_asr as input.

Iters/Iter_0 — initialization

Sets B_asr = 1 for all SexAgeClasses and all LAU regions. No X_asi is computed at this stage; Iter_0 serves only to provide the starting B.

Result

Points to Iters/Iter_N (the last iteration). Adds:

  • X_asr$X_{ai}$ summed to LAU level for validation
  • Diff_X_asr_Q_asr — region residuals (relative to region total)
  • Diff_X_i_P_i — cell residuals (should be ≈ 0 by construction)
  • MAPE — Mean Absolute Percentage Error per LAU region
  • Error_Distr_vs_Expected_Shares — share error per SexAgeClass per region
  • Error_Abs_vs_Expected_Sizes — absolute error per SexAgeClass per region

StoreResults

Triggered by calculating StoreResults/button. Writes two sets of 1 km GeoTIFFs via for_each_nedvat:

  • abs_pop_1km/<SexAgeClass>.tif — absolute counts (aggregated from IPF units to 1 km)
  • rel_pop_1km/<SexAgeClass>.tif — shares relative to abs_pop_1km/Total

Parameters

Parameter Default Where set Description
NumberOfIterations 10 Reference_data Number of IPF iterations
ε 0.00001 Reference_data Floor applied to ESTAT inputs to prevent zero denominators
ModelParameters/store_path (project-specific) ModelParameters Output directory for GeoTIFFs

How to run

  1. Open the project in the GeoDMS GUI (or use the command-line runner).
  2. Ensure all input files are available:
    • ARDECO population raster at 100 m
    • ESTAT sex and broad-age rasters at 1 km
    • LAU census microdata (Population/AGEGROUP5_SEX_perLAU)
  3. Set ModelParameters/store_path to the desired output directory.
  4. Calculate StoreResults/button — this triggers the full chain: inputs → fallback checks → Q_asr correction → IPF iterations → output rasters.

To inspect intermediate results without writing files, calculate any attribute inside Result/ or Iters/Iter_<N>/ directly in the GUI.


Adding iterations

To increase the number of iterations, change NumberOfIterations:

parameter<uint8> NumberOfIterations := 20b;

The Iters container and the Result alias update automatically.


See also

  • Algorithm — mathematical description of what Iter_T computes
  • Data — input datasets, fallback logic, and output file formats

Clone this wiki locally