Skip to content

Comments

Impute three variables related to new OBBBA deductions#397

Merged
donboyd5 merged 31 commits intomasterfrom
impute-obbba-vars
Feb 16, 2026
Merged

Impute three variables related to new OBBBA deductions#397
donboyd5 merged 31 commits intomasterfrom
impute-obbba-vars

Conversation

@martinholmer
Copy link
Collaborator

@martinholmer martinholmer commented Feb 5, 2026

Fixes issue #396 by imputing overtime_income and tip_income from SIPP data and imputing auto_loan_interest from CEX data.

Read the new tests/test_imputed_variables.py and tmd/create_taxcalc_imputed_variables.py code for details on how the MICE-imputed variable values were adjusted given Tax Policy Center results.

As mentioned in issue #396, this pull request has benefitted substantially from the
work on this topic by @maxkossek. Max identified SIPP data as being useful for
imputing overtime and tip income and CEX data as being useful for imputing auto
loan interest. In addition, this pull request is built on code that he developed to read
these two complex data sets. And it benefits from his experience with different
imputation methods. Many thanks to Max for all of his very helpful work.

Be sure to read the revised top-level README.md file about how to install the SIPP and CEX public-use data files.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

NOTE on the new tests/test_mice.py module:
Claude Code (running Sonnet 4.5) was asked this:

❯ The tmd/mice.py module implements a MICE class; what is a good testing    
  strategy for that logic?

And Claude responded like this:

⏺ Based on my analysis of the MICE class in tmd/utils/mice.py, here's a
  comprehensive testing strategy:

  Testing Strategy for MICE Class

  1. Unit Tests for Constructor Validation

  Test that the __init__ method properly validates all parameters:
  - Invalid types (e.g., non-int for x_obs, non-list for x_idx)
  - Boundary conditions (e.g., x_obs <= 0, seed > 999_999_999)
  - Logical constraints (e.g., x_ign containing indices from x_idx)
  - Monotone-specific parameter validation (adjustment parameters only allowed
  when monotone=True)
  - Verify iters == 1 when monotone=True

  2. Functional Tests for Core Imputation Logic

  Basic Imputation Tests:
  - Simple 2x2 matrix with one missing value
  - Small synthetic datasets with known patterns
  - Verify non-missing values remain unchanged after imputation
  - Verify all NaN values are replaced

  Monotone vs Non-Monotone Modes:
  - Test monotone mode with properly ordered x_idx (increasing missingness)
  - Test non-monotone mode with complex missing patterns
  - Verify bootstrap initialization is skipped in monotone mode
  - Verify assertion catches non-monotone patterns when monotone=True

  3. Statistical Property Tests

  Distribution Preservation:
  - Imputed values should maintain reasonable distributional properties
  - Test get_ival_stats() returns expected shapes
  - Verify mean/std/min/max statistics are computed correctly
  - Check that imputed value statistics evolve across iterations (when iters > 
  1)

  Reproducibility:
  - Same seed should produce identical results
  - Different seeds should produce different (but statistically similar) results
  - Test the RNG seed increment logic (increments by 1,111,111 per iteration)

  4. Adjustment Mechanism Tests (Monotone Mode Only)

  Test each adjustment parameter independently:
  - shift: additive adjustments
  - post_shift_min/max: range constraints
  - zero_below_abs: thresholding small values to zero
  - ovar_idx + zero_ovar_below_abs: conditional zeroing based on another
  variable
  - convert_zero_prob: probabilistic conversion of zeros to non-zeros
  - scale: multiplicative adjustments

  Test adjustment combinations and ordering (adjustments applied in specific
  sequence per lines 473-504)

---[SNIP]---

  Priority Recommendations

  High Priority:
  1. Constructor validation tests
  2. Basic imputation with simple synthetic data
  3. Monotone vs non-monotone mode tests
  4. Reproducibility tests

  Medium Priority:
  5. Statistical property tests
  6. Adjustment mechanism tests
  7. Edge cases

  Lower Priority:
  8. Property-based tests
  9. Performance benchmarks

  This strategy balances thorough coverage with practical implementation effort,
   focusing first on correctness and core functionality before optimization and
  edge cases.

Then I said this to Claude:

❯ Could you write test code for the four high-priority kinds of tests? 

⏺ I'll create a comprehensive test file covering the four high-priority test
  categories. Let me first check the test structure and then write the tests.

Then Claude Code generated to test_mice.py file included in this PR.

@martinholmer martinholmer requested a review from donboyd5 February 5, 2026 23:05
@donboyd5
Copy link
Collaborator

donboyd5 commented Feb 8, 2026

@martinholmer,

Initial technical comment:

After downloading and unzipping the necessary SIPP and CEX files, and gzipping them and placing them in their respective storage/input subfolders, then doing make clean and make data, it passed all tests not skipped, other than tests/test_imputed_variables.py::test_obbba_deduction_tax_benefits.

In this test, it failed the components shown below, falling just slightly outside the tolerance bounds:

OTM, totben: overtime income deduction, aggregate value of the deduction
ALI, totben: auto loan interest, aggregate value of the deduction
ALL, totben: sum of OTM, ALI, TIP (which did not fail), and the senior deduction (which is not tested individually here but may have been tested individually elsewhere)
ALL, affpct: ALL benefits, % of tax units affected

IMPUTED VARIABLE ACT-vs-EXP DIFFS:
DIFF:OTM,totben,act,exp,tol= 23.96 23.93 0.0101
DIFF:ALI,totben,act,exp,tol= 1.54 1.52 0.0101
DIFF:ALL,totben,act,exp,tol= 55.03 54.94 0.0101
DIFF:ALL,affpct,act,exp,tol= 26.31 26.33 0.0101

I obtained these results using Ubuntu 24 under WSL2 on a Windows 11 Pro system with AMD Ryzen 9 9950X, 64gb RAM, and NVIDIA GeForce RTX 5070Ti graphics card. I presume the small differences above could be unrelated to the deduction calculations but might rather be related to hardware or software differences involved in reweighting, where we know there can be small differences that are almost impossible to avoid.

FWIW, I copy below a screenshot of statistics on s006 in cached_allvars.csv resulting from the run above on my computer. The screenshot includes n, sum, and population standard deviation, all calculated in Excel, with Excel functions for sum and sd. (The screenshot also shows the first few values of s006, with 4 rounded decimal places shown.) I would not be surprised if you have small differences in the sum and standard deviation if run on another computer, and that these differences could be the reason for the test failure.

image

I will report back with comments on the substance of the OBBBA deduction approach after I have a bit more time to review.

@martinholmer martinholmer marked this pull request as draft February 8, 2026 17:15
@martinholmer martinholmer marked this pull request as ready for review February 8, 2026 22:07
@martinholmer
Copy link
Collaborator Author

@donboyd5, Thanks for your helpful review of the changes in PR #397.
Your review inspired me to add a few more unit tests. Turns out that one
of the new tests revealed two bugs in the auto_loan_interest imputation
logic. They have now been fixed and so some of the old tests have different
expected results.

Please, download to your computer the new version of PR #397 and execute:

make clean
make test

and let me know exactly what happens. Thanks again for your help on this.

@donboyd5
Copy link
Collaborator

donboyd5 commented Feb 9, 2026

@martinholmer

Great. It passes all not-skipped tests other than auto loan interest mean and standard deviation. It does not miss them by a lot, but still, the miss is surprisingly large (0.35% and 0.65%). Here's the key result, followed by full output:

E ValueError:
E IMPUTED VARIABLE DISTRIBUTION ACT-vs-EXP DIFFS:
E IMPUTED_VAR_DIFF:auto_loan_interest,mean,act,exp,atol,rtol= 116.40977820790567 116 0.0 0.001
E IMPUTED_VAR_DIFF:auto_loan_interest,sdev,act,exp,atol,rtol= 354.29761690971026 352 0.0 0.001

tests/test_imputed_variables.py:190: ValueError

(.venv) ~/Documents/mixed_projects/tax-microdata-benchmarking$ make clean
rm -f tmd/storage/output/tmd*
rm -f tmd/storage/output/cached*
rm -f tmd/storage/output/preimpute_tmd.csv.gz
(.venv) ~/Documents/mixed_projects/tax-microdata-benchmarking$ make data
pip install -e .
Obtaining file:///home/donboyd5/Documents/mixed_projects/tax-microdata-benchmarking
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... done
  Preparing editable metadata (pyproject.toml) ... done
Requirement already satisfied: policyengine_us==1.55.0 in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (1.55.0)
Requirement already satisfied: tables in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (3.10.2)
Requirement already satisfied: taxcalc>=6.4.0 in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (6.4.0)
Requirement already satisfied: behresp in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (0.11.0)
Requirement already satisfied: scikit-learn in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (1.7.2)
Requirement already satisfied: torch in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (2.8.0)
Requirement already satisfied: tensorboard in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (2.20.0)
Requirement already satisfied: scipy in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (1.16.2)
Requirement already satisfied: jax in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (0.7.2)
Requirement already satisfied: black>=26.1.0 in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (26.1.0)
Requirement already satisfied: pytest in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (8.4.2)
Requirement already satisfied: pytest-xdist in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (3.8.0)
Requirement already satisfied: jupyter-book in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (1.0.4.post1)
Requirement already satisfied: policyengine-core in ./.venv/lib/python3.12/site-packages (from policyengine_us==1.55.0->tmd==1.1.0) (3.20.1)
Requirement already satisfied: microdf-python in ./.venv/lib/python3.12/site-packages (from policyengine_us==1.55.0->tmd==1.1.0) (1.0.2)
Requirement already satisfied: tqdm in ./.venv/lib/python3.12/site-packages (from policyengine_us==1.55.0->tmd==1.1.0) (4.67.1)
Requirement already satisfied: click>=8.0.0 in ./.venv/lib/python3.12/site-packages (from black>=26.1.0->tmd==1.1.0) (8.3.0)
Requirement already satisfied: mypy-extensions>=0.4.3 in ./.venv/lib/python3.12/site-packages (from black>=26.1.0->tmd==1.1.0) (1.1.0)
Requirement already satisfied: packaging>=22.0 in ./.venv/lib/python3.12/site-packages (from black>=26.1.0->tmd==1.1.0) (25.0)
Requirement already satisfied: pathspec>=1.0.0 in ./.venv/lib/python3.12/site-packages (from black>=26.1.0->tmd==1.1.0) (1.0.4)
Requirement already satisfied: platformdirs>=2 in ./.venv/lib/python3.12/site-packages (from black>=26.1.0->tmd==1.1.0) (4.5.0)
Requirement already satisfied: pytokens>=0.3.0 in ./.venv/lib/python3.12/site-packages (from black>=26.1.0->tmd==1.1.0) (0.4.1)
Requirement already satisfied: numpy>=1.26 in ./.venv/lib/python3.12/site-packages (from taxcalc>=6.4.0->tmd==1.1.0) (2.1.3)
Requirement already satisfied: pandas>=2.2 in ./.venv/lib/python3.12/site-packages (from taxcalc>=6.4.0->tmd==1.1.0) (2.3.3)
Requirement already satisfied: bokeh>=2.4 in ./.venv/lib/python3.12/site-packages (from taxcalc>=6.4.0->tmd==1.1.0) (3.8.0)
Requirement already satisfied: numba in ./.venv/lib/python3.12/site-packages (from taxcalc>=6.4.0->tmd==1.1.0) (0.62.1)
Requirement already satisfied: paramtools>=0.20.0 in ./.venv/lib/python3.12/site-packages (from taxcalc>=6.4.0->tmd==1.1.0) (0.20.0)
Requirement already satisfied: jaxlib<=0.7.2,>=0.7.2 in ./.venv/lib/python3.12/site-packages (from jax->tmd==1.1.0) (0.7.2)
Requirement already satisfied: ml_dtypes>=0.5.0 in ./.venv/lib/python3.12/site-packages (from jax->tmd==1.1.0) (0.5.3)
Requirement already satisfied: opt_einsum in ./.venv/lib/python3.12/site-packages (from jax->tmd==1.1.0) (3.4.0)
Requirement already satisfied: jinja2 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (3.1.6)
Requirement already satisfied: jsonschema<5 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (4.25.1)
Requirement already satisfied: linkify-it-py<3,>=2 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (2.0.3)
Requirement already satisfied: myst-nb~=1.0 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (1.3.0)
Requirement already satisfied: myst-parser~=3.0 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (3.0.1)
Requirement already satisfied: pyyaml in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (6.0.3)
Requirement already satisfied: sphinx-book-theme~=1.1 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (1.1.4)
Requirement already satisfied: sphinx-comments~=0.0 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (0.0.3)
Requirement already satisfied: sphinx-copybutton~=0.5 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (0.5.2)
Requirement already satisfied: sphinx-design~=0.6 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (0.6.1)
Requirement already satisfied: sphinx-external-toc~=1.0 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (1.0.1)
Requirement already satisfied: sphinx-jupyterbook-latex~=1.0 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (1.0.0)
Requirement already satisfied: sphinx-multitoc-numbering~=0.1 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (0.1.3)
Requirement already satisfied: sphinx-thebe~=0.3 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (0.3.1)
Requirement already satisfied: sphinx-togglebutton~=0.3 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (0.3.2)
Requirement already satisfied: sphinxcontrib-bibtex~=2.5 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (2.6.5)
Requirement already satisfied: sphinx~=7.0 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (7.4.7)
Requirement already satisfied: iniconfig>=1 in ./.venv/lib/python3.12/site-packages (from pytest->tmd==1.1.0) (2.1.0)
Requirement already satisfied: pluggy<2,>=1.5 in ./.venv/lib/python3.12/site-packages (from pytest->tmd==1.1.0) (1.6.0)
Requirement already satisfied: pygments>=2.7.2 in ./.venv/lib/python3.12/site-packages (from pytest->tmd==1.1.0) (2.19.2)
Requirement already satisfied: execnet>=2.1 in ./.venv/lib/python3.12/site-packages (from pytest-xdist->tmd==1.1.0) (2.1.1)
Requirement already satisfied: joblib>=1.2.0 in ./.venv/lib/python3.12/site-packages (from scikit-learn->tmd==1.1.0) (1.5.2)
Requirement already satisfied: threadpoolctl>=3.1.0 in ./.venv/lib/python3.12/site-packages (from scikit-learn->tmd==1.1.0) (3.6.0)
Requirement already satisfied: numexpr>=2.6.2 in ./.venv/lib/python3.12/site-packages (from tables->tmd==1.1.0) (2.13.1)
Requirement already satisfied: py-cpuinfo in ./.venv/lib/python3.12/site-packages (from tables->tmd==1.1.0) (9.0.0)
Requirement already satisfied: blosc2>=2.3.0 in ./.venv/lib/python3.12/site-packages (from tables->tmd==1.1.0) (3.10.0)
Requirement already satisfied: typing-extensions>=4.4.0 in ./.venv/lib/python3.12/site-packages (from tables->tmd==1.1.0) (4.15.0)
Requirement already satisfied: absl-py>=0.4 in ./.venv/lib/python3.12/site-packages (from tensorboard->tmd==1.1.0) (2.3.1)
Requirement already satisfied: grpcio>=1.48.2 in ./.venv/lib/python3.12/site-packages (from tensorboard->tmd==1.1.0) (1.75.1)
Requirement already satisfied: markdown>=2.6.8 in ./.venv/lib/python3.12/site-packages (from tensorboard->tmd==1.1.0) (3.9)
Requirement already satisfied: pillow in ./.venv/lib/python3.12/site-packages (from tensorboard->tmd==1.1.0) (11.3.0)
Requirement already satisfied: protobuf!=4.24.0,>=3.19.6 in ./.venv/lib/python3.12/site-packages (from tensorboard->tmd==1.1.0) (6.32.1)
Requirement already satisfied: setuptools>=41.0.0 in ./.venv/lib/python3.12/site-packages (from tensorboard->tmd==1.1.0) (80.9.0)
Requirement already satisfied: tensorboard-data-server<0.8.0,>=0.7.0 in ./.venv/lib/python3.12/site-packages (from tensorboard->tmd==1.1.0) (0.7.2)
Requirement already satisfied: werkzeug>=1.0.1 in ./.venv/lib/python3.12/site-packages (from tensorboard->tmd==1.1.0) (3.1.3)
Requirement already satisfied: filelock in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (3.20.0)
Requirement already satisfied: sympy>=1.13.3 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (1.14.0)
Requirement already satisfied: networkx in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (3.5)
Requirement already satisfied: fsspec in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (2025.9.0)
Requirement already satisfied: nvidia-cuda-nvrtc-cu12==12.8.93 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (12.8.93)
Requirement already satisfied: nvidia-cuda-runtime-cu12==12.8.90 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (12.8.90)
Requirement already satisfied: nvidia-cuda-cupti-cu12==12.8.90 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (12.8.90)
Requirement already satisfied: nvidia-cudnn-cu12==9.10.2.21 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (9.10.2.21)
Requirement already satisfied: nvidia-cublas-cu12==12.8.4.1 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (12.8.4.1)
Requirement already satisfied: nvidia-cufft-cu12==11.3.3.83 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (11.3.3.83)
Requirement already satisfied: nvidia-curand-cu12==10.3.9.90 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (10.3.9.90)
Requirement already satisfied: nvidia-cusolver-cu12==11.7.3.90 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (11.7.3.90)
Requirement already satisfied: nvidia-cusparse-cu12==12.5.8.93 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (12.5.8.93)
Requirement already satisfied: nvidia-cusparselt-cu12==0.7.1 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (0.7.1)
Requirement already satisfied: nvidia-nccl-cu12==2.27.3 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (2.27.3)
Requirement already satisfied: nvidia-nvtx-cu12==12.8.90 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (12.8.90)
Requirement already satisfied: nvidia-nvjitlink-cu12==12.8.93 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (12.8.93)
Requirement already satisfied: nvidia-cufile-cu12==1.13.1.3 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (1.13.1.3)
Requirement already satisfied: triton==3.4.0 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (3.4.0)
Requirement already satisfied: ndindex in ./.venv/lib/python3.12/site-packages (from blosc2>=2.3.0->tables->tmd==1.1.0) (1.10.0)
Requirement already satisfied: msgpack in ./.venv/lib/python3.12/site-packages (from blosc2>=2.3.0->tables->tmd==1.1.0) (1.1.2)
Requirement already satisfied: requests in ./.venv/lib/python3.12/site-packages (from blosc2>=2.3.0->tables->tmd==1.1.0) (2.32.5)
Requirement already satisfied: contourpy>=1.2 in ./.venv/lib/python3.12/site-packages (from bokeh>=2.4->taxcalc>=6.4.0->tmd==1.1.0) (1.3.3)
Requirement already satisfied: narwhals>=1.13 in ./.venv/lib/python3.12/site-packages (from bokeh>=2.4->taxcalc>=6.4.0->tmd==1.1.0) (2.7.0)
Requirement already satisfied: tornado>=6.2 in ./.venv/lib/python3.12/site-packages (from bokeh>=2.4->taxcalc>=6.4.0->tmd==1.1.0) (6.5.2)
Requirement already satisfied: xyzservices>=2021.09.1 in ./.venv/lib/python3.12/site-packages (from bokeh>=2.4->taxcalc>=6.4.0->tmd==1.1.0) (2025.4.0)
Requirement already satisfied: MarkupSafe>=2.0 in ./.venv/lib/python3.12/site-packages (from jinja2->jupyter-book->tmd==1.1.0) (3.0.3)
Requirement already satisfied: attrs>=22.2.0 in ./.venv/lib/python3.12/site-packages (from jsonschema<5->jupyter-book->tmd==1.1.0) (25.4.0)
Requirement already satisfied: jsonschema-specifications>=2023.03.6 in ./.venv/lib/python3.12/site-packages (from jsonschema<5->jupyter-book->tmd==1.1.0) (2025.9.1)
Requirement already satisfied: referencing>=0.28.4 in ./.venv/lib/python3.12/site-packages (from jsonschema<5->jupyter-book->tmd==1.1.0) (0.36.2)
Requirement already satisfied: rpds-py>=0.7.1 in ./.venv/lib/python3.12/site-packages (from jsonschema<5->jupyter-book->tmd==1.1.0) (0.27.1)
Requirement already satisfied: uc-micro-py in ./.venv/lib/python3.12/site-packages (from linkify-it-py<3,>=2->jupyter-book->tmd==1.1.0) (1.0.3)
Requirement already satisfied: importlib_metadata in ./.venv/lib/python3.12/site-packages (from myst-nb~=1.0->jupyter-book->tmd==1.1.0) (8.7.0)
Requirement already satisfied: ipython in ./.venv/lib/python3.12/site-packages (from myst-nb~=1.0->jupyter-book->tmd==1.1.0) (8.37.0)
Requirement already satisfied: jupyter-cache>=0.5 in ./.venv/lib/python3.12/site-packages (from myst-nb~=1.0->jupyter-book->tmd==1.1.0) (1.0.1)
Requirement already satisfied: nbclient in ./.venv/lib/python3.12/site-packages (from myst-nb~=1.0->jupyter-book->tmd==1.1.0) (0.10.2)
Requirement already satisfied: nbformat>=5.0 in ./.venv/lib/python3.12/site-packages (from myst-nb~=1.0->jupyter-book->tmd==1.1.0) (5.10.4)
Requirement already satisfied: ipykernel in ./.venv/lib/python3.12/site-packages (from myst-nb~=1.0->jupyter-book->tmd==1.1.0) (6.30.1)
Requirement already satisfied: docutils<0.22,>=0.18 in ./.venv/lib/python3.12/site-packages (from myst-parser~=3.0->jupyter-book->tmd==1.1.0) (0.21.2)
Requirement already satisfied: markdown-it-py~=3.0 in ./.venv/lib/python3.12/site-packages (from myst-parser~=3.0->jupyter-book->tmd==1.1.0) (3.0.0)
Requirement already satisfied: mdit-py-plugins~=0.4 in ./.venv/lib/python3.12/site-packages (from myst-parser~=3.0->jupyter-book->tmd==1.1.0) (0.5.0)
Requirement already satisfied: python-dateutil>=2.8.2 in ./.venv/lib/python3.12/site-packages (from pandas>=2.2->taxcalc>=6.4.0->tmd==1.1.0) (2.9.0.post0)
Requirement already satisfied: pytz>=2020.1 in ./.venv/lib/python3.12/site-packages (from pandas>=2.2->taxcalc>=6.4.0->tmd==1.1.0) (2025.2)
Requirement already satisfied: tzdata>=2022.7 in ./.venv/lib/python3.12/site-packages (from pandas>=2.2->taxcalc>=6.4.0->tmd==1.1.0) (2025.2)
Requirement already satisfied: marshmallow>=4.0.0 in ./.venv/lib/python3.12/site-packages (from paramtools>=0.20.0->taxcalc>=6.4.0->tmd==1.1.0) (4.0.1)
Requirement already satisfied: sortedcontainers in ./.venv/lib/python3.12/site-packages (from paramtools>=0.20.0->taxcalc>=6.4.0->tmd==1.1.0) (2.4.0)
Requirement already satisfied: sphinxcontrib-applehelp in ./.venv/lib/python3.12/site-packages (from sphinx~=7.0->jupyter-book->tmd==1.1.0) (2.0.0)
Requirement already satisfied: sphinxcontrib-devhelp in ./.venv/lib/python3.12/site-packages (from sphinx~=7.0->jupyter-book->tmd==1.1.0) (2.0.0)
Requirement already satisfied: sphinxcontrib-jsmath in ./.venv/lib/python3.12/site-packages (from sphinx~=7.0->jupyter-book->tmd==1.1.0) (1.0.1)
Requirement already satisfied: sphinxcontrib-htmlhelp>=2.0.0 in ./.venv/lib/python3.12/site-packages (from sphinx~=7.0->jupyter-book->tmd==1.1.0) (2.1.0)
Requirement already satisfied: sphinxcontrib-serializinghtml>=1.1.9 in ./.venv/lib/python3.12/site-packages (from sphinx~=7.0->jupyter-book->tmd==1.1.0) (2.0.0)
Requirement already satisfied: sphinxcontrib-qthelp in ./.venv/lib/python3.12/site-packages (from sphinx~=7.0->jupyter-book->tmd==1.1.0) (2.0.0)
Requirement already satisfied: snowballstemmer>=2.2 in ./.venv/lib/python3.12/site-packages (from sphinx~=7.0->jupyter-book->tmd==1.1.0) (3.0.1)
Requirement already satisfied: babel>=2.13 in ./.venv/lib/python3.12/site-packages (from sphinx~=7.0->jupyter-book->tmd==1.1.0) (2.17.0)
Requirement already satisfied: alabaster~=0.7.14 in ./.venv/lib/python3.12/site-packages (from sphinx~=7.0->jupyter-book->tmd==1.1.0) (0.7.16)
Requirement already satisfied: imagesize>=1.3 in ./.venv/lib/python3.12/site-packages (from sphinx~=7.0->jupyter-book->tmd==1.1.0) (1.4.1)
Requirement already satisfied: pydata-sphinx-theme==0.15.4 in ./.venv/lib/python3.12/site-packages (from sphinx-book-theme~=1.1->jupyter-book->tmd==1.1.0) (0.15.4)
Requirement already satisfied: beautifulsoup4 in ./.venv/lib/python3.12/site-packages (from pydata-sphinx-theme==0.15.4->sphinx-book-theme~=1.1->jupyter-book->tmd==1.1.0) (4.14.2)
Requirement already satisfied: accessible-pygments in ./.venv/lib/python3.12/site-packages (from pydata-sphinx-theme==0.15.4->sphinx-book-theme~=1.1->jupyter-book->tmd==1.1.0) (0.0.5)
Requirement already satisfied: wheel in ./.venv/lib/python3.12/site-packages (from sphinx-togglebutton~=0.3->jupyter-book->tmd==1.1.0) (0.45.1)
Requirement already satisfied: pybtex>=0.25 in ./.venv/lib/python3.12/site-packages (from sphinxcontrib-bibtex~=2.5->jupyter-book->tmd==1.1.0) (0.25.1)
Requirement already satisfied: pybtex-docutils>=1.0.0 in ./.venv/lib/python3.12/site-packages (from sphinxcontrib-bibtex~=2.5->jupyter-book->tmd==1.1.0) (1.0.3)
Requirement already satisfied: mpmath<1.4,>=1.1.0 in ./.venv/lib/python3.12/site-packages (from sympy>=1.13.3->torch->tmd==1.1.0) (1.3.0)
Requirement already satisfied: llvmlite<0.46,>=0.45.0dev0 in ./.venv/lib/python3.12/site-packages (from numba->taxcalc>=6.4.0->tmd==1.1.0) (0.45.1)
Requirement already satisfied: dpath<3 in ./.venv/lib/python3.12/site-packages (from policyengine-core->policyengine_us==1.55.0->tmd==1.1.0) (2.2.0)
Requirement already satisfied: psutil<7,>=6 in ./.venv/lib/python3.12/site-packages (from policyengine-core->policyengine_us==1.55.0->tmd==1.1.0) (6.1.1)
Requirement already satisfied: h5py<4,>=3 in ./.venv/lib/python3.12/site-packages (from policyengine-core->policyengine_us==1.55.0->tmd==1.1.0) (3.14.0)
Requirement already satisfied: plotly<6,>=5 in ./.venv/lib/python3.12/site-packages (from policyengine-core->policyengine_us==1.55.0->tmd==1.1.0) (5.24.1)
Requirement already satisfied: pyvis>=0.3.2 in ./.venv/lib/python3.12/site-packages (from policyengine-core->policyengine_us==1.55.0->tmd==1.1.0) (0.3.2)
Requirement already satisfied: huggingface_hub>=0.25.1 in ./.venv/lib/python3.12/site-packages (from policyengine-core->policyengine_us==1.55.0->tmd==1.1.0) (0.35.3)
Requirement already satisfied: standard-imghdr in ./.venv/lib/python3.12/site-packages (from policyengine-core->policyengine_us==1.55.0->tmd==1.1.0) (3.13.0)
Requirement already satisfied: hf-xet<2.0.0,>=1.1.3 in ./.venv/lib/python3.12/site-packages (from huggingface_hub>=0.25.1->policyengine-core->policyengine_us==1.55.0->tmd==1.1.0) (1.1.10)
Requirement already satisfied: decorator in ./.venv/lib/python3.12/site-packages (from ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (5.2.1)
Requirement already satisfied: jedi>=0.16 in ./.venv/lib/python3.12/site-packages (from ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (0.19.2)
Requirement already satisfied: matplotlib-inline in ./.venv/lib/python3.12/site-packages (from ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (0.1.7)
Requirement already satisfied: pexpect>4.3 in ./.venv/lib/python3.12/site-packages (from ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (4.9.0)
Requirement already satisfied: prompt_toolkit<3.1.0,>=3.0.41 in ./.venv/lib/python3.12/site-packages (from ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (3.0.52)
Requirement already satisfied: stack_data in ./.venv/lib/python3.12/site-packages (from ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (0.6.3)
Requirement already satisfied: traitlets>=5.13.0 in ./.venv/lib/python3.12/site-packages (from ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (5.14.3)
Requirement already satisfied: sqlalchemy<3,>=1.3.12 in ./.venv/lib/python3.12/site-packages (from jupyter-cache>=0.5->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (2.0.43)
Requirement already satisfied: tabulate in ./.venv/lib/python3.12/site-packages (from jupyter-cache>=0.5->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (0.9.0)
Requirement already satisfied: mdurl~=0.1 in ./.venv/lib/python3.12/site-packages (from markdown-it-py~=3.0->myst-parser~=3.0->jupyter-book->tmd==1.1.0) (0.1.2)
Requirement already satisfied: jupyter-client>=6.1.12 in ./.venv/lib/python3.12/site-packages (from nbclient->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (8.6.3)
Requirement already satisfied: jupyter-core!=5.0.*,>=4.12 in ./.venv/lib/python3.12/site-packages (from nbclient->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (5.8.1)
Requirement already satisfied: fastjsonschema>=2.15 in ./.venv/lib/python3.12/site-packages (from nbformat>=5.0->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (2.21.2)
Requirement already satisfied: tenacity>=6.2.0 in ./.venv/lib/python3.12/site-packages (from plotly<6,>=5->policyengine-core->policyengine_us==1.55.0->tmd==1.1.0) (9.1.2)
Requirement already satisfied: latexcodec>=1.0.4 in ./.venv/lib/python3.12/site-packages (from pybtex>=0.25->sphinxcontrib-bibtex~=2.5->jupyter-book->tmd==1.1.0) (3.0.1)
Requirement already satisfied: six>=1.5 in ./.venv/lib/python3.12/site-packages (from python-dateutil>=2.8.2->pandas>=2.2->taxcalc>=6.4.0->tmd==1.1.0) (1.17.0)
Requirement already satisfied: jsonpickle>=1.4.1 in ./.venv/lib/python3.12/site-packages (from pyvis>=0.3.2->policyengine-core->policyengine_us==1.55.0->tmd==1.1.0) (4.1.1)
Requirement already satisfied: charset_normalizer<4,>=2 in ./.venv/lib/python3.12/site-packages (from requests->blosc2>=2.3.0->tables->tmd==1.1.0) (3.4.3)
Requirement already satisfied: idna<4,>=2.5 in ./.venv/lib/python3.12/site-packages (from requests->blosc2>=2.3.0->tables->tmd==1.1.0) (3.10)
Requirement already satisfied: urllib3<3,>=1.21.1 in ./.venv/lib/python3.12/site-packages (from requests->blosc2>=2.3.0->tables->tmd==1.1.0) (2.5.0)
Requirement already satisfied: certifi>=2017.4.17 in ./.venv/lib/python3.12/site-packages (from requests->blosc2>=2.3.0->tables->tmd==1.1.0) (2025.10.5)
Requirement already satisfied: zipp>=3.20 in ./.venv/lib/python3.12/site-packages (from importlib_metadata->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (3.23.0)
Requirement already satisfied: comm>=0.1.1 in ./.venv/lib/python3.12/site-packages (from ipykernel->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (0.2.3)
Requirement already satisfied: debugpy>=1.6.5 in ./.venv/lib/python3.12/site-packages (from ipykernel->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (1.8.17)
Requirement already satisfied: nest-asyncio>=1.4 in ./.venv/lib/python3.12/site-packages (from ipykernel->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (1.6.0)
Requirement already satisfied: pyzmq>=25 in ./.venv/lib/python3.12/site-packages (from ipykernel->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (27.1.0)
Requirement already satisfied: parso<0.9.0,>=0.8.4 in ./.venv/lib/python3.12/site-packages (from jedi>=0.16->ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (0.8.5)
Requirement already satisfied: ptyprocess>=0.5 in ./.venv/lib/python3.12/site-packages (from pexpect>4.3->ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (0.7.0)
Requirement already satisfied: wcwidth in ./.venv/lib/python3.12/site-packages (from prompt_toolkit<3.1.0,>=3.0.41->ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (0.2.14)
Requirement already satisfied: greenlet>=1 in ./.venv/lib/python3.12/site-packages (from sqlalchemy<3,>=1.3.12->jupyter-cache>=0.5->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (3.2.4)
Requirement already satisfied: soupsieve>1.2 in ./.venv/lib/python3.12/site-packages (from beautifulsoup4->pydata-sphinx-theme==0.15.4->sphinx-book-theme~=1.1->jupyter-book->tmd==1.1.0) (2.8)
Requirement already satisfied: executing>=1.2.0 in ./.venv/lib/python3.12/site-packages (from stack_data->ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (2.2.1)
Requirement already satisfied: asttokens>=2.1.0 in ./.venv/lib/python3.12/site-packages (from stack_data->ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (3.0.0)
Requirement already satisfied: pure-eval in ./.venv/lib/python3.12/site-packages (from stack_data->ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (0.2.3)
Building wheels for collected packages: tmd
  Building editable for tmd (pyproject.toml) ... done
  Created wheel for tmd: filename=tmd-1.1.0-0.editable-py3-none-any.whl size=2738 sha256=7506e21ddf8c32b6b3147f9e7c38e764099d1529144db7c1a638fda20527c670
  Stored in directory: /tmp/pip-ephem-wheel-cache-jy9suoro/wheels/e2/93/9b/aad813d369e42d5cfa67aa11dc831476bf3854abb69008abc6
Successfully built tmd
Installing collected packages: tmd
  Attempting uninstall: tmd
    Found existing installation: tmd 1.1.0
    Uninstalling tmd-1.1.0:
      Successfully uninstalled tmd-1.1.0
Successfully installed tmd-1.1.0
python tmd/create_taxcalc_input_variables.py
Creating 2021 PUF+CPS file assuming:
  IMPUTATION_RF_RNG_SEED = 1928374
  IMPUTATION_BETA_RNG_SEED = 37465
  ASSUMED ITMDED_GROW_RATE = 0.020
  ASSUMED W2_WAGES_SCALE = 0.15000
  WEIGHT_DEVIATION_PENALTY = 0.000
  ASSUMED CPS_WEIGHTS_SCALE = 0.58060
Skipping CPS previous year income imputation given lack of data...
Importing PolicyEngine-US variable metadata...
Uprating PUF from 2015 to 2021...
Pre-processing PUF...
Imputing missing PUF demographics...
Constructing hierarchical PUF: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 207692/207692 [00:17<00:00, 11978.29it/s]
Creating tc dataset from 'PUF 2021' for year 2021...
Creating tc dataset from 'CPS 2021' for year 2021...
Combining PUF filers and CPS nonfilers...
Adding Tax-Calculator outputs for 2021...
Reweighting...
...reweighting for year 2021
...GPU acceleration enabled: NVIDIA GeForce RTX 5070 Ti (15.9 GB)
Targeting 558 SOI statistics
...starting optimization with 2,000 iterations
Optimising weights: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2000/2000 [00:14<00:00, 140.11it/s]
...optimization completed in 14.3 seconds
...optimization speed: 140.1 iterations/second
...reweighting finished
Removing output variables from PUF+CPS DataFrame...
Writing PUF+CPS file... [/home/donboyd5/Documents/mixed_projects/tax-microdata-benchmarking/tmd/storage/output/tmd.csv.gz]
python tmd/create_taxcalc_sampling_weights.py
python tmd/create_taxcalc_growth_factors.py
python tmd/create_taxcalc_cached_files.py
python tmd/create_taxcalc_imputed_variables.py
Preparing data for imputation ...
Imputing overtime and tip data from SIPP to TMD ...
Imputing auto loan interest data from CEX to TMD ...
Writing preimpute TMD file ... [/home/donboyd5/Documents/mixed_projects/tax-microdata-benchmarking/tmd/storage/output/preimpute_tmd.csv.gz]
Writing augmented TMD file ... [/home/donboyd5/Documents/mixed_projects/tax-microdata-benchmarking/tmd/storage/output/tmd.csv.gz]
pytest . -v -n4
===================================================================================================== test session starts ======================================================================================================
platform linux -- Python 3.12.3, pytest-8.4.2, pluggy-1.6.0 -- /home/donboyd5/Documents/mixed_projects/tax-microdata-benchmarking/.venv/bin/python3
cachedir: .pytest_cache
rootdir: /home/donboyd5/Documents/mixed_projects/tax-microdata-benchmarking
configfile: pytest.ini
plugins: xdist-3.8.0
4 workers [13 items]    
scheduling tests via LoadScheduling

tests/test_imputed_variables.py::test_obbba_deduction_tax_benefits 
tests/test_misc.py::test_no_negative_weights 
tests/test_area_weights.py::test_area_xx 
tests/test_misc.py::test_population 
[gw2] [  7%] PASSED tests/test_misc.py::test_no_negative_weights 
tests/test_misc.py::test_partnership_s_corp_income 
[gw2] [ 15%] PASSED tests/test_misc.py::test_partnership_s_corp_income 
[gw3] [ 23%] PASSED tests/test_misc.py::test_population 
tests/test_tax_expenditures.py::test_tax_exp_diffs 
tests/test_misc.py::test_income_tax 
[gw3] [ 30%] PASSED tests/test_misc.py::test_income_tax 
tests/test_tmd_stats.py::test_tmd_stats 
[gw3] [ 38%] SKIPPED tests/test_tmd_stats.py::test_tmd_stats 
tests/test_variable_totals.py::test_variable_totals 
[gw3] [ 46%] PASSED tests/test_variable_totals.py::test_variable_totals 
tests/test_weights.py::test_weights 
[gw3] [ 53%] PASSED tests/test_weights.py::test_weights 
[gw1] [ 61%] PASSED tests/test_imputed_variables.py::test_obbba_deduction_tax_benefits 
tests/test_imputed_variables.py::test_imputed_variable_distribution 
[gw1] [ 69%] FAILED tests/test_imputed_variables.py::test_imputed_variable_distribution 
[gw2] [ 76%] PASSED tests/test_tax_expenditures.py::test_tax_exp_diffs 
tests/test_tax_revenue.py::test_tax_revenue 
[gw2] [ 84%] PASSED tests/test_tax_revenue.py::test_tax_revenue 
[gw0] [ 92%] PASSED tests/test_area_weights.py::test_area_xx 
tests/test_create_tmd_variables.py::test_create_file 
[gw0] [100%] SKIPPED tests/test_create_tmd_variables.py::test_create_file 

=========================================================================================================== FAILURES ===========================================================================================================
______________________________________________________________________________________________ test_imputed_variable_distribution ______________________________________________________________________________________________
[gw1] linux -- Python 3.12.3 /home/donboyd5/Documents/mixed_projects/tax-microdata-benchmarking/.venv/bin/python3

tmd_variables =         DSI  EIC  FLPDYR  MARS  MIDR  PT_SSTB_income  PT_binc_w2_wages  PT_ubia_property   RECID  XTOT  a_lineno  ... ...        0         0   236.48999         0        0         0           0        0        0

[225256 rows x 109 columns]

    @pytest.mark.imputed_distribution
    def test_imputed_variable_distribution(tmd_variables):
        """
        Calculate distribution of TMD imputed variables.
        """
        imputed_var_names = ["overtime_income", "tip_income", "auto_loan_interest"]
        expect = {
            "overtime_income": {"mean": 10_843, "sdev": 258_993},
            "tip_income": {"mean": 1_909, "sdev": 104_687},
            "auto_loan_interest": {"mean": 116, "sdev": 352},
        }
        tolerance = {"mean": 0.001, "sdev": 0.001}
        diffs = []
        for ivname in imputed_var_names:
            assert (
                ivname in tmd_variables.columns
            ), f"Column {ivname} missing from tmd.csv.gz"
            varray = tmd_variables[ivname].to_numpy()
            actual = {"mean": varray.mean(), "sdev": varray.std()}
            for stat in ["mean", "sdev"]:
                act = actual[stat]
                exp = expect[ivname][stat]
                abstol = 0.0
                reltol = tolerance[stat]
                if not np.allclose([act], [exp], atol=abstol, rtol=reltol):
                    diff = (
                        f"IMPUTED_VAR_DIFF:{ivname},{stat},act,exp,atol,rtol= "
                        f"{act} {exp} {abstol} {reltol}"
                    )
                    diffs.append(diff)
        if diffs:
            emsg = "\nIMPUTED VARIABLE DISTRIBUTION ACT-vs-EXP DIFFS:"
            for line in diffs:
                emsg += "\n" + line
>           raise ValueError(emsg)
E           ValueError: 
E           IMPUTED VARIABLE DISTRIBUTION ACT-vs-EXP DIFFS:
E           IMPUTED_VAR_DIFF:auto_loan_interest,mean,act,exp,atol,rtol= 116.40977820790567 116 0.0 0.001
E           IMPUTED_VAR_DIFF:auto_loan_interest,sdev,act,exp,atol,rtol= 354.29761690971026 352 0.0 0.001

tests/test_imputed_variables.py:190: ValueError
======================================================================================================= warnings summary =======================================================================================================
tests/test_area_weights.py::test_area_xx
tests/test_area_weights.py::test_area_xx
  /home/donboyd5/Documents/mixed_projects/tax-microdata-benchmarking/tmd/areas/create_area_weights.py:577: DeprecationWarning: scipy.optimize: The `disp` and `iprint` options of the L-BFGS-B solver are deprecated and will be removed in SciPy 1.18.0.
    res = minimize(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=================================================================================================== short test summary info ====================================================================================================
FAILED tests/test_imputed_variables.py::test_imputed_variable_distribution - ValueError: 
===================================================================================== 1 failed, 10 passed, 2 skipped, 2 warnings in 57.08s =====================================================================================
make: *** [Makefile:69: test] Error 1
(.venv) ~/Documents/mixed_projects/tax-microdata-benchmarking$ 

@donboyd5
Copy link
Collaborator

donboyd5 commented Feb 9, 2026

@martinholmer FWIW, the stats on s006 in the newly generated cached_allvars.csv match the stats on yesterday's file, so the reproducibility within a single machine (rather than across machines) seems to be pretty good for weight generation - and weight generation is probably the one area that has any meaningful randomness.

@martinholmer
Copy link
Collaborator Author

martinholmer commented Feb 9, 2026

@donboyd5, Again, thanks for all the helpful feedback on how the unit tests work on your computer.

The newest commit to this PR loosens the tolerances for the auto_loan_interest mean/sdev statistics, so I'm hoping you will be able to pass all the tests on your computer.

As before, download the newest version of PR #397 to your computer, and then executie:

make clean
make data

and let me know if you can pass all the tests.

@donboyd5
Copy link
Collaborator

donboyd5 commented Feb 9, 2026

@martinholmer

Everything passes now - see below.

(.venv) ~/Documents/mixed_projects/tax-microdata-benchmarking$ git reset --hard FETCH_HEAD
HEAD is now at 3bb20f3b Loosen auto_loan_interest tolerance in test_imputed_variable_distribution
(.venv) ~/Documents/mixed_projects/tax-microdata-benchmarking$ make clean
rm -f tmd/storage/output/tmd*
rm -f tmd/storage/output/cached*
rm -f tmd/storage/output/preimpute_tmd.csv.gz
(.venv) ~/Documents/mixed_projects/tax-microdata-benchmarking$ make data
pip install -e .
Obtaining file:///home/donboyd5/Documents/mixed_projects/tax-microdata-benchmarking
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... done
  Preparing editable metadata (pyproject.toml) ... done
Requirement already satisfied: policyengine_us==1.55.0 in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (1.55.0)
Requirement already satisfied: tables in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (3.10.2)
Requirement already satisfied: taxcalc>=6.4.0 in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (6.4.0)
Requirement already satisfied: behresp in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (0.11.0)
Requirement already satisfied: scikit-learn in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (1.7.2)
Requirement already satisfied: torch in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (2.8.0)
Requirement already satisfied: tensorboard in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (2.20.0)
Requirement already satisfied: scipy in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (1.16.2)
Requirement already satisfied: jax in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (0.7.2)
Requirement already satisfied: black>=26.1.0 in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (26.1.0)
Requirement already satisfied: pytest in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (8.4.2)
Requirement already satisfied: pytest-xdist in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (3.8.0)
Requirement already satisfied: jupyter-book in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (1.0.4.post1)
Requirement already satisfied: policyengine-core in ./.venv/lib/python3.12/site-packages (from policyengine_us==1.55.0->tmd==1.1.0) (3.20.1)
Requirement already satisfied: microdf-python in ./.venv/lib/python3.12/site-packages (from policyengine_us==1.55.0->tmd==1.1.0) (1.0.2)
Requirement already satisfied: tqdm in ./.venv/lib/python3.12/site-packages (from policyengine_us==1.55.0->tmd==1.1.0) (4.67.1)
Requirement already satisfied: click>=8.0.0 in ./.venv/lib/python3.12/site-packages (from black>=26.1.0->tmd==1.1.0) (8.3.0)
Requirement already satisfied: mypy-extensions>=0.4.3 in ./.venv/lib/python3.12/site-packages (from black>=26.1.0->tmd==1.1.0) (1.1.0)
Requirement already satisfied: packaging>=22.0 in ./.venv/lib/python3.12/site-packages (from black>=26.1.0->tmd==1.1.0) (25.0)
Requirement already satisfied: pathspec>=1.0.0 in ./.venv/lib/python3.12/site-packages (from black>=26.1.0->tmd==1.1.0) (1.0.4)
Requirement already satisfied: platformdirs>=2 in ./.venv/lib/python3.12/site-packages (from black>=26.1.0->tmd==1.1.0) (4.5.0)
Requirement already satisfied: pytokens>=0.3.0 in ./.venv/lib/python3.12/site-packages (from black>=26.1.0->tmd==1.1.0) (0.4.1)
Requirement already satisfied: numpy>=1.26 in ./.venv/lib/python3.12/site-packages (from taxcalc>=6.4.0->tmd==1.1.0) (2.1.3)
Requirement already satisfied: pandas>=2.2 in ./.venv/lib/python3.12/site-packages (from taxcalc>=6.4.0->tmd==1.1.0) (2.3.3)
Requirement already satisfied: bokeh>=2.4 in ./.venv/lib/python3.12/site-packages (from taxcalc>=6.4.0->tmd==1.1.0) (3.8.0)
Requirement already satisfied: numba in ./.venv/lib/python3.12/site-packages (from taxcalc>=6.4.0->tmd==1.1.0) (0.62.1)
Requirement already satisfied: paramtools>=0.20.0 in ./.venv/lib/python3.12/site-packages (from taxcalc>=6.4.0->tmd==1.1.0) (0.20.0)
Requirement already satisfied: jaxlib<=0.7.2,>=0.7.2 in ./.venv/lib/python3.12/site-packages (from jax->tmd==1.1.0) (0.7.2)
Requirement already satisfied: ml_dtypes>=0.5.0 in ./.venv/lib/python3.12/site-packages (from jax->tmd==1.1.0) (0.5.3)
Requirement already satisfied: opt_einsum in ./.venv/lib/python3.12/site-packages (from jax->tmd==1.1.0) (3.4.0)
Requirement already satisfied: jinja2 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (3.1.6)
Requirement already satisfied: jsonschema<5 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (4.25.1)
Requirement already satisfied: linkify-it-py<3,>=2 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (2.0.3)
Requirement already satisfied: myst-nb~=1.0 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (1.3.0)
Requirement already satisfied: myst-parser~=3.0 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (3.0.1)
Requirement already satisfied: pyyaml in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (6.0.3)
Requirement already satisfied: sphinx-book-theme~=1.1 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (1.1.4)
Requirement already satisfied: sphinx-comments~=0.0 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (0.0.3)
Requirement already satisfied: sphinx-copybutton~=0.5 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (0.5.2)
Requirement already satisfied: sphinx-design~=0.6 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (0.6.1)
Requirement already satisfied: sphinx-external-toc~=1.0 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (1.0.1)
Requirement already satisfied: sphinx-jupyterbook-latex~=1.0 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (1.0.0)
Requirement already satisfied: sphinx-multitoc-numbering~=0.1 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (0.1.3)
Requirement already satisfied: sphinx-thebe~=0.3 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (0.3.1)
Requirement already satisfied: sphinx-togglebutton~=0.3 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (0.3.2)
Requirement already satisfied: sphinxcontrib-bibtex~=2.5 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (2.6.5)
Requirement already satisfied: sphinx~=7.0 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (7.4.7)
Requirement already satisfied: iniconfig>=1 in ./.venv/lib/python3.12/site-packages (from pytest->tmd==1.1.0) (2.1.0)
Requirement already satisfied: pluggy<2,>=1.5 in ./.venv/lib/python3.12/site-packages (from pytest->tmd==1.1.0) (1.6.0)
Requirement already satisfied: pygments>=2.7.2 in ./.venv/lib/python3.12/site-packages (from pytest->tmd==1.1.0) (2.19.2)
Requirement already satisfied: execnet>=2.1 in ./.venv/lib/python3.12/site-packages (from pytest-xdist->tmd==1.1.0) (2.1.1)
Requirement already satisfied: joblib>=1.2.0 in ./.venv/lib/python3.12/site-packages (from scikit-learn->tmd==1.1.0) (1.5.2)
Requirement already satisfied: threadpoolctl>=3.1.0 in ./.venv/lib/python3.12/site-packages (from scikit-learn->tmd==1.1.0) (3.6.0)
Requirement already satisfied: numexpr>=2.6.2 in ./.venv/lib/python3.12/site-packages (from tables->tmd==1.1.0) (2.13.1)
Requirement already satisfied: py-cpuinfo in ./.venv/lib/python3.12/site-packages (from tables->tmd==1.1.0) (9.0.0)
Requirement already satisfied: blosc2>=2.3.0 in ./.venv/lib/python3.12/site-packages (from tables->tmd==1.1.0) (3.10.0)
Requirement already satisfied: typing-extensions>=4.4.0 in ./.venv/lib/python3.12/site-packages (from tables->tmd==1.1.0) (4.15.0)
Requirement already satisfied: absl-py>=0.4 in ./.venv/lib/python3.12/site-packages (from tensorboard->tmd==1.1.0) (2.3.1)
Requirement already satisfied: grpcio>=1.48.2 in ./.venv/lib/python3.12/site-packages (from tensorboard->tmd==1.1.0) (1.75.1)
Requirement already satisfied: markdown>=2.6.8 in ./.venv/lib/python3.12/site-packages (from tensorboard->tmd==1.1.0) (3.9)
Requirement already satisfied: pillow in ./.venv/lib/python3.12/site-packages (from tensorboard->tmd==1.1.0) (11.3.0)
Requirement already satisfied: protobuf!=4.24.0,>=3.19.6 in ./.venv/lib/python3.12/site-packages (from tensorboard->tmd==1.1.0) (6.32.1)
Requirement already satisfied: setuptools>=41.0.0 in ./.venv/lib/python3.12/site-packages (from tensorboard->tmd==1.1.0) (80.9.0)
Requirement already satisfied: tensorboard-data-server<0.8.0,>=0.7.0 in ./.venv/lib/python3.12/site-packages (from tensorboard->tmd==1.1.0) (0.7.2)
Requirement already satisfied: werkzeug>=1.0.1 in ./.venv/lib/python3.12/site-packages (from tensorboard->tmd==1.1.0) (3.1.3)
Requirement already satisfied: filelock in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (3.20.0)
Requirement already satisfied: sympy>=1.13.3 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (1.14.0)
Requirement already satisfied: networkx in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (3.5)
Requirement already satisfied: fsspec in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (2025.9.0)
Requirement already satisfied: nvidia-cuda-nvrtc-cu12==12.8.93 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (12.8.93)
Requirement already satisfied: nvidia-cuda-runtime-cu12==12.8.90 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (12.8.90)
Requirement already satisfied: nvidia-cuda-cupti-cu12==12.8.90 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (12.8.90)
Requirement already satisfied: nvidia-cudnn-cu12==9.10.2.21 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (9.10.2.21)
Requirement already satisfied: nvidia-cublas-cu12==12.8.4.1 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (12.8.4.1)
Requirement already satisfied: nvidia-cufft-cu12==11.3.3.83 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (11.3.3.83)
Requirement already satisfied: nvidia-curand-cu12==10.3.9.90 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (10.3.9.90)
Requirement already satisfied: nvidia-cusolver-cu12==11.7.3.90 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (11.7.3.90)
Requirement already satisfied: nvidia-cusparse-cu12==12.5.8.93 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (12.5.8.93)
Requirement already satisfied: nvidia-cusparselt-cu12==0.7.1 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (0.7.1)
Requirement already satisfied: nvidia-nccl-cu12==2.27.3 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (2.27.3)
Requirement already satisfied: nvidia-nvtx-cu12==12.8.90 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (12.8.90)
Requirement already satisfied: nvidia-nvjitlink-cu12==12.8.93 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (12.8.93)
Requirement already satisfied: nvidia-cufile-cu12==1.13.1.3 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (1.13.1.3)
Requirement already satisfied: triton==3.4.0 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (3.4.0)
Requirement already satisfied: ndindex in ./.venv/lib/python3.12/site-packages (from blosc2>=2.3.0->tables->tmd==1.1.0) (1.10.0)
Requirement already satisfied: msgpack in ./.venv/lib/python3.12/site-packages (from blosc2>=2.3.0->tables->tmd==1.1.0) (1.1.2)
Requirement already satisfied: requests in ./.venv/lib/python3.12/site-packages (from blosc2>=2.3.0->tables->tmd==1.1.0) (2.32.5)
Requirement already satisfied: contourpy>=1.2 in ./.venv/lib/python3.12/site-packages (from bokeh>=2.4->taxcalc>=6.4.0->tmd==1.1.0) (1.3.3)
Requirement already satisfied: narwhals>=1.13 in ./.venv/lib/python3.12/site-packages (from bokeh>=2.4->taxcalc>=6.4.0->tmd==1.1.0) (2.7.0)
Requirement already satisfied: tornado>=6.2 in ./.venv/lib/python3.12/site-packages (from bokeh>=2.4->taxcalc>=6.4.0->tmd==1.1.0) (6.5.2)
Requirement already satisfied: xyzservices>=2021.09.1 in ./.venv/lib/python3.12/site-packages (from bokeh>=2.4->taxcalc>=6.4.0->tmd==1.1.0) (2025.4.0)
Requirement already satisfied: MarkupSafe>=2.0 in ./.venv/lib/python3.12/site-packages (from jinja2->jupyter-book->tmd==1.1.0) (3.0.3)
Requirement already satisfied: attrs>=22.2.0 in ./.venv/lib/python3.12/site-packages (from jsonschema<5->jupyter-book->tmd==1.1.0) (25.4.0)
Requirement already satisfied: jsonschema-specifications>=2023.03.6 in ./.venv/lib/python3.12/site-packages (from jsonschema<5->jupyter-book->tmd==1.1.0) (2025.9.1)
Requirement already satisfied: referencing>=0.28.4 in ./.venv/lib/python3.12/site-packages (from jsonschema<5->jupyter-book->tmd==1.1.0) (0.36.2)
Requirement already satisfied: rpds-py>=0.7.1 in ./.venv/lib/python3.12/site-packages (from jsonschema<5->jupyter-book->tmd==1.1.0) (0.27.1)
Requirement already satisfied: uc-micro-py in ./.venv/lib/python3.12/site-packages (from linkify-it-py<3,>=2->jupyter-book->tmd==1.1.0) (1.0.3)
Requirement already satisfied: importlib_metadata in ./.venv/lib/python3.12/site-packages (from myst-nb~=1.0->jupyter-book->tmd==1.1.0) (8.7.0)
Requirement already satisfied: ipython in ./.venv/lib/python3.12/site-packages (from myst-nb~=1.0->jupyter-book->tmd==1.1.0) (8.37.0)
Requirement already satisfied: jupyter-cache>=0.5 in ./.venv/lib/python3.12/site-packages (from myst-nb~=1.0->jupyter-book->tmd==1.1.0) (1.0.1)
Requirement already satisfied: nbclient in ./.venv/lib/python3.12/site-packages (from myst-nb~=1.0->jupyter-book->tmd==1.1.0) (0.10.2)
Requirement already satisfied: nbformat>=5.0 in ./.venv/lib/python3.12/site-packages (from myst-nb~=1.0->jupyter-book->tmd==1.1.0) (5.10.4)
Requirement already satisfied: ipykernel in ./.venv/lib/python3.12/site-packages (from myst-nb~=1.0->jupyter-book->tmd==1.1.0) (6.30.1)
Requirement already satisfied: docutils<0.22,>=0.18 in ./.venv/lib/python3.12/site-packages (from myst-parser~=3.0->jupyter-book->tmd==1.1.0) (0.21.2)
Requirement already satisfied: markdown-it-py~=3.0 in ./.venv/lib/python3.12/site-packages (from myst-parser~=3.0->jupyter-book->tmd==1.1.0) (3.0.0)
Requirement already satisfied: mdit-py-plugins~=0.4 in ./.venv/lib/python3.12/site-packages (from myst-parser~=3.0->jupyter-book->tmd==1.1.0) (0.5.0)
Requirement already satisfied: python-dateutil>=2.8.2 in ./.venv/lib/python3.12/site-packages (from pandas>=2.2->taxcalc>=6.4.0->tmd==1.1.0) (2.9.0.post0)
Requirement already satisfied: pytz>=2020.1 in ./.venv/lib/python3.12/site-packages (from pandas>=2.2->taxcalc>=6.4.0->tmd==1.1.0) (2025.2)
Requirement already satisfied: tzdata>=2022.7 in ./.venv/lib/python3.12/site-packages (from pandas>=2.2->taxcalc>=6.4.0->tmd==1.1.0) (2025.2)
Requirement already satisfied: marshmallow>=4.0.0 in ./.venv/lib/python3.12/site-packages (from paramtools>=0.20.0->taxcalc>=6.4.0->tmd==1.1.0) (4.0.1)
Requirement already satisfied: sortedcontainers in ./.venv/lib/python3.12/site-packages (from paramtools>=0.20.0->taxcalc>=6.4.0->tmd==1.1.0) (2.4.0)
Requirement already satisfied: sphinxcontrib-applehelp in ./.venv/lib/python3.12/site-packages (from sphinx~=7.0->jupyter-book->tmd==1.1.0) (2.0.0)
Requirement already satisfied: sphinxcontrib-devhelp in ./.venv/lib/python3.12/site-packages (from sphinx~=7.0->jupyter-book->tmd==1.1.0) (2.0.0)
Requirement already satisfied: sphinxcontrib-jsmath in ./.venv/lib/python3.12/site-packages (from sphinx~=7.0->jupyter-book->tmd==1.1.0) (1.0.1)
Requirement already satisfied: sphinxcontrib-htmlhelp>=2.0.0 in ./.venv/lib/python3.12/site-packages (from sphinx~=7.0->jupyter-book->tmd==1.1.0) (2.1.0)
Requirement already satisfied: sphinxcontrib-serializinghtml>=1.1.9 in ./.venv/lib/python3.12/site-packages (from sphinx~=7.0->jupyter-book->tmd==1.1.0) (2.0.0)
Requirement already satisfied: sphinxcontrib-qthelp in ./.venv/lib/python3.12/site-packages (from sphinx~=7.0->jupyter-book->tmd==1.1.0) (2.0.0)
Requirement already satisfied: snowballstemmer>=2.2 in ./.venv/lib/python3.12/site-packages (from sphinx~=7.0->jupyter-book->tmd==1.1.0) (3.0.1)
Requirement already satisfied: babel>=2.13 in ./.venv/lib/python3.12/site-packages (from sphinx~=7.0->jupyter-book->tmd==1.1.0) (2.17.0)
Requirement already satisfied: alabaster~=0.7.14 in ./.venv/lib/python3.12/site-packages (from sphinx~=7.0->jupyter-book->tmd==1.1.0) (0.7.16)
Requirement already satisfied: imagesize>=1.3 in ./.venv/lib/python3.12/site-packages (from sphinx~=7.0->jupyter-book->tmd==1.1.0) (1.4.1)
Requirement already satisfied: pydata-sphinx-theme==0.15.4 in ./.venv/lib/python3.12/site-packages (from sphinx-book-theme~=1.1->jupyter-book->tmd==1.1.0) (0.15.4)
Requirement already satisfied: beautifulsoup4 in ./.venv/lib/python3.12/site-packages (from pydata-sphinx-theme==0.15.4->sphinx-book-theme~=1.1->jupyter-book->tmd==1.1.0) (4.14.2)
Requirement already satisfied: accessible-pygments in ./.venv/lib/python3.12/site-packages (from pydata-sphinx-theme==0.15.4->sphinx-book-theme~=1.1->jupyter-book->tmd==1.1.0) (0.0.5)
Requirement already satisfied: wheel in ./.venv/lib/python3.12/site-packages (from sphinx-togglebutton~=0.3->jupyter-book->tmd==1.1.0) (0.45.1)
Requirement already satisfied: pybtex>=0.25 in ./.venv/lib/python3.12/site-packages (from sphinxcontrib-bibtex~=2.5->jupyter-book->tmd==1.1.0) (0.25.1)
Requirement already satisfied: pybtex-docutils>=1.0.0 in ./.venv/lib/python3.12/site-packages (from sphinxcontrib-bibtex~=2.5->jupyter-book->tmd==1.1.0) (1.0.3)
Requirement already satisfied: mpmath<1.4,>=1.1.0 in ./.venv/lib/python3.12/site-packages (from sympy>=1.13.3->torch->tmd==1.1.0) (1.3.0)
Requirement already satisfied: llvmlite<0.46,>=0.45.0dev0 in ./.venv/lib/python3.12/site-packages (from numba->taxcalc>=6.4.0->tmd==1.1.0) (0.45.1)
Requirement already satisfied: dpath<3 in ./.venv/lib/python3.12/site-packages (from policyengine-core->policyengine_us==1.55.0->tmd==1.1.0) (2.2.0)
Requirement already satisfied: psutil<7,>=6 in ./.venv/lib/python3.12/site-packages (from policyengine-core->policyengine_us==1.55.0->tmd==1.1.0) (6.1.1)
Requirement already satisfied: h5py<4,>=3 in ./.venv/lib/python3.12/site-packages (from policyengine-core->policyengine_us==1.55.0->tmd==1.1.0) (3.14.0)
Requirement already satisfied: plotly<6,>=5 in ./.venv/lib/python3.12/site-packages (from policyengine-core->policyengine_us==1.55.0->tmd==1.1.0) (5.24.1)
Requirement already satisfied: pyvis>=0.3.2 in ./.venv/lib/python3.12/site-packages (from policyengine-core->policyengine_us==1.55.0->tmd==1.1.0) (0.3.2)
Requirement already satisfied: huggingface_hub>=0.25.1 in ./.venv/lib/python3.12/site-packages (from policyengine-core->policyengine_us==1.55.0->tmd==1.1.0) (0.35.3)
Requirement already satisfied: standard-imghdr in ./.venv/lib/python3.12/site-packages (from policyengine-core->policyengine_us==1.55.0->tmd==1.1.0) (3.13.0)
Requirement already satisfied: hf-xet<2.0.0,>=1.1.3 in ./.venv/lib/python3.12/site-packages (from huggingface_hub>=0.25.1->policyengine-core->policyengine_us==1.55.0->tmd==1.1.0) (1.1.10)
Requirement already satisfied: decorator in ./.venv/lib/python3.12/site-packages (from ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (5.2.1)
Requirement already satisfied: jedi>=0.16 in ./.venv/lib/python3.12/site-packages (from ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (0.19.2)
Requirement already satisfied: matplotlib-inline in ./.venv/lib/python3.12/site-packages (from ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (0.1.7)
Requirement already satisfied: pexpect>4.3 in ./.venv/lib/python3.12/site-packages (from ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (4.9.0)
Requirement already satisfied: prompt_toolkit<3.1.0,>=3.0.41 in ./.venv/lib/python3.12/site-packages (from ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (3.0.52)
Requirement already satisfied: stack_data in ./.venv/lib/python3.12/site-packages (from ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (0.6.3)
Requirement already satisfied: traitlets>=5.13.0 in ./.venv/lib/python3.12/site-packages (from ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (5.14.3)
Requirement already satisfied: sqlalchemy<3,>=1.3.12 in ./.venv/lib/python3.12/site-packages (from jupyter-cache>=0.5->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (2.0.43)
Requirement already satisfied: tabulate in ./.venv/lib/python3.12/site-packages (from jupyter-cache>=0.5->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (0.9.0)
Requirement already satisfied: mdurl~=0.1 in ./.venv/lib/python3.12/site-packages (from markdown-it-py~=3.0->myst-parser~=3.0->jupyter-book->tmd==1.1.0) (0.1.2)
Requirement already satisfied: jupyter-client>=6.1.12 in ./.venv/lib/python3.12/site-packages (from nbclient->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (8.6.3)
Requirement already satisfied: jupyter-core!=5.0.*,>=4.12 in ./.venv/lib/python3.12/site-packages (from nbclient->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (5.8.1)
Requirement already satisfied: fastjsonschema>=2.15 in ./.venv/lib/python3.12/site-packages (from nbformat>=5.0->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (2.21.2)
Requirement already satisfied: tenacity>=6.2.0 in ./.venv/lib/python3.12/site-packages (from plotly<6,>=5->policyengine-core->policyengine_us==1.55.0->tmd==1.1.0) (9.1.2)
Requirement already satisfied: latexcodec>=1.0.4 in ./.venv/lib/python3.12/site-packages (from pybtex>=0.25->sphinxcontrib-bibtex~=2.5->jupyter-book->tmd==1.1.0) (3.0.1)
Requirement already satisfied: six>=1.5 in ./.venv/lib/python3.12/site-packages (from python-dateutil>=2.8.2->pandas>=2.2->taxcalc>=6.4.0->tmd==1.1.0) (1.17.0)
Requirement already satisfied: jsonpickle>=1.4.1 in ./.venv/lib/python3.12/site-packages (from pyvis>=0.3.2->policyengine-core->policyengine_us==1.55.0->tmd==1.1.0) (4.1.1)
Requirement already satisfied: charset_normalizer<4,>=2 in ./.venv/lib/python3.12/site-packages (from requests->blosc2>=2.3.0->tables->tmd==1.1.0) (3.4.3)
Requirement already satisfied: idna<4,>=2.5 in ./.venv/lib/python3.12/site-packages (from requests->blosc2>=2.3.0->tables->tmd==1.1.0) (3.10)
Requirement already satisfied: urllib3<3,>=1.21.1 in ./.venv/lib/python3.12/site-packages (from requests->blosc2>=2.3.0->tables->tmd==1.1.0) (2.5.0)
Requirement already satisfied: certifi>=2017.4.17 in ./.venv/lib/python3.12/site-packages (from requests->blosc2>=2.3.0->tables->tmd==1.1.0) (2025.10.5)
Requirement already satisfied: zipp>=3.20 in ./.venv/lib/python3.12/site-packages (from importlib_metadata->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (3.23.0)
Requirement already satisfied: comm>=0.1.1 in ./.venv/lib/python3.12/site-packages (from ipykernel->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (0.2.3)
Requirement already satisfied: debugpy>=1.6.5 in ./.venv/lib/python3.12/site-packages (from ipykernel->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (1.8.17)
Requirement already satisfied: nest-asyncio>=1.4 in ./.venv/lib/python3.12/site-packages (from ipykernel->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (1.6.0)
Requirement already satisfied: pyzmq>=25 in ./.venv/lib/python3.12/site-packages (from ipykernel->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (27.1.0)
Requirement already satisfied: parso<0.9.0,>=0.8.4 in ./.venv/lib/python3.12/site-packages (from jedi>=0.16->ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (0.8.5)
Requirement already satisfied: ptyprocess>=0.5 in ./.venv/lib/python3.12/site-packages (from pexpect>4.3->ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (0.7.0)
Requirement already satisfied: wcwidth in ./.venv/lib/python3.12/site-packages (from prompt_toolkit<3.1.0,>=3.0.41->ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (0.2.14)
Requirement already satisfied: greenlet>=1 in ./.venv/lib/python3.12/site-packages (from sqlalchemy<3,>=1.3.12->jupyter-cache>=0.5->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (3.2.4)
Requirement already satisfied: soupsieve>1.2 in ./.venv/lib/python3.12/site-packages (from beautifulsoup4->pydata-sphinx-theme==0.15.4->sphinx-book-theme~=1.1->jupyter-book->tmd==1.1.0) (2.8)
Requirement already satisfied: executing>=1.2.0 in ./.venv/lib/python3.12/site-packages (from stack_data->ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (2.2.1)
Requirement already satisfied: asttokens>=2.1.0 in ./.venv/lib/python3.12/site-packages (from stack_data->ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (3.0.0)
Requirement already satisfied: pure-eval in ./.venv/lib/python3.12/site-packages (from stack_data->ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (0.2.3)
Building wheels for collected packages: tmd
  Building editable for tmd (pyproject.toml) ... done
  Created wheel for tmd: filename=tmd-1.1.0-0.editable-py3-none-any.whl size=2738 sha256=c5d02053cc73b30a14e8fea919fd143f23c41b70894bb57e60b5d724ccaba29f
  Stored in directory: /tmp/pip-ephem-wheel-cache-mzem1umy/wheels/e2/93/9b/aad813d369e42d5cfa67aa11dc831476bf3854abb69008abc6
Successfully built tmd
Installing collected packages: tmd
  Attempting uninstall: tmd
    Found existing installation: tmd 1.1.0
    Uninstalling tmd-1.1.0:
      Successfully uninstalled tmd-1.1.0
Successfully installed tmd-1.1.0
python tmd/create_taxcalc_input_variables.py
Creating 2021 PUF+CPS file assuming:
  IMPUTATION_RF_RNG_SEED = 1928374
  IMPUTATION_BETA_RNG_SEED = 37465
  ASSUMED ITMDED_GROW_RATE = 0.020
  ASSUMED W2_WAGES_SCALE = 0.15000
  WEIGHT_DEVIATION_PENALTY = 0.000
  ASSUMED CPS_WEIGHTS_SCALE = 0.58060
Skipping CPS previous year income imputation given lack of data...
Importing PolicyEngine-US variable metadata...
Uprating PUF from 2015 to 2021...
Pre-processing PUF...
Imputing missing PUF demographics...
Constructing hierarchical PUF: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 207692/207692 [00:18<00:00, 11014.47it/s]
Creating tc dataset from 'PUF 2021' for year 2021...
Creating tc dataset from 'CPS 2021' for year 2021...
Combining PUF filers and CPS nonfilers...
Adding Tax-Calculator outputs for 2021...
Reweighting...
...reweighting for year 2021
...GPU acceleration enabled: NVIDIA GeForce RTX 5070 Ti (15.9 GB)
Targeting 558 SOI statistics
...starting optimization with 2,000 iterations
Optimising weights: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2000/2000 [00:14<00:00, 138.08it/s]
...optimization completed in 14.5 seconds
...optimization speed: 138.1 iterations/second
...reweighting finished
Removing output variables from PUF+CPS DataFrame...
Writing PUF+CPS file... [/home/donboyd5/Documents/mixed_projects/tax-microdata-benchmarking/tmd/storage/output/tmd.csv.gz]
python tmd/create_taxcalc_sampling_weights.py
python tmd/create_taxcalc_growth_factors.py
python tmd/create_taxcalc_cached_files.py
python tmd/create_taxcalc_imputed_variables.py
Preparing data for imputation ...
Imputing overtime and tip data from SIPP to TMD ...
Imputing auto loan interest data from CEX to TMD ...
Writing preimpute TMD file ... [/home/donboyd5/Documents/mixed_projects/tax-microdata-benchmarking/tmd/storage/output/preimpute_tmd.csv.gz]
Writing augmented TMD file ... [/home/donboyd5/Documents/mixed_projects/tax-microdata-benchmarking/tmd/storage/output/tmd.csv.gz]
pytest . -v -n4
===================================================================================================== test session starts ======================================================================================================
platform linux -- Python 3.12.3, pytest-8.4.2, pluggy-1.6.0 -- /home/donboyd5/Documents/mixed_projects/tax-microdata-benchmarking/.venv/bin/python3
cachedir: .pytest_cache
rootdir: /home/donboyd5/Documents/mixed_projects/tax-microdata-benchmarking
configfile: pytest.ini
plugins: xdist-3.8.0
4 workers [13 items]    
scheduling tests via LoadScheduling

tests/test_area_weights.py::test_area_xx 
tests/test_imputed_variables.py::test_obbba_deduction_tax_benefits 
tests/test_misc.py::test_population 
tests/test_misc.py::test_no_negative_weights 
[gw2] [  7%] PASSED tests/test_misc.py::test_no_negative_weights 
tests/test_misc.py::test_partnership_s_corp_income 
[gw2] [ 15%] PASSED tests/test_misc.py::test_partnership_s_corp_income 
tests/test_tax_expenditures.py::test_tax_exp_diffs 
[gw3] [ 23%] PASSED tests/test_misc.py::test_population 
tests/test_misc.py::test_income_tax 
[gw3] [ 30%] PASSED tests/test_misc.py::test_income_tax 
tests/test_tmd_stats.py::test_tmd_stats 
[gw3] [ 38%] SKIPPED tests/test_tmd_stats.py::test_tmd_stats 
tests/test_variable_totals.py::test_variable_totals 
[gw3] [ 46%] PASSED tests/test_variable_totals.py::test_variable_totals 
tests/test_weights.py::test_weights 
[gw3] [ 53%] PASSED tests/test_weights.py::test_weights 
[gw1] [ 61%] PASSED tests/test_imputed_variables.py::test_obbba_deduction_tax_benefits 
tests/test_imputed_variables.py::test_imputed_variable_distribution 
[gw1] [ 69%] PASSED tests/test_imputed_variables.py::test_imputed_variable_distribution 
[gw2] [ 76%] PASSED tests/test_tax_expenditures.py::test_tax_exp_diffs 
tests/test_tax_revenue.py::test_tax_revenue 
[gw2] [ 84%] PASSED tests/test_tax_revenue.py::test_tax_revenue 
[gw0] [ 92%] PASSED tests/test_area_weights.py::test_area_xx 
tests/test_create_tmd_variables.py::test_create_file 
[gw0] [100%] SKIPPED tests/test_create_tmd_variables.py::test_create_file 

======================================================================================================= warnings summary =======================================================================================================
tests/test_area_weights.py::test_area_xx
tests/test_area_weights.py::test_area_xx
  /home/donboyd5/Documents/mixed_projects/tax-microdata-benchmarking/tmd/areas/create_area_weights.py:577: DeprecationWarning: scipy.optimize: The `disp` and `iprint` options of the L-BFGS-B solver are deprecated and will be removed in SciPy 1.18.0.
    res = minimize(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========================================================================================== 11 passed, 2 skipped, 2 warnings in 57.26s ==========================================================================================
(.venv) ~/Documents/mixed_projects/tax-microdata-benchmarking$ 

@donboyd5
Copy link
Collaborator

@martinholmer

Using 48fe7a6c Make CEX file names explicit, all tests pass.

Full output below:

(.venv) ~/Documents/mixed_projects/tax-microdata-benchmarking$ git fetch upstream pull/397/head
From https://github.com/PSLmodels/tax-microdata-benchmarking
 * branch            refs/pull/397/head -> FETCH_HEAD
(.venv) ~/Documents/mixed_projects/tax-microdata-benchmarking$ git reset --hard FETCH_HEAD
HEAD is now at 48fe7a6c Make CEX file names explicit
(.venv) ~/Documents/mixed_projects/tax-microdata-benchmarking$ make clean
rm -f tmd/storage/output/tmd*
rm -f tmd/storage/output/cached*
rm -f tmd/storage/output/preimpute_tmd.csv.gz
(.venv) ~/Documents/mixed_projects/tax-microdata-benchmarking$ make data
pip install -e .
Obtaining file:///home/donboyd5/Documents/mixed_projects/tax-microdata-benchmarking
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... done
  Preparing editable metadata (pyproject.toml) ... done
Requirement already satisfied: policyengine_us==1.55.0 in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (1.55.0)
Requirement already satisfied: tables in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (3.10.2)
Requirement already satisfied: taxcalc>=6.4.0 in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (6.4.0)
Requirement already satisfied: behresp in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (0.11.0)
Requirement already satisfied: scikit-learn in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (1.7.2)
Requirement already satisfied: torch in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (2.8.0)
Requirement already satisfied: tensorboard in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (2.20.0)
Requirement already satisfied: scipy in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (1.16.2)
Requirement already satisfied: jax in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (0.7.2)
Requirement already satisfied: black>=26.1.0 in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (26.1.0)
Requirement already satisfied: pytest in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (8.4.2)
Requirement already satisfied: pytest-xdist in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (3.8.0)
Requirement already satisfied: jupyter-book in ./.venv/lib/python3.12/site-packages (from tmd==1.1.0) (1.0.4.post1)
Requirement already satisfied: policyengine-core in ./.venv/lib/python3.12/site-packages (from policyengine_us==1.55.0->tmd==1.1.0) (3.20.1)
Requirement already satisfied: microdf-python in ./.venv/lib/python3.12/site-packages (from policyengine_us==1.55.0->tmd==1.1.0) (1.0.2)
Requirement already satisfied: tqdm in ./.venv/lib/python3.12/site-packages (from policyengine_us==1.55.0->tmd==1.1.0) (4.67.1)
Requirement already satisfied: click>=8.0.0 in ./.venv/lib/python3.12/site-packages (from black>=26.1.0->tmd==1.1.0) (8.3.0)
Requirement already satisfied: mypy-extensions>=0.4.3 in ./.venv/lib/python3.12/site-packages (from black>=26.1.0->tmd==1.1.0) (1.1.0)
Requirement already satisfied: packaging>=22.0 in ./.venv/lib/python3.12/site-packages (from black>=26.1.0->tmd==1.1.0) (25.0)
Requirement already satisfied: pathspec>=1.0.0 in ./.venv/lib/python3.12/site-packages (from black>=26.1.0->tmd==1.1.0) (1.0.4)
Requirement already satisfied: platformdirs>=2 in ./.venv/lib/python3.12/site-packages (from black>=26.1.0->tmd==1.1.0) (4.5.0)
Requirement already satisfied: pytokens>=0.3.0 in ./.venv/lib/python3.12/site-packages (from black>=26.1.0->tmd==1.1.0) (0.4.1)
Requirement already satisfied: numpy>=1.26 in ./.venv/lib/python3.12/site-packages (from taxcalc>=6.4.0->tmd==1.1.0) (2.1.3)
Requirement already satisfied: pandas>=2.2 in ./.venv/lib/python3.12/site-packages (from taxcalc>=6.4.0->tmd==1.1.0) (2.3.3)
Requirement already satisfied: bokeh>=2.4 in ./.venv/lib/python3.12/site-packages (from taxcalc>=6.4.0->tmd==1.1.0) (3.8.0)
Requirement already satisfied: numba in ./.venv/lib/python3.12/site-packages (from taxcalc>=6.4.0->tmd==1.1.0) (0.62.1)
Requirement already satisfied: paramtools>=0.20.0 in ./.venv/lib/python3.12/site-packages (from taxcalc>=6.4.0->tmd==1.1.0) (0.20.0)
Requirement already satisfied: jaxlib<=0.7.2,>=0.7.2 in ./.venv/lib/python3.12/site-packages (from jax->tmd==1.1.0) (0.7.2)
Requirement already satisfied: ml_dtypes>=0.5.0 in ./.venv/lib/python3.12/site-packages (from jax->tmd==1.1.0) (0.5.3)
Requirement already satisfied: opt_einsum in ./.venv/lib/python3.12/site-packages (from jax->tmd==1.1.0) (3.4.0)
Requirement already satisfied: jinja2 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (3.1.6)
Requirement already satisfied: jsonschema<5 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (4.25.1)
Requirement already satisfied: linkify-it-py<3,>=2 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (2.0.3)
Requirement already satisfied: myst-nb~=1.0 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (1.3.0)
Requirement already satisfied: myst-parser~=3.0 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (3.0.1)
Requirement already satisfied: pyyaml in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (6.0.3)
Requirement already satisfied: sphinx-book-theme~=1.1 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (1.1.4)
Requirement already satisfied: sphinx-comments~=0.0 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (0.0.3)
Requirement already satisfied: sphinx-copybutton~=0.5 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (0.5.2)
Requirement already satisfied: sphinx-design~=0.6 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (0.6.1)
Requirement already satisfied: sphinx-external-toc~=1.0 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (1.0.1)
Requirement already satisfied: sphinx-jupyterbook-latex~=1.0 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (1.0.0)
Requirement already satisfied: sphinx-multitoc-numbering~=0.1 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (0.1.3)
Requirement already satisfied: sphinx-thebe~=0.3 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (0.3.1)
Requirement already satisfied: sphinx-togglebutton~=0.3 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (0.3.2)
Requirement already satisfied: sphinxcontrib-bibtex~=2.5 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (2.6.5)
Requirement already satisfied: sphinx~=7.0 in ./.venv/lib/python3.12/site-packages (from jupyter-book->tmd==1.1.0) (7.4.7)
Requirement already satisfied: iniconfig>=1 in ./.venv/lib/python3.12/site-packages (from pytest->tmd==1.1.0) (2.1.0)
Requirement already satisfied: pluggy<2,>=1.5 in ./.venv/lib/python3.12/site-packages (from pytest->tmd==1.1.0) (1.6.0)
Requirement already satisfied: pygments>=2.7.2 in ./.venv/lib/python3.12/site-packages (from pytest->tmd==1.1.0) (2.19.2)
Requirement already satisfied: execnet>=2.1 in ./.venv/lib/python3.12/site-packages (from pytest-xdist->tmd==1.1.0) (2.1.1)
Requirement already satisfied: joblib>=1.2.0 in ./.venv/lib/python3.12/site-packages (from scikit-learn->tmd==1.1.0) (1.5.2)
Requirement already satisfied: threadpoolctl>=3.1.0 in ./.venv/lib/python3.12/site-packages (from scikit-learn->tmd==1.1.0) (3.6.0)
Requirement already satisfied: numexpr>=2.6.2 in ./.venv/lib/python3.12/site-packages (from tables->tmd==1.1.0) (2.13.1)
Requirement already satisfied: py-cpuinfo in ./.venv/lib/python3.12/site-packages (from tables->tmd==1.1.0) (9.0.0)
Requirement already satisfied: blosc2>=2.3.0 in ./.venv/lib/python3.12/site-packages (from tables->tmd==1.1.0) (3.10.0)
Requirement already satisfied: typing-extensions>=4.4.0 in ./.venv/lib/python3.12/site-packages (from tables->tmd==1.1.0) (4.15.0)
Requirement already satisfied: absl-py>=0.4 in ./.venv/lib/python3.12/site-packages (from tensorboard->tmd==1.1.0) (2.3.1)
Requirement already satisfied: grpcio>=1.48.2 in ./.venv/lib/python3.12/site-packages (from tensorboard->tmd==1.1.0) (1.75.1)
Requirement already satisfied: markdown>=2.6.8 in ./.venv/lib/python3.12/site-packages (from tensorboard->tmd==1.1.0) (3.9)
Requirement already satisfied: pillow in ./.venv/lib/python3.12/site-packages (from tensorboard->tmd==1.1.0) (11.3.0)
Requirement already satisfied: protobuf!=4.24.0,>=3.19.6 in ./.venv/lib/python3.12/site-packages (from tensorboard->tmd==1.1.0) (6.32.1)
Requirement already satisfied: setuptools>=41.0.0 in ./.venv/lib/python3.12/site-packages (from tensorboard->tmd==1.1.0) (80.9.0)
Requirement already satisfied: tensorboard-data-server<0.8.0,>=0.7.0 in ./.venv/lib/python3.12/site-packages (from tensorboard->tmd==1.1.0) (0.7.2)
Requirement already satisfied: werkzeug>=1.0.1 in ./.venv/lib/python3.12/site-packages (from tensorboard->tmd==1.1.0) (3.1.3)
Requirement already satisfied: filelock in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (3.20.0)
Requirement already satisfied: sympy>=1.13.3 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (1.14.0)
Requirement already satisfied: networkx in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (3.5)
Requirement already satisfied: fsspec in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (2025.9.0)
Requirement already satisfied: nvidia-cuda-nvrtc-cu12==12.8.93 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (12.8.93)
Requirement already satisfied: nvidia-cuda-runtime-cu12==12.8.90 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (12.8.90)
Requirement already satisfied: nvidia-cuda-cupti-cu12==12.8.90 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (12.8.90)
Requirement already satisfied: nvidia-cudnn-cu12==9.10.2.21 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (9.10.2.21)
Requirement already satisfied: nvidia-cublas-cu12==12.8.4.1 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (12.8.4.1)
Requirement already satisfied: nvidia-cufft-cu12==11.3.3.83 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (11.3.3.83)
Requirement already satisfied: nvidia-curand-cu12==10.3.9.90 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (10.3.9.90)
Requirement already satisfied: nvidia-cusolver-cu12==11.7.3.90 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (11.7.3.90)
Requirement already satisfied: nvidia-cusparse-cu12==12.5.8.93 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (12.5.8.93)
Requirement already satisfied: nvidia-cusparselt-cu12==0.7.1 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (0.7.1)
Requirement already satisfied: nvidia-nccl-cu12==2.27.3 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (2.27.3)
Requirement already satisfied: nvidia-nvtx-cu12==12.8.90 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (12.8.90)
Requirement already satisfied: nvidia-nvjitlink-cu12==12.8.93 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (12.8.93)
Requirement already satisfied: nvidia-cufile-cu12==1.13.1.3 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (1.13.1.3)
Requirement already satisfied: triton==3.4.0 in ./.venv/lib/python3.12/site-packages (from torch->tmd==1.1.0) (3.4.0)
Requirement already satisfied: ndindex in ./.venv/lib/python3.12/site-packages (from blosc2>=2.3.0->tables->tmd==1.1.0) (1.10.0)
Requirement already satisfied: msgpack in ./.venv/lib/python3.12/site-packages (from blosc2>=2.3.0->tables->tmd==1.1.0) (1.1.2)
Requirement already satisfied: requests in ./.venv/lib/python3.12/site-packages (from blosc2>=2.3.0->tables->tmd==1.1.0) (2.32.5)
Requirement already satisfied: contourpy>=1.2 in ./.venv/lib/python3.12/site-packages (from bokeh>=2.4->taxcalc>=6.4.0->tmd==1.1.0) (1.3.3)
Requirement already satisfied: narwhals>=1.13 in ./.venv/lib/python3.12/site-packages (from bokeh>=2.4->taxcalc>=6.4.0->tmd==1.1.0) (2.7.0)
Requirement already satisfied: tornado>=6.2 in ./.venv/lib/python3.12/site-packages (from bokeh>=2.4->taxcalc>=6.4.0->tmd==1.1.0) (6.5.2)
Requirement already satisfied: xyzservices>=2021.09.1 in ./.venv/lib/python3.12/site-packages (from bokeh>=2.4->taxcalc>=6.4.0->tmd==1.1.0) (2025.4.0)
Requirement already satisfied: MarkupSafe>=2.0 in ./.venv/lib/python3.12/site-packages (from jinja2->jupyter-book->tmd==1.1.0) (3.0.3)
Requirement already satisfied: attrs>=22.2.0 in ./.venv/lib/python3.12/site-packages (from jsonschema<5->jupyter-book->tmd==1.1.0) (25.4.0)
Requirement already satisfied: jsonschema-specifications>=2023.03.6 in ./.venv/lib/python3.12/site-packages (from jsonschema<5->jupyter-book->tmd==1.1.0) (2025.9.1)
Requirement already satisfied: referencing>=0.28.4 in ./.venv/lib/python3.12/site-packages (from jsonschema<5->jupyter-book->tmd==1.1.0) (0.36.2)
Requirement already satisfied: rpds-py>=0.7.1 in ./.venv/lib/python3.12/site-packages (from jsonschema<5->jupyter-book->tmd==1.1.0) (0.27.1)
Requirement already satisfied: uc-micro-py in ./.venv/lib/python3.12/site-packages (from linkify-it-py<3,>=2->jupyter-book->tmd==1.1.0) (1.0.3)
Requirement already satisfied: importlib_metadata in ./.venv/lib/python3.12/site-packages (from myst-nb~=1.0->jupyter-book->tmd==1.1.0) (8.7.0)
Requirement already satisfied: ipython in ./.venv/lib/python3.12/site-packages (from myst-nb~=1.0->jupyter-book->tmd==1.1.0) (8.37.0)
Requirement already satisfied: jupyter-cache>=0.5 in ./.venv/lib/python3.12/site-packages (from myst-nb~=1.0->jupyter-book->tmd==1.1.0) (1.0.1)
Requirement already satisfied: nbclient in ./.venv/lib/python3.12/site-packages (from myst-nb~=1.0->jupyter-book->tmd==1.1.0) (0.10.2)
Requirement already satisfied: nbformat>=5.0 in ./.venv/lib/python3.12/site-packages (from myst-nb~=1.0->jupyter-book->tmd==1.1.0) (5.10.4)
Requirement already satisfied: ipykernel in ./.venv/lib/python3.12/site-packages (from myst-nb~=1.0->jupyter-book->tmd==1.1.0) (6.30.1)
Requirement already satisfied: docutils<0.22,>=0.18 in ./.venv/lib/python3.12/site-packages (from myst-parser~=3.0->jupyter-book->tmd==1.1.0) (0.21.2)
Requirement already satisfied: markdown-it-py~=3.0 in ./.venv/lib/python3.12/site-packages (from myst-parser~=3.0->jupyter-book->tmd==1.1.0) (3.0.0)
Requirement already satisfied: mdit-py-plugins~=0.4 in ./.venv/lib/python3.12/site-packages (from myst-parser~=3.0->jupyter-book->tmd==1.1.0) (0.5.0)
Requirement already satisfied: python-dateutil>=2.8.2 in ./.venv/lib/python3.12/site-packages (from pandas>=2.2->taxcalc>=6.4.0->tmd==1.1.0) (2.9.0.post0)
Requirement already satisfied: pytz>=2020.1 in ./.venv/lib/python3.12/site-packages (from pandas>=2.2->taxcalc>=6.4.0->tmd==1.1.0) (2025.2)
Requirement already satisfied: tzdata>=2022.7 in ./.venv/lib/python3.12/site-packages (from pandas>=2.2->taxcalc>=6.4.0->tmd==1.1.0) (2025.2)
Requirement already satisfied: marshmallow>=4.0.0 in ./.venv/lib/python3.12/site-packages (from paramtools>=0.20.0->taxcalc>=6.4.0->tmd==1.1.0) (4.0.1)
Requirement already satisfied: sortedcontainers in ./.venv/lib/python3.12/site-packages (from paramtools>=0.20.0->taxcalc>=6.4.0->tmd==1.1.0) (2.4.0)
Requirement already satisfied: sphinxcontrib-applehelp in ./.venv/lib/python3.12/site-packages (from sphinx~=7.0->jupyter-book->tmd==1.1.0) (2.0.0)
Requirement already satisfied: sphinxcontrib-devhelp in ./.venv/lib/python3.12/site-packages (from sphinx~=7.0->jupyter-book->tmd==1.1.0) (2.0.0)
Requirement already satisfied: sphinxcontrib-jsmath in ./.venv/lib/python3.12/site-packages (from sphinx~=7.0->jupyter-book->tmd==1.1.0) (1.0.1)
Requirement already satisfied: sphinxcontrib-htmlhelp>=2.0.0 in ./.venv/lib/python3.12/site-packages (from sphinx~=7.0->jupyter-book->tmd==1.1.0) (2.1.0)
Requirement already satisfied: sphinxcontrib-serializinghtml>=1.1.9 in ./.venv/lib/python3.12/site-packages (from sphinx~=7.0->jupyter-book->tmd==1.1.0) (2.0.0)
Requirement already satisfied: sphinxcontrib-qthelp in ./.venv/lib/python3.12/site-packages (from sphinx~=7.0->jupyter-book->tmd==1.1.0) (2.0.0)
Requirement already satisfied: snowballstemmer>=2.2 in ./.venv/lib/python3.12/site-packages (from sphinx~=7.0->jupyter-book->tmd==1.1.0) (3.0.1)
Requirement already satisfied: babel>=2.13 in ./.venv/lib/python3.12/site-packages (from sphinx~=7.0->jupyter-book->tmd==1.1.0) (2.17.0)
Requirement already satisfied: alabaster~=0.7.14 in ./.venv/lib/python3.12/site-packages (from sphinx~=7.0->jupyter-book->tmd==1.1.0) (0.7.16)
Requirement already satisfied: imagesize>=1.3 in ./.venv/lib/python3.12/site-packages (from sphinx~=7.0->jupyter-book->tmd==1.1.0) (1.4.1)
Requirement already satisfied: pydata-sphinx-theme==0.15.4 in ./.venv/lib/python3.12/site-packages (from sphinx-book-theme~=1.1->jupyter-book->tmd==1.1.0) (0.15.4)
Requirement already satisfied: beautifulsoup4 in ./.venv/lib/python3.12/site-packages (from pydata-sphinx-theme==0.15.4->sphinx-book-theme~=1.1->jupyter-book->tmd==1.1.0) (4.14.2)
Requirement already satisfied: accessible-pygments in ./.venv/lib/python3.12/site-packages (from pydata-sphinx-theme==0.15.4->sphinx-book-theme~=1.1->jupyter-book->tmd==1.1.0) (0.0.5)
Requirement already satisfied: wheel in ./.venv/lib/python3.12/site-packages (from sphinx-togglebutton~=0.3->jupyter-book->tmd==1.1.0) (0.45.1)
Requirement already satisfied: pybtex>=0.25 in ./.venv/lib/python3.12/site-packages (from sphinxcontrib-bibtex~=2.5->jupyter-book->tmd==1.1.0) (0.25.1)
Requirement already satisfied: pybtex-docutils>=1.0.0 in ./.venv/lib/python3.12/site-packages (from sphinxcontrib-bibtex~=2.5->jupyter-book->tmd==1.1.0) (1.0.3)
Requirement already satisfied: mpmath<1.4,>=1.1.0 in ./.venv/lib/python3.12/site-packages (from sympy>=1.13.3->torch->tmd==1.1.0) (1.3.0)
Requirement already satisfied: llvmlite<0.46,>=0.45.0dev0 in ./.venv/lib/python3.12/site-packages (from numba->taxcalc>=6.4.0->tmd==1.1.0) (0.45.1)
Requirement already satisfied: dpath<3 in ./.venv/lib/python3.12/site-packages (from policyengine-core->policyengine_us==1.55.0->tmd==1.1.0) (2.2.0)
Requirement already satisfied: psutil<7,>=6 in ./.venv/lib/python3.12/site-packages (from policyengine-core->policyengine_us==1.55.0->tmd==1.1.0) (6.1.1)
Requirement already satisfied: h5py<4,>=3 in ./.venv/lib/python3.12/site-packages (from policyengine-core->policyengine_us==1.55.0->tmd==1.1.0) (3.14.0)
Requirement already satisfied: plotly<6,>=5 in ./.venv/lib/python3.12/site-packages (from policyengine-core->policyengine_us==1.55.0->tmd==1.1.0) (5.24.1)
Requirement already satisfied: pyvis>=0.3.2 in ./.venv/lib/python3.12/site-packages (from policyengine-core->policyengine_us==1.55.0->tmd==1.1.0) (0.3.2)
Requirement already satisfied: huggingface_hub>=0.25.1 in ./.venv/lib/python3.12/site-packages (from policyengine-core->policyengine_us==1.55.0->tmd==1.1.0) (0.35.3)
Requirement already satisfied: standard-imghdr in ./.venv/lib/python3.12/site-packages (from policyengine-core->policyengine_us==1.55.0->tmd==1.1.0) (3.13.0)
Requirement already satisfied: hf-xet<2.0.0,>=1.1.3 in ./.venv/lib/python3.12/site-packages (from huggingface_hub>=0.25.1->policyengine-core->policyengine_us==1.55.0->tmd==1.1.0) (1.1.10)
Requirement already satisfied: decorator in ./.venv/lib/python3.12/site-packages (from ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (5.2.1)
Requirement already satisfied: jedi>=0.16 in ./.venv/lib/python3.12/site-packages (from ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (0.19.2)
Requirement already satisfied: matplotlib-inline in ./.venv/lib/python3.12/site-packages (from ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (0.1.7)
Requirement already satisfied: pexpect>4.3 in ./.venv/lib/python3.12/site-packages (from ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (4.9.0)
Requirement already satisfied: prompt_toolkit<3.1.0,>=3.0.41 in ./.venv/lib/python3.12/site-packages (from ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (3.0.52)
Requirement already satisfied: stack_data in ./.venv/lib/python3.12/site-packages (from ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (0.6.3)
Requirement already satisfied: traitlets>=5.13.0 in ./.venv/lib/python3.12/site-packages (from ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (5.14.3)
Requirement already satisfied: sqlalchemy<3,>=1.3.12 in ./.venv/lib/python3.12/site-packages (from jupyter-cache>=0.5->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (2.0.43)
Requirement already satisfied: tabulate in ./.venv/lib/python3.12/site-packages (from jupyter-cache>=0.5->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (0.9.0)
Requirement already satisfied: mdurl~=0.1 in ./.venv/lib/python3.12/site-packages (from markdown-it-py~=3.0->myst-parser~=3.0->jupyter-book->tmd==1.1.0) (0.1.2)
Requirement already satisfied: jupyter-client>=6.1.12 in ./.venv/lib/python3.12/site-packages (from nbclient->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (8.6.3)
Requirement already satisfied: jupyter-core!=5.0.*,>=4.12 in ./.venv/lib/python3.12/site-packages (from nbclient->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (5.8.1)
Requirement already satisfied: fastjsonschema>=2.15 in ./.venv/lib/python3.12/site-packages (from nbformat>=5.0->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (2.21.2)
Requirement already satisfied: tenacity>=6.2.0 in ./.venv/lib/python3.12/site-packages (from plotly<6,>=5->policyengine-core->policyengine_us==1.55.0->tmd==1.1.0) (9.1.2)
Requirement already satisfied: latexcodec>=1.0.4 in ./.venv/lib/python3.12/site-packages (from pybtex>=0.25->sphinxcontrib-bibtex~=2.5->jupyter-book->tmd==1.1.0) (3.0.1)
Requirement already satisfied: six>=1.5 in ./.venv/lib/python3.12/site-packages (from python-dateutil>=2.8.2->pandas>=2.2->taxcalc>=6.4.0->tmd==1.1.0) (1.17.0)
Requirement already satisfied: jsonpickle>=1.4.1 in ./.venv/lib/python3.12/site-packages (from pyvis>=0.3.2->policyengine-core->policyengine_us==1.55.0->tmd==1.1.0) (4.1.1)
Requirement already satisfied: charset_normalizer<4,>=2 in ./.venv/lib/python3.12/site-packages (from requests->blosc2>=2.3.0->tables->tmd==1.1.0) (3.4.3)
Requirement already satisfied: idna<4,>=2.5 in ./.venv/lib/python3.12/site-packages (from requests->blosc2>=2.3.0->tables->tmd==1.1.0) (3.10)
Requirement already satisfied: urllib3<3,>=1.21.1 in ./.venv/lib/python3.12/site-packages (from requests->blosc2>=2.3.0->tables->tmd==1.1.0) (2.5.0)
Requirement already satisfied: certifi>=2017.4.17 in ./.venv/lib/python3.12/site-packages (from requests->blosc2>=2.3.0->tables->tmd==1.1.0) (2025.10.5)
Requirement already satisfied: zipp>=3.20 in ./.venv/lib/python3.12/site-packages (from importlib_metadata->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (3.23.0)
Requirement already satisfied: comm>=0.1.1 in ./.venv/lib/python3.12/site-packages (from ipykernel->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (0.2.3)
Requirement already satisfied: debugpy>=1.6.5 in ./.venv/lib/python3.12/site-packages (from ipykernel->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (1.8.17)
Requirement already satisfied: nest-asyncio>=1.4 in ./.venv/lib/python3.12/site-packages (from ipykernel->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (1.6.0)
Requirement already satisfied: pyzmq>=25 in ./.venv/lib/python3.12/site-packages (from ipykernel->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (27.1.0)
Requirement already satisfied: parso<0.9.0,>=0.8.4 in ./.venv/lib/python3.12/site-packages (from jedi>=0.16->ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (0.8.5)
Requirement already satisfied: ptyprocess>=0.5 in ./.venv/lib/python3.12/site-packages (from pexpect>4.3->ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (0.7.0)
Requirement already satisfied: wcwidth in ./.venv/lib/python3.12/site-packages (from prompt_toolkit<3.1.0,>=3.0.41->ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (0.2.14)
Requirement already satisfied: greenlet>=1 in ./.venv/lib/python3.12/site-packages (from sqlalchemy<3,>=1.3.12->jupyter-cache>=0.5->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (3.2.4)
Requirement already satisfied: soupsieve>1.2 in ./.venv/lib/python3.12/site-packages (from beautifulsoup4->pydata-sphinx-theme==0.15.4->sphinx-book-theme~=1.1->jupyter-book->tmd==1.1.0) (2.8)
Requirement already satisfied: executing>=1.2.0 in ./.venv/lib/python3.12/site-packages (from stack_data->ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (2.2.1)
Requirement already satisfied: asttokens>=2.1.0 in ./.venv/lib/python3.12/site-packages (from stack_data->ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (3.0.0)
Requirement already satisfied: pure-eval in ./.venv/lib/python3.12/site-packages (from stack_data->ipython->myst-nb~=1.0->jupyter-book->tmd==1.1.0) (0.2.3)
Building wheels for collected packages: tmd
  Building editable for tmd (pyproject.toml) ... done
  Created wheel for tmd: filename=tmd-1.1.0-0.editable-py3-none-any.whl size=2738 sha256=33668c704f07c92945083e64eb39b3a161ff3f528b19f118241926c87d5a4dd8
  Stored in directory: /tmp/pip-ephem-wheel-cache-xt6a6w7p/wheels/e2/93/9b/aad813d369e42d5cfa67aa11dc831476bf3854abb69008abc6
Successfully built tmd
Installing collected packages: tmd
  Attempting uninstall: tmd
    Found existing installation: tmd 1.1.0
    Uninstalling tmd-1.1.0:
      Successfully uninstalled tmd-1.1.0
Successfully installed tmd-1.1.0
python tmd/create_taxcalc_input_variables.py
Creating 2021 PUF+CPS file assuming:
  IMPUTATION_RF_RNG_SEED = 1928374
  IMPUTATION_BETA_RNG_SEED = 37465
  ASSUMED ITMDED_GROW_RATE = 0.020
  ASSUMED W2_WAGES_SCALE = 0.15000
  WEIGHT_DEVIATION_PENALTY = 0.000
  ASSUMED CPS_WEIGHTS_SCALE = 0.58060
Skipping CPS previous year income imputation given lack of data...
Importing PolicyEngine-US variable metadata...
Uprating PUF from 2015 to 2021...
Pre-processing PUF...
Imputing missing PUF demographics...
Constructing hierarchical PUF: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 207692/207692 [00:17<00:00, 11616.51it/s]
Creating tc dataset from 'PUF 2021' for year 2021...
Creating tc dataset from 'CPS 2021' for year 2021...
Combining PUF filers and CPS nonfilers...
Adding Tax-Calculator outputs for 2021...
Reweighting...
...reweighting for year 2021
...GPU acceleration enabled: NVIDIA GeForce RTX 5070 Ti (15.9 GB)
Targeting 558 SOI statistics
...starting optimization with 2,000 iterations
Optimising weights: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2000/2000 [00:15<00:00, 127.77it/s]
...optimization completed in 15.7 seconds
...optimization speed: 127.8 iterations/second
...reweighting finished
Removing output variables from PUF+CPS DataFrame...
Writing PUF+CPS file... [/home/donboyd5/Documents/mixed_projects/tax-microdata-benchmarking/tmd/storage/output/tmd.csv.gz]
python tmd/create_taxcalc_sampling_weights.py
python tmd/create_taxcalc_growth_factors.py
python tmd/create_taxcalc_cached_files.py
python tmd/create_taxcalc_imputed_variables.py
Preparing data for imputation ...
Imputing overtime and tip data from SIPP to TMD ...
Imputing auto loan interest data from CEX to TMD ...
Writing preimpute TMD file ... [/home/donboyd5/Documents/mixed_projects/tax-microdata-benchmarking/tmd/storage/output/preimpute_tmd.csv.gz]
Writing augmented TMD file ... [/home/donboyd5/Documents/mixed_projects/tax-microdata-benchmarking/tmd/storage/output/tmd.csv.gz]
pytest . -v -n4
========================================================================================== test session starts ==========================================================================================
platform linux -- Python 3.12.3, pytest-8.4.2, pluggy-1.6.0 -- /home/donboyd5/Documents/mixed_projects/tax-microdata-benchmarking/.venv/bin/python3
cachedir: .pytest_cache
rootdir: /home/donboyd5/Documents/mixed_projects/tax-microdata-benchmarking
configfile: pytest.ini
plugins: xdist-3.8.0
4 workers [13 items]    
scheduling tests via LoadScheduling

tests/test_area_weights.py::test_area_xx 
tests/test_imputed_variables.py::test_obbba_deduction_tax_benefits 
tests/test_misc.py::test_population 
tests/test_misc.py::test_no_negative_weights 
[gw2] [  7%] PASSED tests/test_misc.py::test_no_negative_weights 
tests/test_misc.py::test_partnership_s_corp_income 
[gw2] [ 15%] PASSED tests/test_misc.py::test_partnership_s_corp_income 
tests/test_tax_expenditures.py::test_tax_exp_diffs 
[gw3] [ 23%] PASSED tests/test_misc.py::test_population 
tests/test_misc.py::test_income_tax 
[gw3] [ 30%] PASSED tests/test_misc.py::test_income_tax 
tests/test_tmd_stats.py::test_tmd_stats 
[gw3] [ 38%] SKIPPED tests/test_tmd_stats.py::test_tmd_stats 
tests/test_variable_totals.py::test_variable_totals 
[gw3] [ 46%] PASSED tests/test_variable_totals.py::test_variable_totals 
tests/test_weights.py::test_weights 
[gw3] [ 53%] PASSED tests/test_weights.py::test_weights 
[gw0] [ 61%] PASSED tests/test_imputed_variables.py::test_obbba_deduction_tax_benefits 
tests/test_imputed_variables.py::test_imputed_variable_distribution 
[gw0] [ 69%] PASSED tests/test_imputed_variables.py::test_imputed_variable_distribution 
[gw2] [ 76%] PASSED tests/test_tax_expenditures.py::test_tax_exp_diffs 
tests/test_tax_revenue.py::test_tax_revenue 
[gw2] [ 84%] PASSED tests/test_tax_revenue.py::test_tax_revenue 
[gw1] [ 92%] PASSED tests/test_area_weights.py::test_area_xx 
tests/test_create_tmd_variables.py::test_create_file 
[gw1] [100%] SKIPPED tests/test_create_tmd_variables.py::test_create_file 

=========================================================================================== warnings summary ============================================================================================
tests/test_area_weights.py::test_area_xx
tests/test_area_weights.py::test_area_xx
  /home/donboyd5/Documents/mixed_projects/tax-microdata-benchmarking/tmd/areas/create_area_weights.py:577: DeprecationWarning: scipy.optimize: The `disp` and `iprint` options of the L-BFGS-B solver are deprecated and will be removed in SciPy 1.18.0.
    res = minimize(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========================================================================= 11 passed, 2 skipped, 2 warnings in 61.14s (0:01:01) ==========================================================================
(.venv) ~/Documents/mixed_projects/tax-microdata-benchmarking$ 

@martinholmer
Copy link
Collaborator Author

@donboyd5, Thanks for the testing on your computer as reported in this comment.
Could you somehow make the three tmd* files in the storage/output folder available to me?

@donboyd5
Copy link
Collaborator

donboyd5 commented Feb 10, 2026 via email

@martinholmer
Copy link
Collaborator Author

@donboyd5, Thanks for the three private tmd* files generated on your computer.

@martinholmer
Copy link
Collaborator Author

martinholmer commented Feb 10, 2026

@donboyd5, comparing the tmd.csv.gz file generated on your computer with the same file generated on my computer shows what we expected: the s006 variable values differ, but all the other variables (including the three new imputed variables) are the same (that is, np.allclose returns True).

So, now that the test tolerances are adjusted so that we can both pass all the unit tests, you might have a look at the new code in this PR to see if you can identify any logic problems.

@donboyd5
Copy link
Collaborator

donboyd5 commented Feb 15, 2026

@martinholmer, thanks for doing all this work. I had an extensive conversation with Claude to try to understand potential issues or improvements. I give what I consider the highlights below. In a subsequent comment I will copy the version of the entire Claude conversation that Claude put into a .md file (there was a lot more back and forth than Claude put into the file). I did not verify everything Claude said but did ask some follow-up questions to make sure we understood each other. In the full conversation I am not sure Claude did the best possible comparisons that I asked for, and we could improve them with more effort, I am sure.

My advice is to consider the 3 items I discuss below, make any changes you deem warranted, and merge.

There are three areas where I think improvements might be worth doing before merging:

  1. Application of convert_zero_prob: my reading of mice.py:489-502 and Claude's is that when convert_zero_prob increases the number of nonzero records, it grabs them randomly from the entire population rather than from within a particular marital-status / age / income-or-wages group. It seems (to me) that we'd get closer to the real-world distribution of non-zero values if we sampled within each group rather than from the entire population. If you agree, and if it's not too hard to code, it might make sense to sample within a classification group.
  2. Auto loan interest (see Q7 item 7C, below): This seems substantially overestimated and unfortunately we don't have a target to bring end results into line. Q9 gives Claude's thoughts on adjustments that might be made. I don't think Claude got everything right, but a variant on Claude's new vehicles approach (excluding interest on used cars or previously bought new cars) probably makes sense, as does an adjustment to try to limit it to cars with final assembly in the U.S. I assume the cost of this would grow over time, if it remains in law, as a greater and greater share of cars with financing were purchased after 12/31/2024. But we still want to exclude interest expense for used cars.
  3. Overtime pay premium -- see Q7 item 7A, and also Q8: In addition to the improvements I suggest above, a nice-to-have change would be to separate the overtime pay imputation into two steps: (1) estimate overtime pay using SIPP, (2) estimate the premium portion of overtime pay, which will be less, and make that the TMD variable - it probably makes sense to use what Claude believes is IRS guidance (1/3 of overtime pay -- e.g., the "half" portion if we assume overtime pay, on average, is time-and-a-half) to estimate the premium portion. Then, in the calibration step, you'd probably need to increase the scale factor from 2.6 to somewhere around 7.8, meaning in the end, we're right back to the values you have now. So this has no impact on results. However, it has the advantages that (1) it would make future changes easier and more intuitive if we get better targeting information in the future, and (2) it highlights just how much you have to adjust the data to be consistent with TPC estimates. This suggests to me that TPC may have substantially overestimated the impact of the overtime pay premium tax preference.

I did not do a serious search for any data sources that might be better for current purposes than the SIPP and CEX. I am pretty familiar with most major U.S. socio-economic survey datasets and I think these two are probably best.

You'll find my full Q&A below. I think there are some useful insights but I would not recommend holding up the merge to explore any of them in detail.

@donboyd5
Copy link
Collaborator

donboyd5 commented Feb 15, 2026

@martinholmer, here is the full .md file that Claude created from our conversation (it leaves out some of the questioning back and forth where we worked to make sure we were talking about the same things). There is a link within to some python code it wrote that's in my associated branch in my fork, although I'm not sure we need it for anything:

PR #397 (impute-obbba-vars) — Q&A Notes

Background

PR #397 on the upstream PSLmodels/tax-microdata-benchmarking repo adds imputation of three OBBBA (One Big Beautiful Bill Act) variables: overtime_income, tip_income, and auto_loan_interest. It uses a MICE (Multiple Imputation by Chained Equations) algorithm with Extremely Randomized Trees, drawing from SIPP 2024 (for overtime/tips) and CEX 2023 (for auto loan interest) as donor datasets.


Q1. Is my high-level understanding correct?

Question: Here is my high-level summary of what the PR does. Is it correct?

The PR imputes values for overtime income, tip income, and auto loan interest. Overtime and tip income are based on relationships in SIPP while auto loan interest is based on relationships in CEX. The PR adjusts SIPP, CEX, and TMD data to be reasonably consistent — e.g., deflating values to 2021 so they all use the same year, and structuring TMD-vs-other comparisons to be sensible, such as basing overtime and tip income comparisons on individual wage earners because those items relate to individuals, and auto loan interest on tax units since auto buying decisions are typically based on family income. Rather than use dollar amounts, it calculates fractions of wages (for SIPP) or income (for CEX) for each marital status, age, and wage or income group. After drawing values, it adjusts overtime and tip values by (1) increasing the number of records that have nonzero values, using convert_zero_prob, and (2) scaling all fractions upward using scale, capping fractions at 50%.

Also: I'm not sure why deflation is necessary if it uses fractions, unless overtime, tip, and auto loan interest are deflated differently from wages or income used in the fractions, but I don't think it does any harm.

Also: I hope the convert_zero_prob adjustment — increasing the number of nonzero records — is done randomly within each cell rather than randomly across the entire TMD dataset.

Answer: The high-level understanding is mostly correct, with three clarifications:

Correction 1: Auto loan interest is imputed as dollar amounts, not fractions

The fraction-based approach applies only to overtime and tips (from SIPP). For those, the code computes overtime_frac = overtime / (wage + overtime + tips) and tip_frac = tip / (wage + overtime + tips), and imputes these fractions.

For auto loan interest (from CEX), the code imputes the dollar amount directly — there is no conversion to a fraction of income. The income variable is used as a predictor in the tree (alongside age and marital status), but the target variable being imputed is the dollar amount of auto_loan_interest itself.

Correction 2: The tree creates flexible leaf-node groups, not predefined cells

The phrase "for each marital status, age, and wage or income group" suggests predefined cross-tabulated cells. In reality, the ExtraTreeRegressor decides how to partition the predictor space. It may split on age at 45 in one branch and at 62 in another; it may split on wages at $30K for married people but $50K for unmarried people. The resulting leaf nodes are data-adaptive groups, not a fixed grid of marital-status x age-bracket x income-bracket cells.

The conceptual idea is correct — similar people get matched together — but the mechanism is more flexible than fixed cells.

On deflation with fractions

The intuition is right that fractions themselves don't need deflation. However, deflation still matters because wages (e00200) are used as a predictor variable in the tree. If SIPP wages are in 2023 dollars and TMD wages are in 2021 dollars, the tree would systematically mismatch records — a TMD person earning $50K (in 2021$) would be matched to SIPP donors earning $50K (in 2023$), who are actually lower-earning in real terms. Deflating SIPP wages to 2021 dollars makes the predictor values comparable across the two datasets. The fractions are computed before deflation using original SIPP-year dollars, so the fractions themselves are unaffected.

For auto loan interest, deflation is essential since the imputed quantity is a dollar amount.

On convert_zero_prob — it operates globally, not within cells

The convert_zero_prob adjustment is applied across all imputed values for a variable, not within individual leaf nodes. The code (at mice.py:489-502):

  1. Finds all zero-valued imputations across the entire imputed vector
  2. Each zero has a random probability (convert_zero_prob) of being selected for replacement
  3. Replacement values are drawn randomly from the entire pool of nonzero imputed values (not from the nonzero values within the same leaf)

So the conversion is random across the whole TMD dataset, and the replacement value is drawn from the global nonzero distribution rather than from a cell-specific distribution.


Q2. Overview of what is tested and why

Question: Give me an overview of what is tested and why. I want to understand what tests are purely technical (making sure code works as intended) vs. what tests examine the quality or plausibility of resulting values.

Answer:

The PR adds three test files. They fall cleanly into two categories:

Category 1: Technical / code-correctness tests

tests/test_mice.py (849 lines, ~40 tests)

This is entirely about making sure the MICE engine works correctly as a piece of software. It uses synthetic data (small random numpy arrays) and never touches real SIPP, CEX, or TMD data. Four groups:

Group What it tests
Constructor validation (~20 tests) Every parameter is type-checked and range-checked: wrong types, out-of-range values, mismatched lengths, duplicate indices, etc. Pure input-validation testing.
Basic imputation (~8 tests) Does imputation actually fill in NaNs? Does it leave non-missing values untouched? Does it work with ignored variables? Does it validate input shape and missing patterns?
Monotone vs. non-monotone mode (~8 tests) Does monotone mode enforce the monotone missing pattern? Does it skip initialization? Do the post-imputation adjustments (shift, scale, zero_below_abs, convert_zero_prob) actually change values in the expected direction?
Reproducibility (~5 tests) Same seed = identical results? Different seed = different results? Statistics reproducible? Seed increments across iterations?

None of these tests say anything about whether the imputed tax data is reasonable. They only verify that the MICE algorithm is mechanically correct.

tests/test_weights.py (34 lines, 1 test)

Checks that the TMD weight variable (s006) has the expected mean and standard deviation. This is a regression/sanity test to ensure the TMD file hasn't been corrupted — not specific to imputation quality.

Category 2: Quality / plausibility tests

tests/test_imputed_variables.py (194 lines, 2 tests)

These are the substantive tests that examine whether the imputed values produce reasonable policy results:

Test 1: test_obbba_deduction_tax_benefits — The key quality test. It runs Tax-Calculator to simulate each new OBBBA deduction in 2026 and checks three statistics per deduction:

Statistic Meaning
totben Total tax benefit in billions of dollars
affpct Percent of tax units affected
affben Average dollar benefit among those affected

These are compared against expected values that were calibrated to match Tax Policy Center (TPC) estimates. The comments in the code are explicit about this — e.g., for overtime, the calibration parameters (convert_zero_prob=0.073, scale=2.6) were chosen so that affpct is close to TPC's 8.8% and affben is close to TPC's $1,400. For the combined "ALL" scenario, the test checks against TPC's published 29.6% affected and $1,081 average benefit.

This is the test that validates the end-to-end plausibility of the imputation: do the imputed values, when run through the tax system, produce results consistent with independent expert estimates?

Test 2: test_imputed_variable_distribution — A simpler distributional check. It verifies that the unweighted mean and standard deviation of each imputed variable match expected values within tight tolerances. This is more of a regression test (did the imputation produce the same distribution as last time?) than a plausibility test, but it does guard against the distribution shifting unexpectedly.

Summary

Test file Category What it validates
test_mice.py Technical MICE algorithm works correctly as software
test_weights.py Technical TMD file integrity (weights unchanged)
test_imputed_variables.py test 1 Quality Imputed values produce tax policy results matching TPC estimates
test_imputed_variables.py test 2 Quality/regression Distributional statistics of imputed values are stable

Q3. Where do the expected values in test_imputed_variable_distribution come from?

Question: When you say "Checks unweighted mean and std dev of each imputed variable against expected values" — where do the expected values come from? SIPP and CEX?

Answer: Neither. The expected values are hardcoded snapshots of the imputation's own output. Someone ran the imputation code, observed the resulting mean and standard deviation of each variable in the output TMD file, and recorded those numbers as the expected values in the test.

They don't come from SIPP, CEX, or any external benchmark. This is purely a regression test — "did the code produce the same output as last time?" If someone changes the imputation logic, the MICE seed, the post-imputation adjustments, or the input data, this test will catch that the distribution shifted.

It does not tell you whether those means and standard deviations are correct in any external sense. That job belongs to test 1 (test_obbba_deduction_tax_benefits), which compares against TPC estimates.


Q4. Where exactly are the calibration knobs, and what do they do?

Question: Where in the code are the calibration parameters set, and what is their practical effect?

Answer: They are set directly in tmd/create_taxcalc_imputed_variables.py when constructing MICE:

  • SIPP-based overtime/tip imputation uses:
    • convert_zero_prob=[0.073, 0.012]
    • scale=[2.6, 1.1]
    • in create_sipp_imputed_tmd(...) at tmd/create_taxcalc_imputed_variables.py:562.
  • CEX-based auto-loan-interest imputation uses:
    • convert_zero_prob=[0.000]
    • scale=[1.0]
    • in create_cex_imputed_tmd(...) at tmd/create_taxcalc_imputed_variables.py:605.

The adjustment order inside MICE.impute(...) is:

  1. Draw donor values from matching tree leaves
  2. Apply shift/floor/ceiling/zeroing rules
  3. Optionally convert some zeros to nonzero values
  4. Multiply by scale

That order is implemented in tmd/utils/mice.py:473.

For overtime/tips, after imputation and adjustments, fractions are clipped to [0, 0.5] in tmd/create_taxcalc_imputed_variables.py:572, then converted to dollars by multiplying by e00200 and summing to tax-unit level in tmd/create_taxcalc_imputed_variables.py:526.


Q5. What does the current test suite not verify?

Question: If tests pass, what important things could still be wrong or fragile?

Answer: Several things could still be off even with all tests green:

  1. No subgroup plausibility checks
    The policy-result test checks national totals (totben, affpct, affben) only. It does not verify distributions by income decile, filing status, age, etc. (tests/test_imputed_variables.py:20).

  2. No external benchmark for auto loan interest
    Comments explicitly say ALI calibration is not tuned to external targets because TPC did not provide comparable statistics (tests/test_imputed_variables.py:76).

  3. Distribution regression is unweighted
    test_imputed_variable_distribution uses simple unweighted mean/std (varray.mean(), varray.std()), not weighted moments using s006 (tests/test_imputed_variables.py:177).

  4. Snapshot tests can lock in accidental behavior
    Because expected values are hardcoded outputs, a subtle modeling issue can persist if it was present when the snapshot was recorded.


Q6. Is there any implementation detail worth flagging for future refinement?

Question: Any code-level choices that are valid but maybe worth revisiting?

Answer: Three notable ones:

  1. Zero-to-nonzero replacement is global
    As discussed earlier, replacement draws from all nonzero predicted values for that variable, not from leaf-local values (tmd/utils/mice.py:489). That can weaken local predictor consistency.

  2. Overtime/tip clipping at 50% is a hard cap
    Clipping at 0.5 prevents extreme fractions (tmd/create_taxcalc_imputed_variables.py:572), which is practical, but it is still a modeling assumption rather than an empirically estimated bound.

  3. CEX income is top-coded via clip(lower=0.0) plus rounding but no explicit upper-tail treatment
    This is not necessarily wrong, but if the fit is sensitive in the upper income tail, explicit diagnostics could be useful (tmd/create_taxcalc_imputed_variables.py:358 and tmd/create_taxcalc_imputed_variables.py:415).


Q7. Desk audit: Do the external data sources match the tax-law concepts?

Question: For each of the three variables, what exactly did OBBBA change in tax law, what does Tax-Calculator need as input, and what do SIPP and CEX actually measure? Are there conceptual mismatches?

Answer:

7A. Overtime income

What the tax law requires

The OBBBA overtime deduction (effective 2025–2028) is for qualified overtime compensation, defined as the overtime premium only — the amount exceeding the regular rate of pay. For time-and-a-half, that's the "half" portion. The IRS instructs workers whose employer reports total overtime to divide by 3 to isolate the premium. (IRS guidance)

Additional rules:

  • Only overtime required under FLSA Section 7 (hours over 40/week) qualifies
  • Cap: $12,500 ($25,000 joint)
  • Phase-out: begins at MAGI $150,000 ($300,000 joint)
  • Self-employed individuals are not eligible

What Tax-Calculator expects

The input variable overtime_income is described as "Filing unit's OBBBA-qualified overtime income." The MiscDed function in calcfunctions.py treats it directly as the deductible amount (subject to cap and phase-out). It does not divide by 3 internally — it expects the premium amount as input. (Tax-Calculator records_variables.json)

What SIPP measures

SIPP variable TJB{n}_OXAMT is the monthly overtime amount for each job. The SIPP data dictionary PDF in the repo is not text-searchable, and the Census Bureau's online documentation does not provide a precise definition distinguishing total overtime pay from premium. However, based on the SIPP questionnaire structure (which asks about earnings components), OXAMT most likely reports total overtime pay, not the premium portion. The SIPP was designed well before OBBBA and has no reason to separate the premium from the regular-rate portion of overtime.

Additionally, TJB{n}_MSUM appears to be the monthly earnings summary. The code computes e00200 = wage + otm + tip (line 287 of create_taxcalc_imputed_variables.py), treating these as additive components.

Conceptual mismatch: SIGNIFICANT

The imputation code appears to impute total overtime pay, but Tax-Calculator needs the overtime premium. If overtime is paid at time-and-a-half (the FLSA minimum), the premium is only 1/3 of total overtime pay. The code does not perform the divide-by-3 adjustment. This means the imputed overtime_income values may be roughly 3x too large before the scale and cap adjustments are applied.

However, the calibration parameters (scale=2.6, convert_zero_prob=0.073) were tuned to produce results matching TPC estimates. So the end result may be reasonable in aggregate, but the path from SIPP data to the imputed variable involves a conceptual mismatch that is compensated for by the calibration knobs rather than by a principled conversion.

Universe mismatch: SIPP covers all persons age 15+, including non-filers. The imputation maps SIPP individual-level data to TMD tax-unit-level data, so non-filers in SIPP serve as donors for filers in TMD. This is not necessarily wrong — SIPP donors with zero/low wages would naturally match to TMD records with similar characteristics — but the populations differ.


7B. Tip income

What the tax law requires

The deduction covers qualified tips — voluntary cash or charged tips received from customers, or through tip sharing, in occupations customarily receiving tips (IRS to publish a list). (IRS overview)

  • Cap: $25,000/year
  • Phase-out: begins at MAGI $150,000 ($300,000 joint)
  • Self-employed in Specified Service Trades or Businesses are ineligible, as are their employees

What Tax-Calculator expects

tip_income is "Filing unit's OBBBA-qualified tip income." Like overtime, it's used directly as the deductible amount (subject to cap and phase-out).

What SIPP measures

TJB{n}_TXAMT is the monthly tip amount for each job. This likely captures total tips reported by the respondent, which is conceptually close to the qualified amount (tips are tips — there is no "premium" vs. "base" distinction).

Conceptual mismatch: MINOR

The tip concept is a much closer match than overtime. SIPP tip amounts should approximate qualified tip income reasonably well. Minor issues:

  • SIPP may capture tips in occupations not on the IRS "customarily receiving tips" list (though such cases are likely rare)
  • SIPP self-reports may understate actual tips
  • The restriction excluding Specified Service Trade employees may not be captured
  • Universe mismatch same as overtime (SIPP includes non-filers)

7C. Auto loan interest

What the tax law requires

The deduction covers interest on loans for qualified passenger vehicles — defined as cars, minivans, vans, SUVs, pickups, or motorcycles under 14,000 lbs GVWR. (IRS overview)

Critical restrictions:

  • Vehicle must be new (original use starts with taxpayer — used vehicles do not qualify)
  • Vehicle must have undergone final assembly in the United States
  • Loan must be originated after December 31, 2024
  • For personal use only (not business)
  • Secured by a lien on the vehicle
  • Leases do not qualify
  • Cap: $10,000/year
  • Phase-out: begins at MAGI $100,000 ($200,000 joint)

What Tax-Calculator expects

auto_loan_interest is "Filing unit's interest payments on OBBBA-qualified auto loans." Again, used directly as the deductible amount.

What CEX measures

VEHFINCQ is described in the CEX data dictionary as "Vehicle finance charges this quarter," defined as SUM(510110, 510901, 510902, 850300) — a sum of four UCC (Universal Classification Code) expenditure categories. Based on general BLS CEX documentation:

  • "Finance charges" in the consumer lending context means the total cost of borrowing, which can include interest, origination fees, processing fees, and other lender charges — not just interest. (Experian: What is a finance charge on a car loan?)
  • The CEX vehicle section covers all owned vehicles — new and used, domestic and foreign
  • It does not distinguish vehicles by country of assembly
  • It likely covers all vehicle types owned by the consumer unit

Conceptual mismatch: SUBSTANTIAL

Several conceptual gaps:

Tax law requirement CEX measures Match?
Interest only Total finance charges (interest + fees) Wider than needed
New vehicles only All vehicles (new and used) Much wider
Domestically assembled only All vehicles regardless of origin Much wider
Loans originated after 12/31/2024 All current loan payments Much wider
Personal use only All consumer-unit vehicles Likely close (CEX is consumer survey)
Loans only (no leases) Unclear if lease finance charges are included Uncertain

The CEX measure is systematically broader than the tax-law concept in every dimension. It captures finance charges (not just interest) on all vehicles (not just new, not just domestic). This means the raw CEX data overstates the qualifying amount.

However, the calibration for auto loan interest uses scale=1.0 and convert_zero_prob=0.0 — i.e., no post-imputation adjustment at all. The code comments note that TPC did not provide comparable statistics for this deduction. The resulting imputed values are therefore the raw MICE output without any external calibration.

Universe mismatch: CEX "consumer units" approximate households/families, not tax-filing units. A consumer unit can contain multiple tax-filing units, or non-filers. The CEX FINCBTAX income concept (income before tax) differs from AGI.


Summary of conceptual alignment

Variable Tax-law concept External data concept Severity of mismatch Compensated by calibration?
overtime_income Overtime premium (e.g., the "half" in time-and-a-half) Likely total overtime pay Significant — ~3x overstatement Yes — scale=2.6 and convert_zero_prob=0.073 tuned to match TPC
tip_income Qualified tips Total reported tips Minor — concepts are close Lightly — scale=1.1, convert_zero_prob=0.012
auto_loan_interest Interest on new, domestic-assembled vehicle loans originated after 2024 Finance charges on all vehicle loans Substantial — much wider scope No — no calibration applied

Q8. Would it be cleaner to apply the 1/3 rule explicitly before calibrating overtime?

Question: For overtime, wouldn't it be conceptually cleaner to (1) impute total overtime pay from SIPP, (2) apply the IRS 1/3 rule to get the premium, (3) then calibrate? It probably wouldn't change any final numbers (just re-tune the calibration knobs), but it would be more principled and future-proof.

Answer: Yes, this is a sound idea. Here's the analysis:

Why it's cleaner

Currently the pipeline is:

SIPP total overtime → fraction of comp → MICE impute → calibrate (scale=2.6) → dollars

The imputed quantity has no clean real-world interpretation at the intermediate stage — it's a fraction of total overtime pay that has been scaled by 2.6 to match a policy target that's based on premium pay. The scale=2.6 conflates two things: (a) correcting for the total-vs-premium mismatch, and (b) calibrating the level to match TPC.

The proposed pipeline would be:

SIPP total overtime → fraction of comp → MICE impute → apply 1/3 → calibrate → dollars

Now the intermediate quantities have clear interpretations at each stage:

  • After MICE: imputed total-overtime fraction (directly comparable to SIPP donor data)
  • After 1/3: imputed overtime-premium fraction (aligned with the tax-law concept)
  • After calibration: calibrated overtime-premium fraction (tuned to match TPC)

Would it change final numbers?

No, not if you re-tune the calibration parameters. Inserting a * (1/3) step before the scale would require roughly scale ≈ 2.6 * 3 ≈ 7.8 to produce the same final values. (Not exactly 7.8 because the 50% cap interacts with the order of operations, but close.)

Why it's future-proof

If external targets for total overtime pay ever become available (e.g., from BLS or IRS W-2 data), you could validate the MICE-imputed total-overtime fraction directly against those targets before the 1/3 conversion. Right now, that's not possible because the calibration bakes the total-to-premium conversion into the scale factor.

One nuance: the 1/3 rule is a simplification

The IRS "divide by 3" assumes time-and-a-half across the board. Some workers earn double-time (premium = 1/2 of total overtime) or other rates. The true premium-to-total ratio varies by worker. Using a flat 1/3 is still more principled than no conversion, and it matches IRS guidance, but it's worth noting as an approximation.

Where the change would go

In prep_sipp_for_imputation() at create_taxcalc_imputed_variables.py:290-291, after computing otm_frac, add a line like:

otm_frac /= 3.0  # convert total overtime fraction to premium fraction per IRS guidance

Or equivalently, apply it after MICE imputation but before calibration. Then re-tune scale (and possibly convert_zero_prob) to re-match TPC targets.


Q9. Auto loan interest mismatch — adjustments and data sources

Question: The auto loan interest mismatch seems especially important because there are no external targets. Can we confirm that? And what adjustments to the CEX data might narrow the mismatch — specifically for new vehicles only, interest rates, proportion assembled in the US, and excluding leases? What data sources could inform each adjustment?

Answer:

Confirming: no external targets for auto loan interest

Confirmed. The code comments at test_imputed_variables.py:75-80 explicitly state:

"The ALI imputation calibration parameters used in the create_taxcalc_imputed_variables.py module do not adjust the MICE-imputed values of auto_loan_interest because the Tax Policy Center did not provide any statistics for this new deduction."

The calibration uses scale=1.0 and convert_zero_prob=0.0 — no adjustment at all. PR #397 discussion on GitHub contains no substantive conversation about ALI targets or validation; the only ALI-related discussion concerned loosening test tolerances for cross-machine reproducibility. No issues or PRs in either the tax-microdata-benchmarking or Tax-Calculator repos discuss external benchmarks for auto loan interest.

The test_obbba_deduction_tax_benefits test does produce ALI results (totben=1.72B, affpct=10.29%, affben=$87) but these are self-referential snapshots, not externally validated.

Proposed adjustments, ranked by impact

Here are the mismatches, roughly ordered from largest expected impact to smallest:

1. New vehicles only (LARGE impact — likely ~75% reduction)

The problem: CEX VEHFINCQ covers finance charges on all vehicles — new and used. Used vehicles account for roughly 70-75% of vehicle sales (~36M used vs. ~16M new in 2023). Used vehicles are more likely to be fully paid off, but those with outstanding loans contribute to VEHFINCQ.

Possible adjustment approach: Apply a scalar reduction factor based on the share of total vehicle finance charges attributable to new vehicles. This is not simply the sales share because new cars have higher loan balances and higher financing rates.

Data sources:

  • BTS New and Used Passenger Car Sales and Leases — sales volume split
  • Experian State of Auto Finance reports — average loan amounts for new ($40K+) vs. used ($25K) vehicles, financing penetration rates (most new vehicles are financed; only ~35% of used)
  • CFPB Auto Loans data — outstanding balances by loan type
  • CEX detail files (OVB section) may distinguish new vs. used vehicle purchases within the interview data — worth investigating whether the individual vehicle records in the CEX can be filtered

A rough estimate: New vehicles represent ~30% of vehicle sales but a higher share of outstanding loan balances (higher amounts, higher financing rate). A reasonable first-cut scalar might be 0.35–0.45 of total VEHFINCQ. This is the single biggest adjustment.

2. US final assembly only (MODERATE impact — likely ~50% further reduction)

The problem: Only vehicles with final assembly in the United States qualify.

Data: Approximately 50% of new vehicles sold in the US were assembled domestically in 2024. Of the ~400 light-duty models sold in the US for 2025, 133 are made solely in the US, 248 are imported, and 19 split.

Data sources:

A rough estimate: ~50% of new vehicles sold are domestically assembled. So the qualifying share of new-vehicle finance charges would be roughly halved again.

3. Exclude leases (MODERATE impact — ~20-25% reduction of new-vehicle charges)

The problem: Leases do not qualify; only purchased vehicles with loans do.

Data: Leasing accounted for ~21% of new vehicle transactions in 2023 and ~26% in 2024.

Data sources:

Note: It's unclear whether CEX VEHFINCQ includes lease finance charges. If it does, removing ~20-25% of the new-vehicle portion accounts for leases. If CEX already excludes leases (which is possible — the interview may ask specifically about loan payments), this adjustment is unnecessary. The CEX questionnaire would need to be checked.

4. Finance charges vs. interest only (SMALL impact — likely <5%)

The problem: "Finance charges" include origination fees, documentation fees, etc. in addition to interest. The tax deduction is for interest only.

In practice: For most auto loans, interest dominates the finance charge. Fees are typically a small fraction of total finance charges — an origination fee of $200-500 on a $35K loan where total interest is $5K-8K is only 3-6% of total charges.

Data sources:

Verdict: This is a small adjustment and probably not worth worrying about given the much larger issues above.

5. Business vs. personal use, secured by lien (MINIMAL impact)

Agreed — likely minimal. The CEX is a consumer/household survey, so business vehicles are largely excluded. Virtually all auto loans are secured by a lien on the vehicle (that's how auto lending works). These don't need adjustment.

6. The $10K cap and the loan-origination-date requirement

The $10K cap is applied by Tax-Calculator during the simulation (via the AutoLoanInterestDed_c parameter), not in the imputation. So the imputation doesn't need to worry about it — Tax-Calculator handles it.

The loan-origination-date requirement (after 12/31/2024) is conceptually the hardest to handle. In steady state, most qualifying loans would be relatively recent. But for a 2026 simulation, only loans originated in 2025 qualify. This significantly limits the eligible population compared to CEX data that covers all outstanding loans. Over time this constraint relaxes (by 2028, loans from 3+ years qualify). This is hard to adjust for with CEX data alone because the CEX doesn't distinguish loan origination dates.

Combined rough estimate

If we compose the adjustment factors multiplicatively:

Step Factor Cumulative
Start: CEX VEHFINCQ 1.00 1.00
New vehicles only × 0.40 0.40
US-assembled only × 0.50 0.20
Exclude leases × 0.80 0.16
Interest vs. finance charges × 0.95 ~0.15

This very rough calculation suggests that the qualifying amount is perhaps ~15% of the raw CEX vehicle finance charges. The current code uses 100% (scale=1.0). If this estimate is even directionally correct, the current imputation substantially overstates qualifying auto loan interest.

The current test shows totben=$1.72B and affpct=10.29%. If the true qualifying amount is ~15% of what's imputed, the actual tax benefit would be much smaller and fewer tax units would be affected. (Though the $10K cap and phase-outs applied by Tax-Calculator would compress the impact somewhat, since many imputed values may already exceed the cap.)

Recommended approach

A principled adjustment would apply a composite scalar to CEX VEHFINCQ before imputation (similar to the proposed 1/3 rule for overtime). Then calibrate if/when external targets become available. The scalar could be documented with its components, making each assumption transparent and individually adjustable as better data emerges.


Q10. Data comparison: How do SIPP and CEX source data compare to TMD imputed results?

Question: For each of the three imputed variables, compare the source data (SIPP for overtime/tips, CEX for auto loan interest) to the TMD output. Compute % nonzero, distributional statistics for nonzero values (min, max, median, weighted mean, weighted std dev), broken down by "cells" (marital status × age group). Also compute correlations between the imputed variables and their predictors, and between overtime and tip income. Weight records appropriately and make populations as comparable as possible.

Answer: Analysis code is in analysis_compare_sources.py. The script replicates the data-reading logic from create_taxcalc_imputed_variables.py to ensure comparable populations: SIPP individuals with positive weight (aggregated to annual, self-employment excluded, wages deflated to TMD year 2021); CEX units with positive weight (quarterly weights ÷ 4, VEHFINCQ annualized × 4, deflated to TMD year); TMD tax units as output. Fractions are computed as overtime_income/e00200 and tip_income/e00200 for comparability between SIPP (which imputes fractions) and TMD (which stores dollar amounts).

Key caveat: SIPP statistics are at the individual level (persons with positive weight), while TMD statistics are at the tax-unit level. For married couples, the TMD pipeline splits each tax unit into head and spouse for MICE imputation, then re-aggregates. The TMD fractions shown here are tax-unit-level ratios (overtime_income / e00200), which blend the head and spouse fractions. This makes the TMD fractions not perfectly comparable to SIPP individual-level fractions, but the comparison is still informative.

Key Findings

  • Overtime fraction: SIPP has 6.2% nonzero (weighted mean 0.081); TMD has 16.4% nonzero (weighted mean 0.149). TMD overtime is ~2.6× more prevalent and ~1.8× larger in magnitude, reflecting convert_zero_prob=0.073 and scale=2.6. Dollar aggregates: SIPP $63B vs TMD $238B (3.8× amplification).

  • Tip fraction: SIPP has 2.7% nonzero (weighted mean 0.166); TMD has 5.4% nonzero (weighted mean 0.171). Tips are moderately amplified, matching the light calibration (convert_zero_prob=0.012, scale=1.1). Dollar aggregates: SIPP $33B vs TMD $62B (~1.9×).

  • Auto loan interest: CEX has 21.1% nonzero (weighted mean $557); TMD has 19.3% nonzero (weighted mean $509). Distributions are remarkably close — consistent with no post-imputation adjustment (scale=1.0, convert_zero_prob=0.0). Dollar aggregates: CEX $15.8B vs TMD $18.0B (difference due to larger TMD weighted population).

  • Correlations: Signs are perfectly preserved between source and TMD for all variable pairs. Magnitudes are systematically attenuated (weaker in TMD), especially for ALI. The tip_frac–age correlation is remarkably well preserved (−0.080 in both SIPP and TMD).

10A. Overtime fraction: SIPP vs TMD

Population: records with positive wages (e00200 > 0).

Source Weighted pop (M) % nonzero (wtd) Wtd mean (nonzero) Wtd std (nonzero) Wtd median (nonzero)
SIPP (individuals) 162.1 6.2% 0.0809 0.0876 0.0515
TMD (tax units) 128.2 16.4% 0.1486 0.1504 0.0928

Key observations:

  1. Prevalence is ~2.6× higher in TMD (16.4% vs 6.2%). This is the direct effect of convert_zero_prob=0.073, which converts 7.3% of zeros to nonzero, plus the married-couple expansion (married TMD units get two individual draws, so either head or spouse having nonzero overtime makes the tax unit nonzero).

  2. Mean fraction among nonzero is ~1.8× higher in TMD (0.149 vs 0.081). This reflects scale=2.6 combined with the 0.5 cap (which compresses the upper tail — without the cap, the ratio would be closer to 2.6×).

  3. Dollar aggregates diverge sharply: SIPP $63B vs TMD $238B (3.8× ratio). The combination of more nonzero records and higher fractions, applied to TMD's wage base, produces this amplification. This is by design — the calibration targets TPC estimates of total overtime deductions.

  4. Cell-level patterns: In SIPP, overtime prevalence is fairly uniform across cells (4–9%). In TMD, married units show much higher prevalence (17–43%) than unmarried (12–15%), likely because the two-individual expansion doubles the chance of getting a nonzero imputation.

10B. Tip fraction: SIPP vs TMD

Source Weighted pop (M) % nonzero (wtd) Wtd mean (nonzero) Wtd std (nonzero) Wtd median (nonzero)
SIPP (individuals) 162.1 2.7% 0.1660 0.1546 0.1082
TMD (tax units) 128.2 5.4% 0.1711 0.1602 0.1064

Key observations:

  1. Prevalence roughly doubled (5.4% vs 2.7%). The light calibration (convert_zero_prob=0.012, scale=1.1) plus the married-couple expansion accounts for this.

  2. Mean fractions are nearly identical (0.171 vs 0.166). The scale=1.1 barely changes the distribution shape. This is a much closer match than overtime.

  3. Dollar aggregates: SIPP $33B vs TMD $62B (1.9× ratio). The amplification comes primarily from the prevalence doubling, not from fraction inflation.

  4. Age gradient preserved: Both SIPP and TMD show younger workers (<25) having the highest tip prevalence (7–10%), consistent with food-service employment patterns.

10C. Auto loan interest: CEX vs TMD

Source Weighted pop (M) % nonzero (wtd) Wtd mean (nonzero) Wtd std (nonzero) Wtd median (nonzero)
CEX (consumer units) 134.6 21.1% $557 $611 $355
TMD (tax units) 184.0 19.3% $509 $586 $322

Key observations:

  1. Distributions are remarkably similar — consistent with scale=1.0 and convert_zero_prob=0.0 (no post-imputation adjustment). The MICE algorithm is transferring the CEX distribution to TMD with minimal distortion.

  2. Weighted totals: CEX $15.8B vs TMD $18.0B. The difference arises because TMD has a larger weighted population (184M vs 135M tax units), not from distributional changes.

  3. Cell-level patterns preserved: Married units have higher prevalence (~25–31% in both) than unmarried (~9–22%), and middle-aged units (45-54) have the highest mean amounts. These patterns transfer cleanly from CEX to TMD.

  4. This confirms the Q9 concern: The raw CEX data flows through essentially unchanged, meaning all the conceptual mismatches identified in Q9 (new vehicles only, US-assembled, interest vs. finance charges) remain unaddressed in the TMD output.

10D. Correlations

Pair SIPP TMD Comment
overtime_frac, tip_frac −0.015 −0.025 Both show weak negative — having overtime slightly reduces tip likelihood. Preserved.
overtime_frac, age −0.004 +0.003 Near zero in both. No age gradient for overtime.
overtime_frac, e00200 +0.033 +0.006 Weak positive in SIPP, nearly zero in TMD. Some attenuation.
tip_frac, age −0.080 −0.080 Identical. Young workers get more tips. Well preserved.
tip_frac, e00200 −0.026 −0.011 Both negative (tipped workers earn less). Some attenuation in TMD.
Pair CEX TMD Comment
ALI, age −0.087 −0.028 Both negative (younger = more car loans). Attenuated in TMD.
ALI, income +0.107 +0.025 Both positive (higher income = more car spending). Substantially attenuated in TMD.

Correlation observations:

  1. Sign preservation is perfect — every correlation has the same sign in source and TMD. The MICE algorithm preserves the directional relationships.

  2. Magnitude is systematically attenuated — TMD correlations are weaker than source correlations, especially for ALI. This is expected: MICE with ExtraTreeRegressor produces noisier imputed values than the true donor relationships, and the random sampling within tree leaves adds variance.

  3. tip_frac vs age is remarkably well preserved (−0.080 in both SIPP and TMD), suggesting age is a strong predictor that the tree captures well.

  4. ALI correlations are most attenuated — the CEX→TMD transfer weakens the ALI-income correlation from +0.11 to +0.02. This may reflect the different income definitions (CEX FINCBTAX vs TMD constructed income) and the population mismatch between consumer units and tax units.

10E. Population comparison notes

  • SIPP weighted population (162M individuals) is larger than TMD wage-earning tax units (128M) because SIPP counts all wage-earning individuals including those who are spouses within a married tax unit. Each married TMD tax unit may correspond to two SIPP individuals.
  • CEX weighted population (135M consumer units) is smaller than TMD total tax units (184M) because consumer units approximate households, which can contain multiple tax-filing units (e.g., adult children filing separately).
  • These population differences mean weighted dollar aggregates are not directly comparable. The distributional statistics (fractions, percentages, correlations) are more meaningful comparisons.

@martinholmer
Copy link
Collaborator Author

@donboyd5 said in an above comment:

There are three areas where I think improvements might be worth doing before merging:

  1. Application of convert_zero_prob: ---[SNIP]---

  2. Auto loan interest (see Q7 item 7C, below): ---[SNIP]---

  3. Overtime pay premium -- see Q7 item 7A, and also Q8: ---[SNIP]---

Commits 4f595a9 and 95143a9 respond to the above item 1.

@donboyd5
Copy link
Collaborator

@martinholmer, thanks for opening issues #398 and #399.

With the two new commits addressing item 1 above, the only test failures are those below, which are extremely close to passing with current tolerances.

E           ValueError: 
E           IMPUTED VARIABLE DEDUCTION BENEFIT ACT-vs-EXP DIFFS:
E           DIFF:OTM,totben,act,exp,atol,rtol= 23.91 23.88 0.01 0.0001
E           DIFF:ALL,totben,act,exp,atol,rtol= 55.08 55.01 0.01 0.0001

@donboyd5
Copy link
Collaborator

@martinholmer, please see issue #400.

I suggest that I address that right after you merge this PR. There is a good chance that implementing the proposed steps in #400 will reduce or eliminate the need to worry about cross-machine differences, and I think reweighting should also then run much more quickly on CPU-only machines.

@donboyd5
Copy link
Collaborator

All tests now pass after commit:

Loosen totben relative tolerance in test_obbba_deduction_tax_benefits

The tail end of output is below:

Writing PUF+CPS file... [/home/donboyd5/Documents/mixed_projects/tax-microdata-benchmarking/tmd/storage/output/tmd.csv.gz]
python tmd/create_taxcalc_sampling_weights.py
python tmd/create_taxcalc_growth_factors.py
python tmd/create_taxcalc_cached_files.py
python tmd/create_taxcalc_imputed_variables.py
Preparing data for imputation...
Imputing overtime and tip data from SIPP to TMD...
Imputing auto loan interest data from CEX to TMD...
Writing preimpute TMD file... [/home/donboyd5/Documents/mixed_projects/tax-microdata-benchmarking/tmd/storage/output/preimpute_tmd.csv.gz]
Writing augmented TMD file... [/home/donboyd5/Documents/mixed_projects/tax-microdata-benchmarking/tmd/storage/output/tmd.csv.gz]
pytest . -v -n4
================================================================================================== test session starts ===================================================================================================
platform linux -- Python 3.12.3, pytest-8.4.2, pluggy-1.6.0 -- /home/donboyd5/Documents/mixed_projects/tax-microdata-benchmarking/.venv/bin/python3
cachedir: .pytest_cache
rootdir: /home/donboyd5/Documents/mixed_projects/tax-microdata-benchmarking
configfile: pytest.ini
plugins: xdist-3.8.0
4 workers [46 items]    
scheduling tests via LoadScheduling

tests/test_area_weights.py::test_area_xx 
tests/test_mice.py::TestConstructorValidation::test_x_var_validation 
tests/test_mice.py::TestConstructorValidation::test_valid_minimal_constructor 
tests/test_imputed_variables.py::test_obbba_deduction_tax_benefits 
[gw2] [  2%] PASSED tests/test_mice.py::TestConstructorValidation::test_valid_minimal_constructor 
[gw3] [  4%] PASSED tests/test_mice.py::TestConstructorValidation::test_x_var_validation 
tests/test_mice.py::TestConstructorValidation::test_x_obs_validation 
tests/test_mice.py::TestConstructorValidation::test_x_idx_validation 
[gw2] [  6%] PASSED tests/test_mice.py::TestConstructorValidation::test_x_obs_validation 
tests/test_mice.py::TestConstructorValidation::test_x_ign_validation 
[gw3] [  8%] PASSED tests/test_mice.py::TestConstructorValidation::test_x_idx_validation 
tests/test_mice.py::TestConstructorValidation::test_min_leaf_node_size_validation 
[gw2] [ 10%] PASSED tests/test_mice.py::TestConstructorValidation::test_x_ign_validation 
tests/test_mice.py::TestConstructorValidation::test_seed_validation 
[gw3] [ 13%] PASSED tests/test_mice.py::TestConstructorValidation::test_min_leaf_node_size_validation 
tests/test_mice.py::TestConstructorValidation::test_iters_validation 
[gw2] [ 15%] PASSED tests/test_mice.py::TestConstructorValidation::test_seed_validation 
[gw3] [ 17%] PASSED tests/test_mice.py::TestConstructorValidation::test_iters_validation 
tests/test_mice.py::TestConstructorValidation::test_min_node_split_size_validation 
tests/test_mice.py::TestConstructorValidation::test_monotone_validation 
[gw2] [ 19%] PASSED tests/test_mice.py::TestConstructorValidation::test_min_node_split_size_validation 
tests/test_mice.py::TestConstructorValidation::test_adjustment_parameters_require_monotone 
[gw3] [ 21%] PASSED tests/test_mice.py::TestConstructorValidation::test_monotone_validation 
tests/test_mice.py::TestBasicImputation::test_simple_imputation_single_missing_value 
[gw2] [ 23%] PASSED tests/test_mice.py::TestConstructorValidation::test_adjustment_parameters_require_monotone 
tests/test_mice.py::TestConstructorValidation::test_adjustment_parameter_lengths 
[gw2] [ 26%] PASSED tests/test_mice.py::TestConstructorValidation::test_adjustment_parameter_lengths 
tests/test_mice.py::TestConstructorValidation::test_properties 
[gw2] [ 28%] PASSED tests/test_mice.py::TestConstructorValidation::test_properties 
tests/test_mice.py::TestBasicImputation::test_all_missing_values_imputed 
[gw3] [ 30%] PASSED tests/test_mice.py::TestBasicImputation::test_simple_imputation_single_missing_value 
tests/test_mice.py::TestBasicImputation::test_imputation_preserves_non_missing_values 
[gw2] [ 32%] PASSED tests/test_mice.py::TestBasicImputation::test_all_missing_values_imputed 
tests/test_mice.py::TestBasicImputation::test_imputation_with_ignored_variables 
[gw3] [ 34%] PASSED tests/test_mice.py::TestBasicImputation::test_imputation_preserves_non_missing_values 
tests/test_mice.py::TestBasicImputation::test_get_ival_stats_shape 
[gw2] [ 36%] PASSED tests/test_mice.py::TestBasicImputation::test_imputation_with_ignored_variables 
tests/test_mice.py::TestBasicImputation::test_impute_validates_missing_pattern 
[gw3] [ 39%] PASSED tests/test_mice.py::TestBasicImputation::test_get_ival_stats_shape 
[gw2] [ 41%] PASSED tests/test_mice.py::TestBasicImputation::test_impute_validates_missing_pattern 
tests/test_mice.py::TestBasicImputation::test_impute_validates_input_shape 
tests/test_mice.py::TestMonotoneMode::test_monotone_mode_basic 
[gw3] [ 43%] PASSED tests/test_mice.py::TestBasicImputation::test_impute_validates_input_shape 
tests/test_mice.py::TestMonotoneMode::test_monotone_detects_non_monotone_pattern 
[gw2] [ 45%] PASSED tests/test_mice.py::TestMonotoneMode::test_monotone_mode_basic 
tests/test_mice.py::TestMonotoneMode::test_non_monotone_mode_performs_initialization 
[gw3] [ 47%] PASSED tests/test_mice.py::TestMonotoneMode::test_monotone_detects_non_monotone_pattern 
tests/test_mice.py::TestMonotoneMode::test_monotone_mode_skips_initialization 
[gw2] [ 50%] PASSED tests/test_mice.py::TestMonotoneMode::test_non_monotone_mode_performs_initialization 
[gw3] [ 52%] PASSED tests/test_mice.py::TestMonotoneMode::test_monotone_mode_skips_initialization 
tests/test_mice.py::TestMonotoneMode::test_monotone_mode_with_scale_adjustment 
tests/test_mice.py::TestMonotoneMode::test_monotone_mode_with_shift_adjustment 
[gw3] [ 54%] PASSED tests/test_mice.py::TestMonotoneMode::test_monotone_mode_with_scale_adjustment 
[gw2] [ 56%] PASSED tests/test_mice.py::TestMonotoneMode::test_monotone_mode_with_shift_adjustment 
tests/test_mice.py::TestMonotoneMode::test_monotone_mode_with_fewer_zeros_adjustment 
tests/test_mice.py::TestMonotoneMode::test_monotone_mode_with_more_zeros_adjustment 
[gw2] [ 58%] PASSED tests/test_mice.py::TestMonotoneMode::test_monotone_mode_with_fewer_zeros_adjustment 
tests/test_mice.py::TestReproducibility::test_same_seed_produces_identical_results 
[gw3] [ 60%] PASSED tests/test_mice.py::TestMonotoneMode::test_monotone_mode_with_more_zeros_adjustment 
tests/test_mice.py::TestReproducibility::test_different_seeds_produce_different_results 
[gw2] [ 63%] PASSED tests/test_mice.py::TestReproducibility::test_same_seed_produces_identical_results 
tests/test_mice.py::TestReproducibility::test_statistics_reproducible_with_same_seed 
[gw3] [ 65%] PASSED tests/test_mice.py::TestReproducibility::test_different_seeds_produce_different_results 
tests/test_mice.py::TestReproducibility::test_seed_increment_across_iterations 
[gw3] [ 67%] PASSED tests/test_mice.py::TestReproducibility::test_seed_increment_across_iterations 
tests/test_misc.py::test_no_negative_weights 
[gw2] [ 69%] PASSED tests/test_mice.py::TestReproducibility::test_statistics_reproducible_with_same_seed 
tests/test_mice.py::TestReproducibility::test_multiple_imputation_with_different_seeds 
[gw2] [ 71%] PASSED tests/test_mice.py::TestReproducibility::test_multiple_imputation_with_different_seeds 
tests/test_misc.py::test_population 
[gw3] [ 73%] PASSED tests/test_misc.py::test_no_negative_weights 
tests/test_misc.py::test_partnership_s_corp_income 
[gw3] [ 76%] PASSED tests/test_misc.py::test_partnership_s_corp_income 
tests/test_tax_expenditures.py::test_tax_exp_diffs 
[gw2] [ 78%] PASSED tests/test_misc.py::test_population 
tests/test_misc.py::test_income_tax 
[gw2] [ 80%] PASSED tests/test_misc.py::test_income_tax 
tests/test_tmd_stats.py::test_tmd_stats 
[gw2] [ 82%] SKIPPED tests/test_tmd_stats.py::test_tmd_stats 
tests/test_variable_totals.py::test_variable_totals 
[gw2] [ 84%] PASSED tests/test_variable_totals.py::test_variable_totals 
tests/test_weights.py::test_weights 
[gw2] [ 86%] PASSED tests/test_weights.py::test_weights 
[gw1] [ 89%] PASSED tests/test_imputed_variables.py::test_obbba_deduction_tax_benefits 
tests/test_imputed_variables.py::test_imputed_variable_distribution 
[gw1] [ 91%] PASSED tests/test_imputed_variables.py::test_imputed_variable_distribution 
[gw3] [ 93%] PASSED tests/test_tax_expenditures.py::test_tax_exp_diffs 
tests/test_tax_revenue.py::test_tax_revenue 
[gw3] [ 95%] PASSED tests/test_tax_revenue.py::test_tax_revenue 
[gw0] [ 97%] PASSED tests/test_area_weights.py::test_area_xx 
tests/test_create_tmd_variables.py::test_create_file 
[gw0] [100%] SKIPPED tests/test_create_tmd_variables.py::test_create_file 

@martinholmer
Copy link
Collaborator Author

@donboyd5, Now that we are both passing all the tests on our computers, PR #397 is ready to merge.
Do you want to do that?

@donboyd5 donboyd5 merged commit e858ec7 into master Feb 16, 2026
1 check passed
@donboyd5 donboyd5 deleted the impute-obbba-vars branch February 16, 2026 23:03
@donboyd5
Copy link
Collaborator

Done, @martinholmer. I will start working on #400 after I finish certain must-do things tomorrow. I don't think it should take too long. It would be nice to get to the point where cross-machine differences are so small as to be unnoticeable (and to have faster optimization); this seems possible. Would definitely appreciate your review once I have a PR.

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.

Impute values for overtime_income, tip_income, and auto_loan_interest

2 participants