Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
f1e4827
Pre-register SCF 2025 replication criteria before any 2025 run
MaxGhenis Oct 10, 2026
18c1fe6
Pin SCF extract files by hash and dollar basis; add --scf-year to swe…
MaxGhenis Oct 10, 2026
4dac883
Score the SCF 2025 replication by the pre-registered rules
MaxGhenis Oct 10, 2026
e205e36
Runs: SCF 2025 replication, 2022 rerun, 2022 in 2025 dollars, and checks
MaxGhenis Oct 10, 2026
46b5210
Report the SCF 2025 replication: comparison document and appendix draft
MaxGhenis Oct 10, 2026
3f723ac
Address review; add the pinball-weighting diagnostic and its caveat o…
MaxGhenis Oct 10, 2026
c37696b
README: list the two diagnostic commands
MaxGhenis Oct 10, 2026
f9bf58d
Rank the OpenML table over the rows it prints
juaristi22 Nov 10, 2026
27f660a
Correct sentences the paper's own tables contradict
juaristi22 Nov 10, 2026
82954f5
Describe the microimpute forest and hot deck as they ran
juaristi22 Nov 10, 2026
8879296
Describe pinball loss and coverage as the code computes them
juaristi22 Nov 10, 2026
e78354a
Pin a commit on main; correct the version and availability statement
juaristi22 Nov 10, 2026
c03b122
Say which gate the experiments use and what they do not test
juaristi22 Nov 10, 2026
d215764
Correct the references
juaristi22 Nov 10, 2026
e286092
Rebuild manuscript PDF
juaristi22 Nov 10, 2026
5e3b3fb
State the CPS weighting effect with its size; align spelling
juaristi22 Nov 13, 2026
f570e72
Rebuild manuscript PDF
juaristi22 Nov 13, 2026
05fb953
Compare the report's full-precision CSVs as tables, not bytes
juaristi22 Nov 13, 2026
1081199
Merge the IJM revision (PolicyEngine/imputation-paper#2) into the SCF…
juaristi22 Nov 13, 2026
db2e28f
Regenerate the 2025 tables under the renamed labels
juaristi22 Nov 13, 2026
60db809
Merge the SCF 2025 replication (PolicyEngine/imputation-paper#6) into…
juaristi22 Nov 13, 2026
106561d
Regenerate the 2025 tables under the fixes' labels; finish the rename…
juaristi22 Nov 13, 2026
096a006
Rebuild manuscript PDF
juaristi22 Nov 13, 2026
35489d1
Place the weighted bootstrap in the literature on weighting by resamp…
juaristi22 Nov 13, 2026
8c56d67
Rebuild manuscript PDF
juaristi22 Nov 13, 2026
0e20819
Add a gates-off arm, derived net worth and hot decks that use the wei…
juaristi22 Nov 13, 2026
68a2259
Run the added arms on the within-survey tasks and the minimal populat…
juaristi22 Nov 13, 2026
3f2ea9d
Run the added arms at production scale and on the 2025 wave
juaristi22 Nov 14, 2026
c3080a8
Report the gates-off, derived-net-worth and weighted hot-deck results
juaristi22 Nov 14, 2026
4fdad92
Rebuild manuscript PDF
juaristi22 Nov 14, 2026
0ce5be2
Add a random hot deck as the control for the weighted one
juaristi22 Nov 14, 2026
9922ec6
Run the random hot deck control on every task and both waves
juaristi22 Nov 14, 2026
48ccda6
Report the random hot deck control
juaristi22 Nov 14, 2026
e61e170
Rebuild manuscript PDF
juaristi22 Nov 14, 2026
6309a48
Give the re-based diagnostic arm its own number macros
juaristi22 Nov 14, 2026
666ec79
Say what the 2025 wave shows where the body's claims do not carry over
juaristi22 Nov 14, 2026
30e0f6e
Rebuild manuscript PDF
juaristi22 Nov 14, 2026
a5f9ffa
Shape the generated tables for the journal's 10 pt float font
juaristi22 Nov 14, 2026
6d8b5c7
Format the manuscript to IJM's submission guidelines
juaristi22 Nov 14, 2026
5504351
Rebuild manuscript PDF
juaristi22 Nov 14, 2026
e1fe442
Set every float at 10 pt without scaling
juaristi22 Nov 14, 2026
9b854c3
Rebuild manuscript PDF
juaristi22 Nov 14, 2026
abcc960
Cut the keywords to IJM's four
juaristi22 Nov 14, 2026
f3b4e4e
Rebuild manuscript PDF
juaristi22 Nov 14, 2026
298fc79
Set typewriter text in an outline font
juaristi22 Nov 14, 2026
ff8194a
Stop printing the source comments above the references
juaristi22 Nov 14, 2026
14d9e91
Rebuild manuscript PDF
juaristi22 Nov 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 PolicyEngine

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
26 changes: 20 additions & 6 deletions PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,39 @@ joint — future work beyond this paper.
## Method surface

The registry in `src/imputation_paper/methods.py` is the single source of
truth. Committed surface (9 methods):
truth. Committed surface (16 methods):

| Key | Category | What it isolates |
| --- | --- | --- |
| `populace_fit` | candidate | The full estimator (weighted bootstrap + regime gates + chaining) |
| `populace_fit_unweighted` | ablation | `weights="none"`: the weighted-bootstrap contribution |
| `populace_fit_unchained` | ablation | Targets fit independently: the chaining contribution |
| `plain_qrf` | ablation | Single ungated, unchained forest (microimpute QRF): the gating contribution |
| `microimpute_qrf` | baseline | Standard QRF imputation |
| `populace_fit_ungated` | ablation | Gates off: every target fitted through the estimator's own single-sign path. The gating contribution |
| `populace_fit_ungated_unchained` | ablation | Gates and chaining off: the fourth cell of the gated-by-chained design |
| `populace_fit_derived` | variant | Three balance-sheet components imputed, net worth set by the identity. Production-scale profile only |
| `populace_fit_unchained_derived` | variant | As above with the components fit independently: what chaining adds beyond the identity |
| `plain_qrf` | baseline | Same estimator as `microimpute_qrf`, under the key the committed runs also carry. First planned as the gates-off, chaining-off ablation; it is not one, because microimpute's QRF chains its targets and draws through its own sampler |
| `microimpute_qrf` | baseline | Standard QRF imputation (microimpute, as shipped) |
| `microimpute_ols` | baseline | OLS with normal residual draws |
| `microimpute_quantreg` | baseline | Linear quantile regression (per-quantile fits) |
| `statmatch_hotdeck` | baseline | Classical nearest-neighbour-distance hot deck (py-statmatch) |
| `statmatch_rand_hotdeck_unweighted` | baseline | Random hot deck among the nearest donors, each equally likely. The control for the weighted draw below |
| `statmatch_rand_hotdeck` | baseline | Random hot deck among the nearest donors, drawn in proportion to donor weight (StatMatch's RANDwNND) |
| `statmatch_constrained_hotdeck` | baseline | Nearest-neighbour hot deck with a cap on donor use. Within-survey tasks only: too large an assignment problem on the population view |
| `weighted_marginal` | harness | Dependency-free lower bound; CI only |

Released microimpute (1.1.2) carries no Matching model (it exists only behind
an R dependency in the dev tree), so py-statmatch's NND hot deck is *the*
matching baseline. Adding or removing a method is a deliberate change to this
Released microimpute (1.15.1; its `__version__` string reads 1.1.2) carries no Matching model (it exists only behind
an R dependency in the dev tree), so the matching baselines are py-statmatch's
hot decks. Adding or removing a method is a deliberate change to this
table, not drift.

Seven of these were added after the first sweeps: the two gates-off
ablations, the two net-worth-derived variants, and the random, weighted
random and constrained hot decks. Their results live in `runs/<name>-added-arms/`, beside the
committed runs and never inside them. Each added-arms run re-runs
`populace_fit`, `weighted_marginal` and `statmatch_hotdeck`, and `imp tables`
refuses to write a table unless those rows equal the committed run's.

## Tasks

1. **`scf_wealth`** — within-SCF imputation of `debt` (zero-inflated,
Expand Down
97 changes: 95 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ quantile-regression forest in
[`microcosm-fit`](https://github.com/PolicyEngine/microcosm/tree/main/packages/microcosm-fit),
benchmarked against standard survey-imputation methods (plain QRF, OLS,
quantile regression, hot-deck statistical matching) with ablations attributing
the gains to each design choice. (Microcosm was first released under the name
the gains to weighting and chaining. (Microcosm was first released under the name
Populace; the reported sweeps pin a pre-rename commit, so the experiment code
and its pinned dependencies keep the legacy `populace` spellings.)

Expand All @@ -25,13 +25,102 @@ uv run imp figures runs/toy-sweep # aggregates to summary.csv / summary.tex
quarto render paper/index.qmd # builds the manuscript
```

The manuscript follows the International Journal of Microsimulation's
submission format: APA references (`apacite`), float labels above and notes
below, float text in a 10 pt sans serif, and wide floats on landscape pages
(`pdflscape`, `afterpage`, `longtable`, `caption`). `paper/ijm.sty` and
`paper/ijmarticle.cls` hold the layout. A TeX distribution without those
packages needs them installed first; Quarto's TinyTeX fetches missing
packages on the first build.

### SCF 2025 replication

The paper's SCF experiments run on the 2022 wave. The 2025 wave (released
2026-10-09) is a replication on data no method was tuned on; the rules were
committed first, in `docs/scf-2025-replication-criteria.md`.

```bash
uv sync --extra methods
export OMP_NUM_THREADS=1 # one OpenMP thread per run; see note below
uv run imp sweep --task scf_wealth --scf-year 2025 --out runs/scf-wealth-2025
uv run imp harness --profile minimal --scf-year 2025 # runs/scf-to-cps-harness-2025
uv run imp harness --profile populace-scale --scf-year 2025 # runs/scf-to-cps-harness-scale-2025
uv run imp scf-checks # weights, balance-sheet identity, Fed Table 2, both waves
uv run imp hotdeck-reuse # aggregate donor reuse behind hot deck's 2025 tail
uv run imp pinball-weighting # pinball loss as coded vs with weighted imputed quantiles
uv run imp replication # docs/scf-2025-replication/comparison.md + appendix inputs
uv run imp tables # also writes the *_2025.tex tables
```

Diagnostic arms: `--scf-year 2022` into `*-2022-rerun` (does today's
environment reproduce the committed runs?) and `--scf-year 2022
--scf-dollar-year 2025` into `*-2022-in-2025-dollars` (the change of dollar
basis alone). The Fed replaced `scfp2022s.zip` on 2026-10-09 with a copy in
2025 dollars; the loader identifies each extract by SHA-256 and returns the
survey year's dollars by default, so the paper's 2022 inputs are unchanged
whichever copy is cached. With the default OpenMP thread count (one per
core), several runs side by side oversubscribe the CPU; on a loaded machine
cells ran many times slower. With one thread per run the 2022
rerun reproduces the committed runs (see the comparison document's
diagnostics).

The real method surface installs with the `methods` extra
(`uv sync --extra methods`), which pulls populace-fit/populace-frame (git,
pinned to a pre-rename commit of the microcosm repo), microimpute (PyPI), and
py-statmatch (git). CI deliberately runs without it:
the registry imports methods lazily, and sweeps record unavailable methods in
`skipped.csv` rather than failing or silently dropping them.

### Arms added after the first sweeps

Seven methods joined the surface after the first sweeps were committed: the
gates-off ablations, the net-worth-derived variants, and three hot decks. Their
runs go into `runs/<name>-added-arms/`, beside the committed run and never
into it:

```bash
export OMP_NUM_THREADS=1
ARMS=(populace_fit weighted_marginal statmatch_hotdeck populace_fit_ungated populace_fit_ungated_unchained populace_fit_derived populace_fit_unchained_derived statmatch_rand_hotdeck statmatch_constrained_hotdeck statmatch_rand_hotdeck_unweighted)
uv run imp sweep --task scf_wealth --methods "${ARMS[@]}" --out runs/scf-wealth-added-arms
uv run imp harness --profile populace-scale --methods "${ARMS[@]}" --out runs/scf-to-cps-harness-scale-added-arms
uv run imp tables
```

The first three keys are controls: methods the first sweep also ran. `imp
tables` reads the two directories together and refuses to write a table
unless the controls' rows are identical in both, so the added arms appear
only when they saw the same data, splits, and environment. The same holds for
the other tasks and for the 2025 wave (`--scf-year 2025`, into
`runs/<name>-2025-added-arms`). An arm that does not apply to a task is
recorded in that run's `skipped.csv`: the net-worth-derived variants outside
the production-scale profile, and the constrained hot deck on the population
view, where its assignment problem is too large.

## Installing the estimator on its own

The estimator is one package in the
[Microcosm repository](https://github.com/PolicyEngine/microcosm) and installs
without the rest of the stack. It is not on PyPI, and the PyPI project named
`microcosm` is unrelated software, so install it as a Git dependency. With uv
one requirement is enough: uv resolves the sibling packages it needs from the
same commit.

The version the paper's runs used, when the package was named `populace-fit`:

```bash
uv pip install "populace-fit @ git+https://github.com/PolicyEngine/microcosm.git@b538d8a4ecac9f0bad33c4f8d27acc453e280624#subdirectory=packages/populace-fit"
```

The current package, `microcosm-fit`, at a commit of your choice:

```bash
uv pip install "microcosm-fit @ git+https://github.com/PolicyEngine/microcosm.git@<commit>#subdirectory=packages/microcosm-fit"
```

pip does not read uv's workspace sources, so with pip pass one such URL for
each package: `populace-fit` and `populace-frame` at the pinned commit, or
`microcosm-fit`, `microcosm-frame` and `microcosm-graph` at a current one.

## Layout

- `PLAN.md` — the experiment plan: tasks × methods × ablations × metrics, the
Expand All @@ -42,7 +131,7 @@ the registry imports methods lazily, and sweeps record unavailable methods in
donor/receiver splits, the condition runner.
- `src/imputation_paper/cli/` — `imp demo` / `imp sweep` / `imp figures`.
- `paper/` — Quarto + LaTeX manuscript (IJM style), sections under
`paper/sections/`.
`paper/sections/`, generated tables under `paper/tables/`.
- `runs/` — sweep artifacts (`metrics_long.csv`, `skipped.csv`, summaries);
large data artifacts stay out of git.

Expand All @@ -53,3 +142,7 @@ the registry imports methods lazily, and sweeps record unavailable methods in
working directories.
- Every number in the manuscript regenerates from a committed run config;
results tables are generated (`imp figures`), never hand-edited.

## License

Code in this repository is released under the [MIT License](LICENSE). Original text and figures are released under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) with attribution to PolicyEngine. Third-party data and materials keep their own terms.
Loading
Loading