5 Calibration: raking and alignment
Weights are produced in one step: household-level iterative proportional fitting (raking) to 52 margins, which include the fiscal counts and the census family counts. Income totals are then aligned by scaling income values, not weights, and the losses of linear-tax businesses are calibrated. To document each step the production calibration was re-run from the production seed; the re-run reproduces the production weights to within 1.9e-14 (maximum absolute difference), so all states shown here are the states of the production file.
The first edition calibrated fiscal counts in a separate person-level pass, which gave members of one household different weights. That pass has been removed: the fiscal counts are household-rake margins, and every member of a household carries the same weight. All margins are now expressed in one population universe (Section 6.1), family targets are census counts of families rather than estimates of their members, and linear-tax income is no longer aligned (Section 5.3).
5.1 Household raking
Let \(h\) index households, \(s_h\) their size and \(c_{hj}\) the number of members with characteristic \(j\) (e.g. persons aged 0–9, employees, members of a lone-parent family). Raking adjusts a household weight \(w_h\) expressed in persons (initial value \(s_h\), total \(N\) = 37,636 thousand, the GUS population). Each person-level target \(T_j\) is first converted into a household-level target on the indicator \(x_{hj}=\mathbb 1[c_{hj}>0]\):
\[ \tilde T_j = T_j\Big/\bar d_j,\qquad \bar d_j=\frac{\sum_{h:\,c_{hj}>0} c_{hj}}{\sum_{h:\,c_{hj}>0} s_h}, \tag{5.1}\]
i.e. the number of persons in households containing at least one member with characteristic \(j\), assuming that the density of \(j\) in those households is the seed average. Raking then cycles over the margins,
\[ w_h \leftarrow \operatorname{clip}\!\Big(w_h\cdot\frac{\tilde T_j}{\sum_{h'} x_{h'j}w_{h'}},\ \ell\,\tfrac{N}{H},\ u\,\tfrac{N}{H}\Big)\quad\text{for } h:x_{hj}=1, \tag{5.2}\]
with \(H=50{,}000\) households, bounds \(\ell=0.005\) and \(u=25\), until the largest relative weight change in a full cycle is below \(10^{-6}\), and finally rescales to \(\sum_h w_h=N\). Person weights are \(w_i=w_h/s_h\) — every member of a household carries the same weight, equal to the number of households (in thousands) the record represents. This is classical raking (Deming and Stephan 1940), a special case of calibration estimation (Deville and Särndal 1992) with a multiplicative distance; the conversion in Equation 5.1 is what makes person-level margins usable while keeping weights constant within the household.
Because Equation 5.1 is exact only if every qualifying household has the seed average density, person-level margins are not hit exactly after raking even at convergence, and margins that conflict within the sample are reconciled as a compromise. The deviations are listed below and in Section 5.2.
Raking converged after 580 cycles (last change 1.0e-06).
5.1.1 Margins
Table 5.1 lists all margins with their deviation in the three states. The mean absolute deviation falls from 9.0% in the unweighted seed to 1.4% after raking and 1.4% in the final file. The largest remaining deviations are: Civil contract +5.2%; Age 70–79 -4.3%; Lone-parent families with dependent children (families) -3.5%; Age 40–49 +3.4%.
| Margin | Group | Target (thous.) | Seed (%) | After IPF (%) | Final (%) | Source |
|---|---|---|---|---|---|---|
| Age 0–17 | Age | 6,812 | −3.0 | −3.2 | −3.2 | GUS demography 2023 (decades: same source) |
| Age 0–9 | Age | 3,603 | −6.3 | −2.9 | −2.9 | GUS demography 2023 (decades: same source) |
| Age 10–19 | Age | 3,954 | 5.1 | −3.0 | −3.0 | GUS demography 2023 (decades: same source) |
| Age 20–29 | Age | 3,874 | 17.5 | −1.0 | −1.0 | GUS demography 2023 (decades: same source) |
| Age 30–39 | Age | 5,565 | −1.8 | 1.2 | 1.2 | GUS demography 2023 (decades: same source) |
| Age 40–49 | Age | 6,116 | −12.8 | 3.4 | 3.4 | GUS demography 2023 (decades: same source) |
| Age 50–59 | Age | 4,624 | 3.6 | 1.9 | 1.9 | GUS demography 2023 (decades: same source) |
| Age 60–69 | Age | 4,865 | 1.6 | −0.1 | −0.1 | GUS demography 2023 (decades: same source) |
| Age 70–79 | Age | 3,433 | 1.0 | −4.3 | −4.3 | GUS demography 2023 (decades: same source) |
| Age 80+ | Age | 1,602 | −3.1 | 3.0 | 3.0 | GUS demography 2023 (decades: same source) |
| Age 18–29 | Age | 4,633 | 18.3 | −1.2 | −1.2 | GUS demography 2023 (decades: same source) |
| Age 30–44 | Age | 8,742 | −6.1 | 2.2 | 2.2 | GUS demography 2023 (decades: same source) |
| Age 45–59 | Age | 7,555 | −2.4 | 2.4 | 2.4 | GUS demography 2023 (decades: same source) |
| Age 60–64 | Age | 2,344 | 11.0 | −1.3 | −1.3 | GUS demography 2023 (decades: same source) |
| Elderly living alone (65+) | Age | 1,396 | −6.4 | 0.0 | 0.0 | Census 2021 (cens_21he_r2) |
| Male | Gender | 18,182 | −3.6 | 3.2 | 3.2 | GUS demography 2023 |
| Female | Gender | 19,454 | 3.3 | −3.0 | −3.0 | GUS demography 2023 |
| Urban | Region | 22,376 | 2.9 | 0.0 | 0.0 | GUS demography 2023 (urban/rural); voivodeship shares |
| Rural | Region | 15,260 | −4.2 | 0.0 | 0.0 | GUS demography 2023 (urban/rural); voivodeship shares |
| Edu: podstawowe (25+) | Education | 3,526 | 1.6 | 0.2 | 0.2 | Census 2021 (cens_21he_r2) |
| Edu: zawodowe (25+) | Education | 6,732 | 0.0 | 0.8 | 0.8 | Census 2021 (cens_21he_r2) |
| Edu: srednie (25+) | Education | 9,988 | −1.1 | 2.3 | 2.3 | Census 2021 (cens_21he_r2) |
| Edu: wyzsze (25+) | Education | 7,849 | −2.1 | 1.9 | 1.9 | Census 2021 (cens_21he_r2) |
| HH size = 1 | HH Size | 2,838 | −0.6 | 0.0 | 0.0 | NSP 2021 Tab. 2 (persons by household size) |
| HH size = 2 | HH Size | 6,303 | 0.3 | 0.0 | 0.0 | NSP 2021 Tab. 2 (persons by household size) |
| HH size = 3 | HH Size | 7,182 | 1.1 | 0.0 | 0.0 | NSP 2021 Tab. 2 (persons by household size) |
| HH size >= 4 | HH Size | 21,313 | −0.4 | 0.0 | 0.0 | NSP 2021 Tab. 2 (persons by household size) |
| Mazowieckie | Region | 5,348 | −1.1 | 0.0 | 0.0 | GUS demography 2023 (urban/rural); voivodeship shares |
| Slaskie | Region | 4,516 | 2.7 | 0.0 | 0.0 | GUS demography 2023 (urban/rural); voivodeship shares |
| Other developed | Region | 12,420 | −6.0 | 0.0 | 0.0 | GUS demography 2023 (urban/rural); voivodeship shares |
| Other less-dev. | Region | 15,352 | 4.4 | 0.0 | 0.0 | GUS demography 2023 (urban/rural); voivodeship shares |
| Married, spouse present (18+) | Marital | 14,380 | −1.6 | 2.2 | 2.2 | NSP 2021 / census 2021 (cens_21mh) |
| Cohabiting (18+) | Marital | 1,799 | −8.6 | 0.8 | 0.8 | NSP 2021 / census 2021 (cens_21mh) |
| Divorced (18+) | Marital | 2,132 | 33.8 | −1.1 | −1.1 | NSP 2021 / census 2021 (cens_21mh) |
| Widowed (18+) | Marital | 2,734 | 2.1 | 3.1 | 3.1 | NSP 2021 / census 2021 (cens_21mh) |
| Employee (UoP) | Employment | 13,600 | 0.4 | −2.3 | −2.3 | MF No 12-2025 (annual recipients) |
| Civil contract | Employment | 3,880 | −54.2 | 5.2 | 5.2 | MF No 12-2025 (annual recipients) |
| Kontrakt (art. 13 pkt 6-9) | Employment | 600 | 5.9 | −1.6 | −1.6 | MF No 12-2025 (annual recipients) |
| Farming income | Other | 1,800 | 7.4 | 0.2 | 0.2 | assumption (~1.2M farms × 1.5) |
| DG liniowy (PIT-36L) | Other | 557 | 0.9 | −2.4 | −2.4 | MF PIT-36L 2024 |
| DG ryczalt (PIT-28) | Other | 878 | 6.7 | −1.1 | −1.1 | MF PIT-28 2024 |
| DG skala (PIT-36) | Other | 765 | 20.7 | −2.5 | −2.5 | MF PIT-36 2024 (incl. side businesses) |
| Rental income (ryczalt) | Other | 841 | −9.6 | −0.4 | −0.4 | MF PIT-28 2024 (rental) |
| Newborns (age 0) | Other | 300 | −22.8 | −0.3 | −0.3 | GUS births 2024 (~300k incl. becikowe) |
| UoP annual < D1 (low/part-year) | Other | 4,882 | 0.4 | −1.0 | −1.0 | MF No 12-2025 percentiles |
| UoP annual > D9 (top decile) | Other | 966 | 0.5 | −0.7 | −0.7 | MF No 12-2025 percentiles |
| Earners under 26 (PIT-0 youth) | Other | 1,293 | 47.8 | 1.8 | 1.8 | MF PIT 2024 (PIT-0 youth claimants) |
| Lone-parent families with dependent children (families) | Other | 1,201 | −13.7 | −3.5 | −3.5 | NSP 2021 (families) |
| Member of multi-family household (NSP) | Other | 8,104 | −32.1 | 0.0 | 0.0 | Census 2021 (cens_21hhcs_r3) |
| Families with 2+ dependent children (families) | Other | 2,438 | 6.3 | −0.1 | −0.1 | NSP 2021 (families) |
| Families with 3+ dependent children (families) | Other | 523 | 26.1 | −0.8 | −0.8 | NSP 2021 (families) |
| Families with 4+ dependent children (families) | Other | 102 | 31.5 | 1.5 | 1.5 | NSP 2021 (families) |
The seed column shows how far the behavioural generator alone is from the published margins; it is the most informative column for judging the generator. Margins that the seed misses by more than ±25% are being repaired by large weight changes and should be revisited in the generator, because large corrections inflate weight variance and transfer the correction to correlated but uncalibrated characteristics.
5.2 Fiscal counts and one weight per household
The fiscal counts (employees, contract earners, business forms, rental, newborns, wage tails, earners under 26) and the census family counts are margins of the household rake. They are not hit exactly: the mean absolute deviation of the fiscal and family margins is 1.5% and the largest 5.2% (Table 5.1). Family counts: lone-parent families with dependent children -3.5%; families with 2+ dependent children -0.1%; families with 3+ dependent children -0.8%; families with 4+ dependent children +1.5%. The first edition closed the fiscal residuals with a person-level ratio pass. That gave members of one household different weights, so household statistics depended on which member’s weight was used. It is no longer run: the largest weight difference within a household is now 0.000000.
5.3 Income-total alignment
Income totals are imposed by scaling income values (not weights) of the corresponding groups (Table 5.2). For self-employment, revenue and costs are scaled jointly so that the cost ratio of every firm is preserved. Scale self-employment is aligned on net income (PIT-36); linear-tax self-employment (PIT-36L) and ryczałt on revenue; civil and art. 13 contracts on revenue, set so that their taxable income matches the MF total.
| Total | Scaled | Before (PLN m) | Target (PLN m) | Factor | Capped |
|---|---|---|---|---|---|
| DG scale: net income (PIT-36) | net | 53,650 | 63,851 | 1.190 | no |
| DG linear: revenue (PIT-36L) | gross | 767,473 | 1,203,984 | 1.569 | no |
| DG ryczałt: revenue (PIT-28) | gross | 73,247 | 73,500 | 1.003 | no |
| Rental: revenue (PIT-28) | gross | 7,432 | 8,500 | 1.144 | no |
| Civil contracts: revenue | gross | 84,444 | 45,770 | 0.542 | no |
| Art. 13 contracts: revenue | gross | 66,814 | 38,820 | 0.581 | no |
Linear-tax revenue is scaled by 1.569 to the MF revenue of PIT-36L filers. Their losses are then calibrated on the weighted sample: 19.2% of filers run a loss, the MF share of filers without tax due, and losses total 4,890 m PLN, the MF amount. Income and tax of linear filers are therefore no longer targets but outcomes compared with MF in Table 16.1. The first edition aligned their income, which made the tax a near-mechanical result.
Contract revenue is scaled by 0.542. Without it, taxable income from civil and art. 13 contracts was 74% above the MF total, which also overstated contract social contributions (Section 13.3).
5.4 Weight diagnostics
| State | Mean (thous. hh) | CV | Min/mean | P1/mean | P99/mean | Max/mean | Kish n_eff | Deff |
|---|---|---|---|---|---|---|---|---|
| Seed | 0.2507 | 0.000 | 1.000 | 1.000 | 1.00 | 1.00 | 50,000 | 1.00 |
| After IPF | 0.2505 | 0.787 | 0.057 | 0.203 | 4.19 | 11.55 | 30,873 | 1.62 |
| Final | 0.2505 | 0.787 | 0.057 | 0.203 | 4.19 | 11.55 | 30,873 | 1.62 |
The final weights have a coefficient of variation of 0.79, which corresponds to a Kish design effect of 1.62 (Kish 1965): the 50,000 households carry the information of about 30,873 equally-weighted households. For national aggregates this is ample; for small groups (e.g. linear-tax filers with 4+ children) the effective sample is a fraction of the raw count and results should be read with the bootstrap intervals of Section 16.3.