Skip to content

Place the weighted bootstrap in the literature on weighting by resampling - #10

Merged
juaristi22 merged 25 commits into
mainfrom
prior-art-weighted-resampling
Nov 24, 2026
Merged

juaristi22 merged 25 commits into
mainfrom
prior-art-weighted-resampling

Conversation

@juaristi22

Copy link
Copy Markdown
Collaborator

Optional improvement 3 of the list drawn up with #8: say where the estimator's weighted bootstrap sits in the survey literature. Text only.

Merge order

#6, then #9, then this. This branch sits on #9's head, so until #6 and #9 merge the diff shows their commits too. Draft until they are in. Use merge commits.

This PR's own two commits: compare against #9's head.

Why

The weighted bootstrap is the estimator's first design choice: before each forest is grown, donor rows are redrawn with probability proportional to weight. The background presented it without saying that undoing an unequal-probability design by resampling is an established device, and its last sentence claimed "weight-aware forest training" as part of the paper's gap. A referee who knows that literature would ask.

What changes

  • Section 2.3 cites four papers and says what each does:
    • Reiter, Raghunathan and Kinney (2006): imputation that ignores the design can be severely biased when the design features are related to the survey variables, and controlling for those features reduces the bias.
    • Hinkins, Oh and Scheuren (1997): inverse sampling, which draws subsamples with the structure of simple random samples.
    • Dong, Elliott and Raghunathan (2014): the weighted finite population Bayesian bootstrap, which generates synthetic populations with the unequal selection probabilities inverted.
    • Zhou, Elliott and Raghunathan (2016): that bootstrap as the first step of imputation, so that standard methods apply.
  • It then describes the weighted bootstrap as a simple relative of these methods: one resample per forest, with none of their finite-population machinery for inference.
  • The novelty sentence now says that weighting by resampling is not new, and claims only the combination with sign-regime gating and chaining in one forest estimator whose interface makes the weighted fit the default.
  • Section 3.1 gains one sentence pointing back to section 2.3.
  • The PDF is rebuilt.

Checks

  • Each reference was checked against its publisher: the three Survey Methodology papers against Statistics Canada's catalogue pages and the papers' own first pages, the Biometrics paper against Crossref.
  • All 44 bibliography entries are cited and every citation is defined.
  • The PDF builds with no undefined reference or citation.

🤖 Generated with Claude Code

MaxGhenis and others added 25 commits October 9, 2026 20:46
The Fed released the 2025 SCF on 2026-10-09. This fixes, before any method
is fit on it, which of the paper's SCF findings count as replicated and by
what rule: paired-seed sign rules for the within-SCF task, the sampling
floor's seed sd as the noise unit for the population view, a factor-of-two
band on stated effect sizes, and a Spearman rule for method rankings.

Also records what a schema-only look at the new files found: all 17 used
columns survive; race folds the Middle Eastern code into class 1; and the
Fed re-issued the 2022 extract in 2025 dollars at the same URL, so a
cold-cache load no longer reproduces the paper's inputs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ep and harness

The Fed replaced scfp2022s.zip on 2026-10-09 with a copy re-based to 2025
dollars, so a cold-cache load_scf(2022) no longer returned the paper's
inputs. The loader now accepts only registered files (SHA-256 -> wave and
dollar basis) and returns a stated basis, re-basing with the Fed's CPI-U-RS
factors when the cached file is on another one. On the file the paper used
the returned frames are bit-identical to before.

imp sweep and imp harness take --scf-year and --scf-dollar-year, record the
input file's hash and basis in manifest.json, and default non-2022 harness
runs to their own run directory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
experiments/replication.py encodes the rules of
docs/scf-2025-replication-criteria.md: paired-seed difference and tie rules,
the sampling floor's seed sd as the population-view noise unit, the
factor-of-two magnitude band, and the Spearman ranking rule. imp replication
applies them to the committed runs and writes the comparison document, its
CSVs, the appendix's verdict table, and a macro file for every number the
appendix cites. imp scf-checks checks weights, the balance-sheet identity,
and the Fed's Table 2 on both waves.

