Commit 420deb4
Document IPF's two-entity-level constraint as a hard limit
Replaces the deferred-future framing ("`tax_unit_count` and `spm_unit_count`
remain outside the core household/person IPF path *in this pass*") with the
methodological reason: `surveysd::ipf` supports exactly two entity levels
natively (`conP` for row-level / person-style constraints, `conH` for
constraints aggregated by `hid`), and there is no generalised mechanism
for additional counted entities such as `tax_unit` or `spm_unit`.
Producing a single weight vector that simultaneously satisfies targets at
three or more entity levels is not possible with classical IPF. Running
IPF separately per scope and aggregating would give it more degrees of
freedom than L0 / GREG (each pass solves a smaller subproblem with its
own freedom) and would not be a like-for-like comparison. The benchmark
therefore restricts IPF to `person_count` and `household_count` —
together or alone — and drops other count families at the count check.
Those targets remain in the shared sparse system that L0 and GREG fit,
so the cross-method comparison on the IPF-feasible subset stays
apples-to-apples via `--score-on ipf_retained_authored`.
Updated the README's methodology section and the IPF inputs subsection
to articulate the constraint, and tightened the `_target_scope` error
message in `ipf_conversion.py` to match.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent eae0ee7 commit 420deb4
2 files changed
Lines changed: 33 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
39 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
40 | 54 | | |
41 | 55 | | |
42 | 56 | | |
| |||
122 | 136 | | |
123 | 137 | | |
124 | 138 | | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
130 | 148 | | |
131 | 149 | | |
132 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
360 | 363 | | |
361 | 364 | | |
362 | 365 | | |
| |||
0 commit comments