Skip to content

Add a direct test of conditional fit within each survey - #19

Draft
juaristi22 wants to merge 5 commits into
author-review-notesfrom
conditional-fit-test
Draft

juaristi22 wants to merge 5 commits into
author-review-notesfrom
conditional-fit-test

Conversation

@juaristi22

@juaristi22 juaristi22 commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #17. A second PR, #20, for the check on the estimator's weighted resample, stacks on this one.

Whether this goes in the paper is for Max to rule in #21, which lists the tests run since the 25 November review. This PR holds tests 1, 2, 5 and 7 of that list.

What this adds

  • A direct test of conditional fit within each survey. Address author review notes: harness as first application, plain-language pass, limitations #17 listed it as future work. Each receiver appears twice, once with its true target values and once with the imputed ones, with the same predictors and weights. A classifier tries to tell the two apart. An AUC of 0.5 means it cannot.
  • A dollar measure that is also conditional. The classifier counts households, so it barely moves when a method misplaces a few very large values. The new measure is the Wasserstein-1 distance between imputed and true values within groups of similar receivers (income bands by age bands). Each target's imputed total is reported beside it.
  • The reason for the constrained hot deck's lead on the classifier. A diagnostic variant of that hot deck allows each donor two uses where the method allows one, and a new option records how many receivers share a value with another receiver. The variant is kept out of the method registry.
  • Runs. imp conditional-fit refits every method on the sweep's splits and seeds. It uses 30 seeds on the three survey tasks and ten on the OpenML datasets.
  • Text. Three paragraphs in Section 3.4, a new Section 5.7 with Tables 9 and 10, Table 17 in the appendix, one paragraph in Section 5.5, a rewritten Section 6.2, one open question replaced in Section 6.5, and one paragraph in the conclusion.

What it shows

SCF 2022, SCF 2025 and CPS, 30 seeds:

  • Classifier. The constrained hot deck has the AUC closest to 0.5 on all three tasks: 0.526, 0.519 and 0.504, against 0.561, 0.564 and 0.534 for the full estimator.
  • Why it leads. Its limit on donor use is one in this test, because the test holds out one row for every four donors. So it gives no donor's record to two receivers. On SCF net worth, about 3% of receivers share a value with another receiver in the true values and under the constrained hot deck, against 30% under the nearest-neighbour hot deck and 39% under the estimator. With two uses allowed, the hot deck's AUC rises to 0.563, 0.562 and 0.550 in every seed: level with the estimator on the SCF and behind it on the CPS. The lead is not evidence of closer matches.
  • Dollars, SCF. The order reverses. The constrained hot deck's imputed net worth adds up to 1.97 and 1.32 times the survey's total, against 0.98 and 1.00 for the estimator. The estimator has the lowest within-group distance on net worth of any method on both waves.
  • Weighted random hot deck. On the SCF the estimator is ahead of it on both measures, in every seed on the classifier. On the CPS the hot deck is ahead on the classifier (0.525 against 0.534) and level in dollars.
  • CPS. The constrained hot deck is at least level with the estimator on every measure.
  • Ablations. Switching off chaining or the gates raises the estimator's AUC on all three tasks, in all 30 seeds on the CPS.
  • OpenML, ten seeds. The hot decks match on the predictors' original units there (the limitation added to Address author review notes: harness as first application, plain-language pass, limitations #17), so the two datasets where the estimator is ahead are not read as evidence for it.

Section 6.2 now opens with "No method is ahead on every measure". It says which measure favours which method on which survey, and that the classifier's order depends on the test's split.

What it does not change

  • No existing row of any table. The four population-view tables gain the constrained hot deck's row, and with it the bold in their coverage column moves to that row. imp replication leaves its files as they were.
  • The estimator and the baselines are as pinned.
  • The abstract. It does not mention the new test, and whether it should is for the authors.

Status of these results

Both measures were added after the 2025 replication had been scored. No rule was fixed for them in advance, and Sections 3.5 and 5.7 say so. The two waves are reported on the same footing.

The constrained hot deck on the SCF-to-CPS experiment

It was not run there before, for its cost: thirteen minutes and 6 GB per split. imp harness --constrained-max-cells now lets it run, and the four population-view tables have its row (ten seeds, both profiles, both waves).

  • Its limit there is six uses per donor, which forces nearly even use of the donors, the oversampled wealthy ones included.
  • Its imputed 99th percentile of net worth is 4.9 times the holdout's on the 2022 wave and 8.4 times on the 2025 wave.
  • Its classifier AUC is within 0.6 to 2.5 points of the estimator's, and its coverage is the highest of any method. The joint metrics do not show the error; the tail metrics do.
  • No other method's figures changed.

Checks

  • 193 tests run, 0 failed, 1 skipped. ruff check is clean.
  • A test confirms that each run's Wasserstein-1 distances equal the sweep's, cell for cell, on the seeds they share. So the test scores the draws behind the paper's tables.
  • imp tables adds the two-uses row only if its three control methods have identical rows in both run directories.
  • The PDF builds at 67 pages (58 before).
  • All data are public: SCF public extracts, CPS ASEC and OpenML.

🤖 Generated with Claude Code

The within-survey tables score one imputed variable at a time. This adds
a paired classifier test (true against imputed values on the same receiver
rows, given the predictors) and, beside it, two measures in dollars: the
Wasserstein-1 distance between imputed and true values within groups of
similar receivers, and each target's imputed total.

- `imp conditional-fit` refits every method on the sweep's splits and
  seeds and writes its own run directories. 30 seeds on the three survey
  tasks, ten on the OpenML datasets.
- `imp tables` writes three new tables from those runs.
- Section 3.4 defines the measures, Section 5.7 reports them, Section 6.2
  is rewritten around them, and one open question in Section 6.5 is
  replaced.

No existing table changes. Both measures were added after the 2025
replication was scored, and the text says so.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
juaristi22 and others added 4 commits November 27, 2026 16:22
Brings in the limitation on the hot decks' two defaults. The PDF is
rebuilt in the next commit.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The constrained hot deck has the best score on the paired classifier
test. This adds the evidence for why, and words the paper accordingly.

- A diagnostic variant of the constrained hot deck allows each donor two
  uses where the method allows one. It is kept out of the method
  registry and runs only when named. With two uses the hot deck's AUC
  rises on all three survey tasks in every seed, to the estimator's on
  the SCF and above it on the CPS.
- `imp conditional-fit --value-reuse` records how many receivers share a
  non-zero value with another receiver, for the imputed and the true
  values. On SCF net worth it is about 3% for the truth and for the
  constrained hot deck, 30% for the nearest-neighbour hot deck and 39%
  for the estimator.
- Section 5.7 gains a paragraph on the limit, and its OpenML and CPS
  passages say what the hot decks' defaults do there. Sections 6.2 and
  6.5 and the conclusion no longer read the lead as closer matching.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`imp harness --constrained-max-cells` raises the size limit under which
the constrained hot deck is skipped, for one run. The four added-arms
population-view runs are rerun in full with it. Every other method's
rows are unchanged, and the constrained hot deck now has rows where its
skip was recorded.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Brings in `imp harness --constrained-max-cells` and the four added-arms
population-view runs rerun with it. The constrained hot deck now has a
row in the four population-view tables.

- Its limit there is six uses per donor, which forces nearly even use of
  the donors. Its imputed net-worth q99 is 4.9 and 8.4 times the
  holdout's (2022 and 2025 waves), while its classifier AUC is within
  0.6 to 2.5 points of the estimator's and its coverage is the highest.
- Sections 3.2, 5.5, 6.2, 6.4 and 6.5 and the conclusion no longer say
  it was not run there.
- The option reuses `methods.constrained_cell_limit`.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.

1 participant