Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,28 @@ uv run imp conditional-fit --task cps_components --seeds 30 --value-reuse --cons
uv run imp tables
```

### What the one-off weighted resample costs

One diagnostic variant of the estimator samples by weight inside each tree,
in place of one weighted resample per forest. It is kept out of the method
registry, so no sweep or table includes it unless it is named. Its runs sit
beside the conditional-fit runs, with the estimator rerun as a control, and a
second command holds the donors fixed and changes only the estimator's seed:

```bash
export OMP_NUM_THREADS=1
ARMS=(populace_fit populace_fit_per_tree)
uv run imp conditional-fit --task scf_wealth --seeds 30 --methods "${ARMS[@]}" --out runs/conditional-fit-scf-wealth-per-tree
uv run imp conditional-fit --task scf_wealth --scf-year 2025 --seeds 30 --methods "${ARMS[@]}" --out runs/conditional-fit-scf-wealth-2025-per-tree
uv run imp conditional-fit --task cps_components --seeds 30 --methods "${ARMS[@]}" --out runs/conditional-fit-cps-components-per-tree
uv run imp seed-stability --scf-year 2022 # runs/seed-stability
uv run imp seed-stability --scf-year 2025 # runs/seed-stability-2025
uv run imp tables
```

`imp tables` writes the variant's table only if the control's rows are
identical in the two run directories.

### Arms added after the first sweeps

Seven methods joined the surface after the first sweeps were committed: the
Expand Down
Binary file modified paper/main.pdf
Binary file not shown.
6 changes: 6 additions & 0 deletions paper/sections/conclusion.tex
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ \section{Conclusion}
On the population view, where its limit is six uses per donor, its 99th
percentile of net worth is 4.9 to 8.4 times the holdout's.

The estimator's weighted resample is drawn once per forest, and that has a
cost of its own. With fixed donors, the imputed 99th percentile of net worth
lay more than 25 percent from its typical value in 11 of 120 fits. It did so
in none when the weights were sampled inside each tree, a variant that is
not the estimator evaluated here.

Marginal metrics rank an unconditional marginal draw first on \scf{} pinball
loss as coded and tied for second of ten methods on the OpenML suite, while
the classifier separates that draw from the holdout at an AUC of 0.968,
Expand Down
22 changes: 21 additions & 1 deletion paper/sections/discussion.tex
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ \subsection{What the ablations show}
on the population view, where it understates the 99th percentile and the
unweighted fit overstates it.

How the weights are applied matters as well. The estimator resamples its
donor rows once per forest. Sampling by weight inside each tree instead
keeps the weighted totals, lowers the paired classifier AUC towards the
unweighted ablation's, and stops the estimator's seed from moving the upper
tail when the donors are fixed (Section~\ref{sec:results-resample}). That
variant is a diagnostic and not the estimator evaluated here.

\paragraph{Gating.} Within the estimator, the gates are what keep the share
of zeros right. With its gates off, the estimator misses the dividend zero
share by 7.2 percentage points instead of 0.6 (4.3 with chaining off as
Expand Down Expand Up @@ -238,6 +245,17 @@ \subsection{Limitations}
\paragraph{Gates on common sign classes only.} The gates are tested on
targets whose sign classes are all common, not on a rare class.

\paragraph{One resample per forest.} The estimator draws its weighted
resample once for each forest. On the \scf{} that leaves out about half of
the distinct donor rows and most of the rows at the top of the wealth
distribution (Section~\ref{sec:results-resample}). Two costs follow. The
paired classifier AUC is 0.012 to 0.015 higher than when the weights are
sampled inside each tree. And with fixed donors, the imputed 99th percentile
of net worth depends on the estimator's seed: it lay more than 25 percent
from its typical value in 11 of 120 fits. The results of this paper are
means over seeds and splits, so they do not show that risk. A single
production file carries it.

\paragraph{Dollar basis.} The population view does not put the two surveys'
incomes on a common dollar basis: the \scf{}'s are in survey-year dollars
and the ASEC's in each income year's. Re-basing the 2022 donor to 2025
Expand Down Expand Up @@ -285,7 +303,9 @@ \subsection{Open questions and future work}

\paragraph{Results we have not explained.} Six results are reported without
an explanation: the unweighted ablation's lower classifier AUC in all four
combinations of profile and wave; the \microimpute{} forest's q99 ratio,
combinations of profile and wave on the population view, which
Section~\ref{sec:results-resample} accounts for within a survey and which we
did not rerun on that view; the \microimpute{} forest's q99 ratio,
which is nearer 1 than the full estimator's; the shortfall at the 99th
percentile that the full estimator shares with two hot decks; the one seed
in each wave with a much higher AUC at production scale; the interaction of
Expand Down
27 changes: 24 additions & 3 deletions paper/sections/methodology.tex
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,18 @@ \subsection{The estimator}
rows, and the forest predicts for a new row from the target values of the
training rows that share its leaves. Passing per-record weights to the
forest when it is fitted can change where the trees
split, but each stored training row still counts once when a value is read
out, so the predicted distribution is not weighted. The estimator therefore
split, but in the version of scikit-learn used here (1.8) each stored
training row still counts once when a value is read out, so the predicted
distribution is not weighted. The estimator therefore
puts the weights into the data. Before each forest is grown, training rows
are resampled with replacement with probability proportional to weight, so a
household that stands for many others appears many times in the leaves.
Draws from the fitted forest then follow the weighted conditional
distribution. Resampling to undo an
distribution. The resample is drawn once for each forest. Every tree of the
forest then draws its own bootstrap sample from the resampled rows with
equal probabilities, so a donor row that the resample leaves out is read by
no tree (Section~\ref{sec:results-resample} measures what that costs).
Resampling to undo an
unequal-probability design is an established device
\citep{hinkins1997inverse, dong2014nonparametric}; Section~\ref{sec:background-weights}
places this one in that literature.
Expand Down Expand Up @@ -149,6 +154,16 @@ \subsection{Ablations and baselines}
Switching off gates and chaining together completes a two-by-two design,
which shows where the two interact.

One further variant is a diagnostic and not an ablation. It leaves out the
one-off resample, and each tree draws its bootstrap sample from all donor
rows with probability proportional to weight. Gates, chaining and the draw
are unchanged, and every gate and forest keeps the seed it has in the full
estimator. This is how scikit-learn samples from version 1.9 when a forest
is fitted with weights \citep{pedregosa2011scikit}, and we reproduce it
under the pinned version. The variant is not the estimator the package
ships. It is used only in Section~\ref{sec:results-resample}, and it is not
listed in Table~\ref{tab:methods}.

Where the targets satisfy an accounting identity, a practitioner would impute
all but one of them and compute the last. The net-worth-derived variants do
so in the production-scale profile: they impute the three balance-sheet
Expand Down Expand Up @@ -403,3 +418,9 @@ \subsection{Protocol}
splits with the same seeds, so they score the same draws as the other
within-survey tables. On the three survey tasks they use 30 seeds, the ten
above and twenty more. On the OpenML datasets they use the ten.

One experiment of Section~\ref{sec:results-resample} changes the estimator's
seed alone. It holds a donor split of the population view's minimal profile
fixed, imputes onto the same 20,000 \cps{} households, and refits the
estimator with twenty seeds. It does so for three donor splits in each
wave.
96 changes: 95 additions & 1 deletion paper/sections/results.tex
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,9 @@ \subsection{The SCF\texorpdfstring{$\to$}{->}CPS population view}
and 2.2 on the 2025 wave. The last of these is 1.1 floor standard deviations
and leaves that tie inconclusive. A lower AUC means the classifier finds the
unweighted file harder to tell from the holdout, and we have not explained
why it does.
why it does on this view. Within a survey,
Section~\ref{sec:results-resample} traces the same pattern to the
estimator's one-off resample.

Fitting the \scf{} unweighted learns the conditionals of a sample in which
wealthy households are over-represented, and none of the three joint metrics
Expand Down Expand Up @@ -633,3 +635,95 @@ \subsection{Conditional fit within each survey}
other three the weights are uniform, so the constrained hot deck's lead
cannot come from the weights. Its limit there is one use per donor, as on
the survey tasks.

\subsection{What the one-off weighted resample costs}
\label{sec:results-resample}

The full estimator applies the weights by resampling its donor rows once for
each forest (Section~\ref{sec:estimator}). A row with a low weight is often
left out of that resample, and a row left out is read by no tree. On the
\scf{} donor splits the resample is expected to keep 51 percent of the
distinct donor rows, against 63 percent under equal weights. Of the rows
above the weighted 99th percentile of net worth, which the \scf{} oversamples
and gives low weights, it is expected to keep 7 percent.

This subsection measures what that costs. It compares the full estimator
with the diagnostic variant of Section~\ref{sec:ablations}, which leaves the
resample out and samples by weight inside each tree. The variant is not the
estimator the package ships. Like Section~\ref{sec:results-conditional},
these runs were made after the 2025 replication had been scored.
Table~\ref{tab:resample} gives the three survey tasks on the 30 seeds of
that section.

\landscapefloat{table}{The estimator with the weights sampled in each tree}{tab:resample}{%
{\tablefont Panel A: \scf{}, 2022 wave}\\[2pt]
\generatedtable[2pt]{resample_scf_wealth}\\[8pt]
{\tablefont Panel B: \scf{}, 2025 wave}\\[2pt]
\generatedtable[2pt]{resample_scf_wealth_2025}\\[8pt]
{\tablefont Panel C: \cps{}}\\[2pt]
\generatedtable[2pt]{resample_cps_components}}{%
Notes: Each panel repeats three rows of Tables~\ref{tab:conditional-scf}, \ref{tab:conditional-scf-2025} and~\ref{tab:conditional-cps} and adds the diagnostic variant, in which each tree samples the donor rows by weight and there is no one-off resample. The constrained hot deck is shown for scale. Columns are defined as in Table~\ref{tab:conditional-scf}. Distances are in thousands of each wave's dollars in Panels A and B and in dollars in Panel C. Cells are means over 30 paired seeds, with the standard deviation across seeds in parentheses. Bold marks, among the four rows of a panel, the AUC closest to 0.5 and the lowest distance; the totals are not ranked. Source: authors' calculations from the 2022 and 2025 Surveys of Consumer Finances and the 2025 \cps{} ASEC.}

\paragraph{The resample accounts for most of the unweighted ablation's lower
AUC.} With the weights sampled in each tree, the paired classifier AUC falls
from 0.561 to 0.546 on the 2022 wave, from 0.564 to 0.552 on the 2025 wave,
and from 0.534 to 0.522 on the \cps{}. The fall holds in 21, 23 and 28 of the
30 seeds. It is half of one standard deviation of the null AUC on the two
\scf{} waves and 1.2 standard deviations on the \cps{}.

The unweighted ablation scores 0.546, 0.542 and 0.521. The variant equals it
on the 2022 wave and on the \cps{}, and covers about half of the distance to
it on the 2025 wave. The unweighted ablation has no resample and reads every
donor row. So its lower AUC, here and in
Section~\ref{sec:results-conditional}, comes mostly from the rows the
resample leaves out, and not from fitting without the weights.

The variant does not change the order of the methods on this test. The
constrained hot deck's AUC stays the lowest (0.526, 0.519 and 0.504). With
two uses allowed per donor (Section~\ref{sec:results-conditional}) the hot
deck scores 0.563, 0.562 and 0.550, against the variant's 0.546, 0.552 and
0.522.

\paragraph{The dollar measures change little, and not in one direction.} On
the 2022 wave the variant's net-worth total is 1.04 times the survey's,
against 0.98 for the full estimator, and its within-group distance on net
worth is 11 percent higher. Each difference is about two standard errors of
the paired difference. On the 2025 wave the variant's total is 0.98 against
1.00, and its distance is 4 percent lower. On the \cps{} its within-group
distances are 5 and 8 percent lower on interest and dividends (2.7 and 1.9
standard errors).

The variant keeps what the weights are there for. Its net-worth total stays
within 4 percent of the survey's on both waves, where the unweighted
ablation's is 2.14 and 1.57 times the survey's.

\paragraph{With the donors fixed, the upper tail depends on the estimator's
seed.} In every experiment above, a seed changes the donors, the receivers
and the estimator's draws together. A production file is built once, from
fixed donors onto many receivers, with one seed. To reproduce that case we
held a donor split of the population view's minimal profile fixed, imputed
onto the same 20,000 \cps{} households, and changed only the estimator's
seed (Section~\ref{sec:protocol}).

As shipped, the imputed 99th percentile of net worth lay more than 25
percent from its split's median in 4 of the 60 fits on the 2022 wave and in
7 of the 60 on the 2025 wave. The largest value on the 2025 wave was more
than 2.5 times the donors' 99th percentile. With the weights sampled in each
tree, no fit of the 120 lay that far from its split's median. The standard
deviation of that percentile across estimator seeds, as a ratio to the
donors' and pooled over the three splits, fell from 0.089 to 0.042 on the
2022 wave and from 0.414 to 0.030 on the 2025 wave.

As shipped, most of that spread comes from the fit and not from the draw.
Drawing twenty times from one fitted estimator per split gave a standard
deviation of 0.039 on the 2022 wave and 0.013 on the 2025 wave. For the
variant, redrawing from one fit gave the same spread as refitting (0.043
and 0.026).

The typical value does not change. Across the six donor splits, the median
99th percentile over estimator seeds was 0.59 to 0.67 of the donors' as
shipped and 0.61 to 0.69 with the variant. The resample therefore adds a
spread to the upper tail of a single imputed file, and it does not move
where that tail sits on average. The shortfall of the imputed 99th
percentile on this view (Section~\ref{sec:results-harness}) is not an effect
of the resample.
11 changes: 11 additions & 0 deletions paper/tables/resample_cps_components.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
% Generated by `imp tables` -- do not edit by hand. The estimator with weights sampled in each tree (conditional-fit-cps-components and its-per-tree directory), mean (sd) over 30 paired seeds.
\begin{tabular}{lrrrrr}
\hline
Method & Classifier AUC & Interest $W_1$ in groups & Interest total & Dividends $W_1$ in groups & Dividends total \\
\hline
microcosm-fit & 0.534 (0.009) & 994.10 (106.90) & 1.02 (0.073) & 430.42 (89.62) & 1.04 (0.165) \\
\quad -- unweighted & 0.521 (0.011) & \textbf{932.05} (103.36) & 0.979 (0.064) & 418.13 (86.35) & 1.03 (0.175) \\
\quad -- weights sampled in each tree & 0.522 (0.010) & 940.73 (114.00) & 1.01 (0.068) & \textbf{395.32} (77.23) & 1.00 (0.119) \\
Constrained hot deck & \textbf{0.504} (0.009) & 949.89 (129.99) & 0.994 (0.053) & 396.95 (89.26) & 1.06 (0.125) \\
\hline
\end{tabular}
11 changes: 11 additions & 0 deletions paper/tables/resample_scf_wealth.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
% Generated by `imp tables` -- do not edit by hand. The estimator with weights sampled in each tree (conditional-fit-scf-wealth and its-per-tree directory), mean (sd) over 30 paired seeds.
\begin{tabular}{lrrrrr}
\hline
Method & Classifier AUC & Net worth $W_1$ in groups & Net worth total & Debt $W_1$ in groups & Debt total \\
\hline
microcosm-fit & 0.561 (0.026) & \textbf{431.46} (141.60) & 0.981 (0.126) & 42.38 (7.87) & 1.03 (0.067) \\
\quad -- unweighted & 0.546 (0.027) & 1,328 (852.29) & 2.14 (0.877) & 59.78 (14.29) & 1.22 (0.154) \\
\quad -- weights sampled in each tree & 0.546 (0.018) & 477.90 (186.78) & 1.04 (0.170) & \textbf{40.94} (7.65) & 1.04 (0.074) \\
Constrained hot deck & \textbf{0.526} (0.025) & 1,242 (700.28) & 1.97 (0.706) & 50.47 (12.41) & 1.07 (0.117) \\
\hline
\end{tabular}
11 changes: 11 additions & 0 deletions paper/tables/resample_scf_wealth_2025.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
% Generated by `imp tables` -- do not edit by hand. The estimator with weights sampled in each tree (conditional-fit-scf-wealth-2025 and its-per-tree directory), mean (sd) over 30 paired seeds.
\begin{tabular}{lrrrrr}
\hline
Method & Classifier AUC & Net worth $W_1$ in groups & Net worth total & Debt $W_1$ in groups & Debt total \\
\hline
microcosm-fit & 0.564 (0.024) & 404.69 (87.43) & 1.00 (0.124) & 44.27 (7.14) & 1.03 (0.074) \\
\quad -- unweighted & 0.542 (0.025) & 825.58 (276.64) & 1.57 (0.265) & 52.31 (10.68) & 1.09 (0.087) \\
\quad -- weights sampled in each tree & 0.552 (0.022) & \textbf{386.95} (60.15) & 0.984 (0.077) & \textbf{42.59} (5.66) & 1.02 (0.065) \\
Constrained hot deck & \textbf{0.519} (0.022) & 642.66 (224.10) & 1.32 (0.184) & 46.54 (4.96) & 0.958 (0.061) \\
\hline
\end{tabular}
82 changes: 82 additions & 0 deletions runs/conditional-fit-cps-components-per-tree/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"task": "cps_components",
"rows_used": 20000,
"rows_available": 108044,
"row_cap_applied": true,
"max_rows": 20000,
"seeds": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29
],
"methods_requested": [
"populace_fit",
"populace_fit_per_tree"
],
"predictors": [
"age",
"is_female",
"employment_income"
],
"targets": [
"interest_income",
"dividend_income"
],
"weight_column": "person_weight",
"test": {
"statistic": "weighted out-of-fold AUC of a classifier telling the receivers' true target values from the imputed ones, on predictors and targets together",
"classifier": "sklearn HistGradientBoostingClassifier at its defaults",
"folds": 5,
"folds_over": "receiver rows (both copies of a row share a fold)",
"null": "the same test with the labels of a random half of the receiver rows swapped"
},
"dollar_measures": {
"within_group_wasserstein1": "weighted Wasserstein-1 distance between imputed and true values inside each group of receivers, averaged by group weight",
"groups": {
"income_column": "employment_income",
"income_cuts": [
36000.0,
74000.0
],
"zero_band": true,
"age_column": "age",
"age_cuts": [
40.0,
65.0
],
"cut_on": "the task's full sample, weighted"
},
"ratios": "imputed weighted mean and upper quantiles over the receivers, as multiples of the full sample's",
"quantile_levels": [
0.9,
0.99
]
}
}
Loading
Loading