PSLmodels / tax-microdata-benchmarking

A project to develop a benchmarked general-purpose dataset for tax reform impact analysis.
https://pslmodels.github.io/tax-microdata-benchmarking/
2 stars 6 forks source link

Tax-Calc compatibility issues with the " * 100 " scaling of weights #285

Closed towashington closed 2 weeks ago

towashington commented 3 weeks ago

I noticed that, when using the TMD file in Tax-Calc, the unit of revenue estimates is a hundred dollars, instead of a dollar. After a little digging, I was wondering if it's related to line 29 here, which used to be scaled up by 100 times for compatibility in Tax-Calc, but no longer. Is that right? And if so, is it in the road map to add the 100 scaling back?

martinholmer commented 3 weeks ago

In issue #285, @towashington said:

I noticed that, when using the TMD file in Tax-Calc, the unit of revenue estimates is a hundred dollars, instead of a dollar. After a little digging, I was wondering if it's related to line 29 here, which used to be scaled up by 100 times for compatibility in Tax-Calc, but no longer. Is that right? And if so, is it in the road map to add the 100 scaling back?

Thanks for your questions.

Yes, since PR #264 was merged about two weeks ago, the TMD weights are being handled differently. The increase precision is to support subnational area weights. And Tax-Calculator has been revised to handle the TMD weights that are not scaled by 100.

Here is how to get up-to-date on your computer: (1) Create a Tax-Calculator package using the most recent Tax-Calculator source code. (2) Create the three tmd_* data files using the most recent TMD source code.

Step (1) involves executing these commands:

Tax-Calculator% conda activate taxcalc-dev
(taxcalc-dev) Tax-Calculator% ./gitsync
(taxcalc-dev) Tax-Calculator% make package

Step (2) involves updating the tax-microdata source code and executing make data as described here. On my computer the size of the three data files are:

-rw-r--r--  1 mrh  staff  12133178 Nov  5 14:32 tmd.csv.gz
-rw-r--r--  1 mrh  staff     12611 Oct 26 19:29 tmd_growfactors.csv
-rw-r--r--  1 mrh  staff  52609134 Nov  5 14:32 tmd_weights.csv.gz

As you can see, the tmd_weights.csv.gz file is now much larger because the unscaled weights are being stored as floats with five digits after the decimal point.

Please let us know whether or not doing these things resolves your problem.

martinholmer commented 3 weeks ago

@towashington, I forgot to mention the following about the new version of Tax-Calculator if you are using the Python API (rather than the command-line tool tc):

Using the Records.tmd_constructor is strongly recommended.

towashington commented 3 weeks ago

Thank, Martin. I must have run the model after the latest tmd code change but before the latest taxcalc code change. I’ll implement your suggestion and circle back if I run into any issues. Thanks again!

martinholmer commented 2 weeks ago

@towashington, Have you been able to resolve the problem you reported in TMD issue #285?

martinholmer commented 2 weeks ago

@towashington, Tax-Calculator 4.3.2 is now publicly available. That means you should be able to solve the problem you reported in TMD issue #285 by doing this:

% pip install --upgrade taxcalc

After doing this, tc --version should show 4.3.2.

I'm going to close issue #285 now. But if you cannot resolve your problem, please open a new issue with details.

towashington commented 2 weeks ago

Just confirming that the issue is resolved with the Tax-Calc update. Thanks, @martinholmer!

martinholmer commented 2 weeks ago

@towashington said in issue #285:

Just confirming that the issue is resolved with the Tax-Calc update.

Good to hear this! Thanks for the feedback.