Tests pin the criteria file's hash, its findings and 2022 statuses, and the
rules' invariants (sign antisymmetry, tie symmetry, unit and seed-label
invariance, self-comparison) with Hypothesis; the loader tests run offline on
a synthetic registered extract; test_data.py adds the 2025 weight-total,
identity, and Table 2 checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Arm B (runs/*-2025): the three SCF experiments with the SCF 2025 donor, same
code, lockfile, seeds, and receiver files as the paper's 2022 runs.
Arm D (runs/*-2022-rerun): the 2022 experiments rerun in the same
environment; all 3,900 metric rows are identical to the committed runs.
Arm C (runs/*-2022-in-2025-dollars): the 2022 wave on the Fed's 2025-dollar
basis.
runs/scf-population-checks: weight totals, the balance-sheet identity, and
all-family net worth against the Fed's Table 2, both waves.
runs/scf-hotdeck-reuse: aggregate donor-reuse statistics for the hot-deck
matches of both profiles and waves; recomputed q99 ratios match the harness
runs to 1e-16.

All new runs used OMP_NUM_THREADS=1. No run was skipped or capped
differently from the paper's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Verdicts under the pre-registered rules (docs/scf-2025-replication-criteria.md):
of 8 primary findings, 6 replicated and 2 were inconclusive; of 19 secondary,
10 replicated, 2 replicated in direction with a smaller effect, 2 were
inconclusive, and 5 did not replicate.

Replicated: the weighting result (unweighted is 4.3 times worse on net-worth
W1 within the SCF, 6.1 in 2022; its imputed net-worth q99 is 1.8 times the
holdout's in both profiles), chaining binding only at scale (4.9 AUC points),
and the classifier's separation of the unconditional marginal draw.

Not replicated: hot deck's tail at scale (q99 ratio 2.85 against 0.75 in
2022; one reused donor above the holdout's q99 carries 1.4 to 2.7 percent of
receiver weight on 8 of 10 seeds), the candidate as lowest-AUC method at
scale, unchaining leaving the tail unchanged, and the 2022 tie between gated
and ungated forests on SCF debt zero share.

Also in this commit:
- judge() applies the criteria file's cap: a claim the 2022 runs do not
  themselves meet is at best inconclusive (W3c met its rule in 2025 only).
- imp hotdeck-reuse and experiments/donor_reuse.py: the aggregate
  donor-reuse diagnostic, with property tests.
- A units diagnostic: within the SCF, re-basing dollars leaves OLS and the
  marginal draw unchanged and moves forest-based W1 means by up to 7.3%.
- paper/sections/appendix_scf2025.tex: draft appendix; every number is a
  generated macro and a test rejects hand-typed ones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n W7

Review (GPT-6.1 Sol, ~/reviews/imputation-paper-scf2025/review-1.md):
- Donor reuse: the sufficient condition needs a one-receiver margin under
  the harness's interpolating quantile. Stated correctly in the appendix,
  the report, and the docstring; the margin is recorded per run and the test
  uses it. All nine inflated seeds still satisfy it.
- Loader round-trip property: exclude subnormal floats.
- Level rules (W3a, W5, W7, F3c) compare values, not names, so a tie at the
  extremum counts for the claimed method. No committed verdict changes.
- Appendix: dollar levels in the verdict tables are in each wave's own
  dollars; the sentence that said otherwise is corrected.
- New differential test: the Fed's re-issued 2022 file against our
  re-basing of the original (agree to 1e-9; a cold cache reproduces the
  paper's inputs).

Pinball weighting (imp pinball-weighting, runs/scf-pinball-weighting):
weighted_pinball_loss reads the imputed quantiles unweighted and scores them
against weighted truth. With the quantiles read under receiver weights the
marginal draw's net-worth loss is below the candidate's on 4 of 10 seeds in
both waves, not 10, so W7 (the marginal draw has the best pinball loss) is a
property of the metric. The appendix and the report say so; the paper's
metric and tables are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The mean-rank column ranked nine methods, including the microimpute_qrf
row that the tables hide as a duplicate of plain_qrf, so eight printed
rows carried ranks up to 8.83. Rank after dropping the hidden row and
regenerate openml.tex. No other table changes.

New mean ranks: unweighted 3.00, marginal draw 3.17, full estimator,
unchained and hot deck 3.50, forest baseline 4.50, quantile regression
7.00, OLS 7.83. The unconditional marginal draw is now second, not
best, so the results paragraph and the discussion say so. The caption
states that ranks are among the eight methods shown.

Adds tests/test_tables.py, which fails on the old ranking.

Part of #8.

Co-Authored-By: Claude <noreply@anthropic.com>
Each change brings a sentence into line with a committed run or table.
No number in any table changes.

- "+534 dividend W1" is 308.65 in the ablations table.
- The q99 passages said donation-based draws sit near 1 and called it
  an advantage of hot deck. Hot deck's net-worth q99 ratio is 0.76 and
  0.75; the draw near 1 is the unconditional marginal draw. The text
  now reports the three and says the cause is not isolated. "Donation
  preserves marginals and tails by construction" is dropped.
- "Closest to the floor": the unweighted ablation is closer in both
  profiles (0.731 and 0.754).
- "None of them hurts where it does not help": the unweighted ablation
  is ahead on SCF debt zero share (0.012 against 0.020) and on the
  OpenML mean rank.
- The marginal draw "ties or beats every method on marginal metrics":
  on SCF net-worth W1 the full estimator's mean is lower (135,871
  against 215,398). Now "at or near the top".
- The weighting effect is "larger than the gap to any competing
  method": OLS's gap is larger. Now "every competing method except
  OLS".
- The text and captions say what the runs used: 20,000 receiver
  households of 55,762 and 168,852, 20,000 of 108,044 CPS adults, and
  two OpenML datasets capped at 20,000 rows.
- The CPS zero shares were unweighted (41.7 and 85.2 percent) and
  "most adults" did not fit 41.7. Now the weighted shares, 41.7 and
  84.7.

Part of #8.

Co-Authored-By: Claude <noreply@anthropic.com>
Table 1 called the microimpute QRF row an "ungated/unchained forest"
that "differs from the full estimator only in gating and chaining".
At microimpute 1.15.1 the row is chained (each target conditions on the
targets already imputed), draws each value from a ten-level conditional
quantile grid at a randomly chosen index (the lowest and highest levels
25 and 21 percent of the time under the paper's level sampling), and
runs on a fixed internal seed. It is a baseline as shipped, not a
knockout.

- Table 1, its caption and the knockout paragraph say so. The row is
  labelled "QRF (microimpute)" in every generated table and is no
  longer indented as an ablation; the ablations table's third column is
  captioned as a comparison.
- The gating claims are reworded as comparisons with that baseline:
  the abstract's "0.6 against 4.4 for the same forest ungated", the 5.6
  AUC points credited to gating at scale, "gating carries the load" and
  the conclusion's sentence. The text now says no gates-off arm is run.
- Limitations: the forest baseline's seed is fixed (the text said its
  randomness was not seedable and added forest noise), and the 99-level
  grid applies to OLS and quantile regression only.
- Hot deck: Table 1 said its weights "inform matching". In py-statmatch
  unconstrained nnd_hotdeck picks the nearest donor; donor weights only
  standardize the matching variables. The SCF comparison is qualified.
- "Weighting is approximately free" on the CPS task now quotes its
  largest delta (+36 dividend W1, inside its seed spread).
- Registry, its test and PLAN.md: plain_qrf is a baseline, with the
  reason. Keys and run artifacts are unchanged; only labels move in the
  tables.

Part of #8.

Co-Authored-By: Claude <noreply@anthropic.com>
Pinball loss. The text said it scores "conditional distributional
calibration" and is minimized when each predicted quantile is the true
conditional quantile. The code reads the quantiles of each method's
pooled draw with np.quantile, every receiver row counted once, and
scores them against the weighted held-out values. The metric section
now says that: a marginal score, read without receiver weights. The
results paragraph no longer calls the marginal draw's pinball lead "not
an artifact" or the motivating observation for the harness; it explains
why that column favours a draw centred on the weighted population.

Coverage. Invariance to reweighting holds for the definition. The code
first reduces any sample over 2,048 points by a weight-proportional
resample, and the candidate always is, so the text adds that caveat and
the introduction and conclusion claim the property by definition only.

No code and no number changes. The weighted-read figures from
#6 can be cited once that PR is in.

Part of #8.

Co-Authored-By: Claude <noreply@anthropic.com>
Pin. The methods extra pinned 71b5a83, the head commit of
PolicyEngine/microcosm#290. That PR was squash-merged, so the commit is
not in main's history. Repoint to the squash, b538d8a4, whose
populace-fit and populace-frame trees are byte-identical. `uv lock`
changed the four lines that carry the commit and the lockfile revision
(3 to 5, written by uv 0.13). Checked in a scratch environment built
from the new lockfile: the full estimator and both ablations draw
identical values to the old pin in 24 of 24 cells (SCF wealth, CPS
components, abalone, minimal population view; seeds 0 and 1), and every
metric equals the committed one.

Availability statement.
- microimpute "1.1.2" is 1.15.1 (the lockfile's version; 1.1.2 is that
  release's stale __version__ string). PLAN.md says the same.
- States that the estimator installs on its own as a Git dependency and
  is not on PyPI; the README gains the one-line uv command for the
  pinned commit and for the current package, both tested.
- Lists every input with its access status: SCF 2022, the ASEC bundles
  for 2023, 2024 and 2025 (the text named 2025 only) and the OpenML
  datasets.
- Says the Federal Reserve replaced the 2022 SCF extract at its address
  on 9 October 2026 (re-based to 2025 dollars, per
  #6), so "read directly from their
  agencies of origin" no longer holds for it.

Left as a source comment: where the original SCF file is deposited, and
the ASEC 2023 and 2024 hashes. The hash-registered loader is in
#6.

Part of #8.

Co-Authored-By: Claude <noreply@anthropic.com>
Every experiment uses the gate's probabilities as fitted on the
training rows: the only behaviour at the evaluated version and still
the default. Later versions of the package add an opt-in out-of-fold
calibration because such a gate can be overconfident on a rare sign
class (PolicyEngine/microcosm#1391). Section 3.1 now says so, and says
the tasks here contain no rare sign class on which the methods differ,
so that behaviour is not evaluated. #7
would evaluate it.

Part of #8.

Co-Authored-By: Claude <noreply@anthropic.com>
- Chained imputation cited Raghunathan, Reiter and Rubin (2003), which
  is on disclosure limitation. Now Raghunathan, Lepkowski, Van Hoewyk
  and Solenberger (2001), Survey Methodology 27(1).
- dorazio2021statistical (Journal of Statistical Software 98(1)) does
  not exist: that issue is another article. py-statmatch now cites the
  R package it ports (D'Orazio, StatMatch 1.4.3, CRAN, with DOI), and
  the introduction cites D'Orazio, Di Zio and Scanu (2006) for the
  method.
- meinfelder2011simulation (CSDA 55(12)) has no match in Crossref.
  Removed; its sentence keeps D'Orazio, Di Zio and Scanu (2006).
- von Hippel: the 2007 working paper becomes the article, Sociological
  Methods & Research 42(1), 2013.
- quantile-forest: the documentation site becomes Johnson (2024),
  Journal of Open Source Software 9(93), 5976.
- Two uncited claims are cut: "reviews of the field note the absence of
  a standard benchmark", and "common practice" in the abstract.
- The eleven entries nothing cites are removed, and a techreport's
  publisher field becomes institution (BibTeX warned about it).

The registry's citation keys follow, and a test now checks that every
key the registry cites is defined in the .bib.

Part of #8.

Co-Authored-By: Claude <noreply@anthropic.com>
Built with `quarto render paper/index.qmd --to pdf` from the seven
commits before this one. 27 pages; no undefined references or
citations.

Part of #8.

Co-Authored-By: Claude <noreply@anthropic.com>
The results said weighting "matters little" on the CPS components task
because its largest delta is smaller than its spread across seeds, and
the discussion still called it "approximately free". The paired delta
is 36 on dividend W1, against 102 for the full estimator, and the
unweighted fit is worse on eight of the ten seeds; the other CPS
metrics are within seed noise. Both passages now say that.

The manuscript spells behavior, centered and favors the American way;
four words added in earlier commits did not.

Part of #8.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
CI has failed on this branch since 46b5210.
test_committed_report_and_tables_are_current regenerates
docs/scf-2025-replication/ on CI's Linux runner and compares it byte
for byte with the copy written on macOS. The CSVs there carry
full-precision floats, and a mean over seeds in headline_numbers.csv
comes out one digit apart in its last place (176625.49660906277 against
...06274). The suite passes on macOS.

The test now compares the five CSVs as tables: same columns and rows,
text, integer and boolean cells identical, floats equal to 1e-9.
comparison.md, the tables and the appendix inputs print rounded numbers
and are still compared byte for byte. The test also checks that the
regenerated and committed file sets are the same. A second test checks
the comparison itself: it passes last-place noise and fails a changed
number, a changed word and a dropped row.

No committed output and no generating code changes.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The merge of #2 brings its `imp tables`
labels, so the full estimator's row reads "microcosm-fit". The three
2025 tables were written before that and still read "populace-fit",
which fails test_committed_report_and_tables_are_current.

`imp replication` and `imp tables` rewrite one row label in each of the
three tables. No number moves, and nothing under
docs/scf-2025-replication/ changes: the report keeps the names the
frozen criteria file uses.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Brings in #6 as updated to sit on #2 (its regeneration test compares
the full-precision CSVs as tables, and its 2025 tables carry #2's
labels), so this branch is the stack #2, #6, fixes.

One conflict, in references.bib: #6 adds the two Federal Reserve 2025
entries next to barcelo2006imputation, which the fixes removed as
uncited. Resolved by keeping the removal and both additions. All 40
entries are cited and every citation is defined.

README.md, data.tex, pyproject.toml, uv.lock and cli/tables.py merged
without conflict. The lockfile keeps the repointed estimator pin and
gains #6's hypothesis.

The 2025 tables are regenerated in the next commit.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… there

With #6 merged in, `imp tables` writes its three 2025 tables with this
branch's row label for microimpute's forest, "QRF (microimpute)"
instead of "ungated/unchained forest". One row label changes in each
table and no number moves. Nothing under docs/scf-2025-replication/
changes: the report keeps the wording of the frozen criteria file.

Two places the rename in #2 could not reach because they did not exist
yet: the 2025 scale table's generated-by note and the appendix's two
mentions of the profile now say "production scale", as the body does.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Built with `quarto render paper/index.qmd --to pdf`. With the SCF 2025
appendix from #6 it is 36 pages; no
undefined reference or citation.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ling

The background said only that the model-based and design-based
traditions treat weights differently, and claimed the combination of
weight-aware forests, gating and chaining as the paper's gap. It did
not say that undoing an unequal-probability design by resampling is an
established device, which is what the estimator's weighted bootstrap
does.

Section 2.3 now cites it: Reiter, Raghunathan and Kinney (2006) on the
bias from ignoring the design in imputation; inverse sampling (Hinkins,
Oh and Scheuren, 1997); the weighted finite population Bayesian
bootstrap (Dong, Elliott and Raghunathan, 2014) and its use as the
first step of imputation (Zhou, Elliott and Raghunathan, 2016). It
describes the weighted bootstrap as a simple relative of these, one
resample per forest with none of their inferential machinery, and says
that weighting by resampling is not new. The novelty sentence now
claims the combination and the weighted-by-default interface only.
Section 3.1 points back to it.

Each reference was checked against the publisher: the three Survey
Methodology papers against Statistics Canada's own pages and PDFs, the
Biometrics paper against Crossref.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

@vahid-ahmadi vahid-ahmadi left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All four new references exist with the volume, issue and pages given, and each supports the sentence that cites it:

  • Reiter et al. 2006, pp. 143-149 per the article's first page;
  • Hinkins et al. 1997;
  • Dong et al. 2014, pp. 29-46;
  • Zhou et al. 2016, doi 10.1111/biom.12413.

The description of the weighted bootstrap matches populace-fit at b538d8a. _weighted_bootstrap draws an n-of-n, weight-proportional resample once per forest (per target and sign class), and the gate takes sample_weight directly.

One point:

  • The microimpute baseline uses the same device (paper/sections/background.tex:55-66, paper/sections/methodology.tex:88). microimpute 1.15.1's Imputer.fit resamples the training rows n-of-n with replacement in proportion to weight_col before fitting (microimpute/models/imputer.py:286-293). The adapter passes the design weights there (src/imputation_paper/methods.py:266). So the closest prior art for weighting by resampling is the paper's own forest baseline. The differences are that it draws one resample, at a fixed seed (42), shared by all chained targets, rather than one per forest, and that it has no gate. One sentence in section 2.3 or in the Table 1 caption would say so. That would also make clear that the full-estimator vs microimpute-forest contrast is not a weighting contrast. The novelty claim at background.tex:73-77 is unaffected, since it rests on the combination with gating.

Review drafted with AI assistance and checked against the code at 8c56d67.

juaristi22 added a commit that referenced this pull request Nov 16, 2026
…eights

Reviews of #9 and #10.

Section 3.2 relied on "the level sampling used for all baselines here"
without defining it. It now says that each microimpute model predicts a
99-level quantile grid and each receiver row takes one uniformly drawn
level, applied to every target of the row, and that the microimpute forest
re-seeds its generator identically for every target, so a row's chained
targets are read at the same quantile index. The limitations note what that
means for its four-target joint score.

The microimpute forest applies the design weights by resampling its
training rows once in proportion to weight. That makes it the closest
precedent for the weighted bootstrap, and Section 2.3 and the note to
Table 1 now say so, and that the contrast between the two forests is not a
weighting contrast.

The other point of the #9 review, the duplicate unchained row in the OpenML
ranks, was closed by the added-arms PR, which drops rows that equal another
on every dataset, and by the wording pass, which corrected the stale
"second of the eight".

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@juaristi22

Copy link
Copy Markdown
Collaborator Author

Thanks for the review. This is done in #14 (91db2b9).

  • Section 2.3 names the microimpute forest as the closest precedent for weighting by resampling: one resample at a fixed seed, shared across chained targets, with no gate.
  • It also says the contrast between the two forests is not a weighting contrast.
  • The note to Table 1 says the same.

Reply drafted with AI assistance. The fixes are at c251659, the head of #14.

@juaristi22
juaristi22 marked this pull request as ready for review November 24, 2026 22:56
@juaristi22
juaristi22 merged commit 15f2b67 into main Nov 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants