-
Notifications
You must be signed in to change notification settings - Fork 0
Algorithm
← Home | Data | Implementation
IGOR runs an Iterative Proportional Fitting (IPF) procedure that alternates between two balancing steps until convergence. See Home for full notation and a summary of the core formula.
Initialize: B_ar = 1 for all a, r
For t = 1 … NumberOfIterations:
Step 1 — recompute A_i and X_ai (cell constraint: Σ_a X_ai = P_i)
Step 2 — update B̃_ar (region constraint: Σ_i X_ai ≈ Q_ar)
Step 3 — normalize B_ar (numerical stability)
Output: X_ai from final iteration
Given
Then the allocation for each SexAgeClass
This guarantees
The two ESTAT share terms encode the cross-product structure:
-
$E_{i,s(a)}$ — sex share (M or F) for the 1 km cell containing$i$ -
$E_{i,b(a)}$ — broad-age share (LT15, 15–64, or GE65) for the same cell
The product
Sum the current-iteration allocations over all cells in region
Update the balancing factor multiplicatively:
Intuition:
| Situation | Effect on |
|---|---|
|
|
|
|
|
|
|
|
|
If $\hat{Q}{ar}^{(t)} = 0$ and $Q{ar} = 0$, the factor is set to 0
(MakeDefined(..., 0f) in the code).
To keep factors numerically stable across iterations, each region's vector
of
After normalization, the largest SexAgeClass in every region always has
The loop runs for exactly NumberOfIterations steps (default: 10).
No early-stopping criterion is applied; the result container always points
to the last iteration:
Result := Iters/<last iter name>
| Container / attribute | Description |
|---|---|
Diff_X_i_P_i |
Residual cell error |
X_asr |
Modelled population per SexAgeClass summed to LAU level |
Diff_X_asr_Q_asr |
Residual region error, relative to region total |
MAPE |
Mean Absolute Percentage Error per LAU region (lower = better) |
Error_Distr_vs_Expected_Shares |
Share error per SexAgeClass per region |
Error_Abs_vs_Expected_Sizes |
Absolute population error per SexAgeClass per region |
-
Data — what
$P_i$ ,$E_{i,s}$ ,$E_{i,b}$ ,$Q_{ar}$ are and where they come from - Implementation — how the iteration template is built in GeoDMS