Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CPS and PUF input data files and many test results #2032

Merged
merged 5 commits into from
Jul 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion puf_fuzz.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
DROP_VARS = set(['filer'])
else:
DROP_VARS = set(['filer', 's006', 'cmbtp',
'nu05', 'nu13', 'elderly_dependent',
'nu05', 'nu13', 'elderly_dependents',
'e09700', 'e09800', 'e09900', 'e11200'])

# specify set of variables whose values are not to be randomized
Expand Down
10 changes: 10 additions & 0 deletions taxcalc/calculate.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,16 @@ def array(self, variable_name, variable_value=None):
setattr(self.__records, variable_name, variable_value)
return None

def n65(self):
"""
Return numpy ndarray containing the number of
individuals age 65+ in each filing unit.
"""
vdf = self.dataframe(['age_head', 'age_spouse', 'elderly_dependents'])
return ((vdf['age_head'] >= 65).astype(int) +
(vdf['age_spouse'] >= 65).astype(int) +
vdf['elderly_dependents'])

def incarray(self, variable_name, variable_add):
"""
Add variable_add to named variable in embedded Records object.
Expand Down
Binary file modified taxcalc/cps.csv.gz
Binary file not shown.
Binary file modified taxcalc/cps_benefits.csv.gz
Binary file not shown.
Binary file modified taxcalc/cps_weights.csv.gz
Binary file not shown.
6 changes: 3 additions & 3 deletions taxcalc/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def EI_PayrollTax(SS_Earnings_c, e00200, e00200p, e00200s,


@iterate_jit(nopython=True)
def DependentCare(nu13, elderly_dependent, earned,
def DependentCare(nu13, elderly_dependents, earned,
MARS, ALD_Dependents_thd, ALD_Dependents_hc,
ALD_Dependents_Child_c, ALD_Dependents_Elder_c,
care_deduction):
Expand All @@ -151,7 +151,7 @@ def DependentCare(nu13, elderly_dependent, earned,
Parameters
----------
nu13: Number of dependents under 13 years old
elderly_dependent: 1 if unit has an elderly dependent; 0 otherwise
elderly_dependents: number of elderly dependents
earned: Form 2441 earned income amount
MARS: Marital Status
ALD_Dependents_thd: Maximum income to qualify for deduction
Expand All @@ -167,7 +167,7 @@ def DependentCare(nu13, elderly_dependent, earned,
if earned <= ALD_Dependents_thd[MARS - 1]:
care_deduction = (((1. - ALD_Dependents_hc) * nu13 *
ALD_Dependents_Child_c) +
((1. - ALD_Dependents_hc) * elderly_dependent *
((1. - ALD_Dependents_hc) * elderly_dependents *
ALD_Dependents_Elder_c))
else:
care_deduction = 0.
Expand Down
34 changes: 17 additions & 17 deletions taxcalc/puf_ratios.csv
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
agi_bin,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18
INT2011,1.04293274548,0.261601609152,1.02183824659,1.00964810134,1.00235978694,0.96454382042,0.851425980553,0.914485668701,0.990224230507,0.936916183475,0.956810171336,0.955820939545,0.963099283056,0.9650931857,0.982882336233,0.984266269724,0.970725683428,1.02859223823,1.7309169297
INT2012,0.764005978831,0.884556803871,0.708794484323,0.752244394942,0.653815984688,0.749257208761,0.723808978743,0.737323446954,0.799487210696,0.883758115638,0.892677787037,0.946332015922,1.07987807315,1.03943575384,1.01015737833,1.12767420865,1.10835082517,1.26666151332,1.58795345018
INT2013,1.13621930878,0.784629770857,0.769501910471,0.77082840478,0.887701461075,0.869649912688,0.937673177353,0.903083675888,0.837467932725,0.862239239869,0.988202970724,1.06737542817,1.04269332264,1.05304390442,1.07607916281,0.961578380308,1.03852994879,0.938679161601,1.10364877524
INT2014,0.908671279961,0.901259383718,0.876216034968,0.769532698749,0.853547661303,0.878009109688,0.98512119331,0.860866491749,0.824241827237,1.01093167788,0.823076411184,1.04162420486,1.03553097628,0.94430893205,1.08207121267,1.15823937795,1.07504414767,1.09228119001,1.08983566994
INT2015,0.997294673541,0.987129478648,0.972978116293,0.973988353417,0.982933554061,0.973311375879,0.981439214971,0.990212520862,0.985294187203,0.985046865192,1.01829491412,1.02421654167,0.998050607573,0.994082028314,0.989188751654,0.98736710949,1.00388385743,1.0085219623,1.02921525519
INT2016,0.996533041298,0.999421012425,0.972224858257,0.966948989283,0.980516164521,0.96574183664,0.984626414723,0.984957136712,0.977548980581,0.984592216153,1.00245885796,1.02415625891,0.998379478612,0.997268956688,0.998590865523,0.990567617455,1.00149249612,1.05004558372,1.0297404879
INT2017,0.9876325739,0.996712488717,0.956313757887,0.973323005622,0.972091373923,0.972951555971,0.976006363149,0.979499221272,0.976706563259,0.988171208174,0.999645261162,1.01897094988,1.00937141569,0.998500355929,0.991990243264,0.988975789833,0.999048973207,1.02738825047,1.07112749173
INT2018,0.999394375642,1.0023092724,0.966578161134,0.970083558021,0.974490347752,0.965453011796,0.980807920857,0.995126393774,0.982983449315,0.994821289928,1.00149567794,1.01010072688,1.00790238671,0.999096184656,1.00460695239,0.992711588378,0.997769367333,1.0499964418,1.02232268863
INT2019,0.990901916495,1.00053478503,0.973414173414,0.970913964991,0.977037775967,0.984896055971,0.981993836951,0.98573754099,0.995488003877,1.00006511012,1.00234697198,1.01188621713,1.00477522572,0.993989264819,1.00468548013,0.986874513083,0.999736321796,1.01547316019,1.04425494957
INT2020,0.996047679722,0.992243634252,0.978461885827,0.977518889241,0.974533370388,0.984224666395,0.990163816301,0.997656662798,0.995254254801,1.00220285095,1.01503785718,1.00332899775,1.0036400076,1.00136766509,0.989351368109,0.987569070527,1.0031254924,1.02028927294,1.01933679314
INT2021,1.00022478788,0.997378199948,0.976740691587,0.971882723932,0.981850065451,0.98077181633,0.982897469877,1.00688113518,1.01082588146,0.998803096369,1.01099660254,0.999311157916,1.00088316215,1.00558918605,1.00066653428,0.988152264136,1.01150388614,1.0114090273,1.00487684999
INT2022,0.992640764788,0.997529855963,0.973669525387,0.979048967506,0.98152062822,0.985062854662,1.02334836039,1.00727829589,0.995990396839,0.993081562561,1.0132586164,1.00453253088,1.00103011774,0.998027246981,0.994212431823,0.992563462271,1.00150559128,1.01530445026,1.01852605736
INT2023,1.00391792327,1.00284904843,0.986409297715,0.974958911754,0.980926301201,0.986571179284,0.993760388487,0.985408676025,0.990656221996,1.0064892894,1.01400843435,1.00476053827,1.00265412981,0.999269421789,0.994316250193,0.989423513359,1.00528704094,1.00432945333,1.00907261041
INT2024,0.995338874809,0.990239436806,0.984603949991,0.985132094504,0.986525123938,0.985738111359,1.00645162175,0.996758811196,0.997765508268,1.00084205912,1.00419139555,1.00361253385,1.00526483735,1.0002452637,0.993757309595,0.992238238939,1.00413604899,1.01714517278,1.01143857857
INT2025,1.01424038019,0.993368385523,0.976510096692,0.985866315708,0.980407977435,0.991058681846,0.997908187278,0.986413844689,1.00029318976,1.00878316611,1.0021964238,1.00056917157,1.00368733105,0.993555167696,0.995806696596,0.995669970618,1.00448225896,1.01397075783,1.01059978464
INT2026,0.990383358252,0.991439120992,0.979454563299,0.989955990303,0.986219203951,0.982372817131,0.986048445788,0.995923498336,1.00090074599,1.01530239055,1.00238254111,1.00240964012,1.00211445231,0.999420950311,0.992961673251,0.998582713268,1.00194266494,1.02449154324,1.01449727835
INT2027,1.00300087165,0.99353197164,0.97436773496,0.981639109415,0.983738950465,0.989167977417,0.994099171614,0.987277114217,0.994115201503,1.00682179886,1.00123811066,1.00223529529,1.00587923692,1.00155579585,0.992479530393,1.00755301336,1.00899972225,1.01126114006,1.01288207408
INT2011,1.0429,0.2616,1.0218,1.0096,1.0024,0.9645,0.8514,0.9145,0.9902,0.9369,0.9568,0.9558,0.9631,0.9651,0.9829,0.9843,0.9707,1.0286,1.7309
INT2012,0.7653,0.8928,0.6996,0.7396,0.6468,0.7431,0.7238,0.7344,0.8028,0.8844,0.8969,0.9526,1.0738,1.0387,1.0047,1.1284,1.1019,1.2722,1.5964
INT2013,1.1353,0.7847,0.7730,0.7681,0.8999,0.8659,0.9471,0.9036,0.8355,0.8674,0.9906,1.0457,1.0436,1.0628,1.0833,0.9623,1.0444,0.9717,1.0910
INT2014,0.9048,0.9439,0.8866,0.7840,0.8577,0.8749,0.9880,0.8735,0.8301,0.9928,0.8270,1.0341,1.0265,0.9358,1.0839,1.1567,1.0864,1.1381,1.0698
INT2015,0.9877,1.0122,0.9849,0.9668,0.9759,0.9806,0.9903,0.9800,0.9856,0.9961,0.9896,1.0040,1.0041,1.0124,1.0124,0.9926,1.0315,1.0490,0.9921
INT2016,0.9840,1.0978,0.9725,0.9469,0.9582,0.9684,0.9890,0.9833,0.9588,0.9737,0.9511,0.9436,0.9566,1.0915,1.1230,1.1852,1.1631,1.0920,1.0064
INT2017,1.0212,0.8990,0.9633,0.9825,0.9750,0.9744,0.9531,0.9738,1.0097,1.0096,1.0616,1.0831,1.0680,0.9326,0.8891,0.8315,0.8729,0.9689,1.0377
INT2018,0.9983,0.9965,0.9722,0.9612,0.9671,0.9755,0.9770,0.9777,0.9829,1.0029,0.9982,1.0084,1.0042,1.0055,0.9950,1.0078,1.0236,1.0253,1.0247
INT2019,1.0001,1.0089,0.9743,0.9651,0.9784,0.9752,0.9725,1.0020,0.9895,1.0013,0.9961,0.9960,1.0047,1.0121,1.0047,1.0029,1.0219,1.0125,1.0192
INT2020,0.9938,0.9834,0.9751,0.9772,0.9781,0.9832,0.9913,0.9886,0.9931,1.0019,1.0196,1.0142,1.0030,1.0002,0.9962,0.9951,1.0013,1.0002,1.0074
INT2021,1.0029,0.9915,0.9756,0.9808,0.9760,0.9843,0.9816,1.0103,0.9954,1.0038,1.0011,0.9964,1.0033,1.0043,1.0060,1.0127,1.0160,1.0033,1.0085
INT2022,1.0069,0.9889,0.9770,0.9731,0.9787,0.9800,0.9854,0.9917,0.9984,1.0052,0.9993,0.9879,1.0041,1.0185,1.0294,1.0171,1.0229,1.0119,0.9982
INT2023,0.9982,0.9862,0.9775,0.9881,0.9821,0.9904,1.0163,1.0019,0.9997,1.0017,1.0152,1.0125,1.0011,0.9879,0.9804,0.9787,0.9904,1.0016,1.0202
INT2024,1.0090,0.9952,0.9797,0.9762,0.9764,0.9793,1.0054,1.0084,1.0011,1.0012,0.9894,0.9891,1.0041,1.0220,1.0310,1.0305,1.0214,0.9977,0.9811
INT2025,1.0008,0.9899,0.9725,0.9792,0.9832,0.9894,0.9965,1.0027,1.0028,1.0030,1.0106,1.0112,1.0009,0.9912,0.9919,0.9847,0.9922,1.0053,1.0207
INT2026,1.0101,0.9930,0.9800,0.9797,0.9829,0.9840,0.9908,1.0113,1.0084,1.0015,0.9946,0.9934,1.0037,1.0087,1.0094,1.0148,1.0113,1.0122,0.9960
INT2027,1.0025,0.9914,0.9795,0.9821,0.9866,0.9871,0.9966,0.9971,0.9991,1.0024,1.0039,1.0027,1.0045,1.0019,0.9999,1.0010,1.0014,1.0074,1.0096
Binary file modified taxcalc/puf_weights.csv.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions taxcalc/records_variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,9 @@
"form": {"2013-2016": "8863 Part I line 10 and 8863 Part III line 31"},
"availability": "taxdata_puf"
},
"elderly_dependent": {
"elderly_dependents": {
"type": "int",
"desc": "1 if filing unit has a dependent age 65+; otherwise 0",
"desc": "number of dependents age 65+ in filing unit excluding taxpayer and spouse",
"form": {"2013-2016": "imputed from CPS data; not used in tax law"},
"availability": "taxdata_puf, taxdata_cps"
},
Expand Down
42 changes: 21 additions & 21 deletions taxcalc/tests/cpscsv_agg_expect.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
2014 2015 2016 2017 2018 2019 2020 2021 2022 2023
Returns (#m) 163.0 163.2 165.4 167.6 169.9 172.2 174.5 176.9 179.3 181.7
AGI ($b) 8,930.1 9,277.7 9,567.5 10,049.9 10,590.6 11,094.3 11,598.1 12,140.3 12,717.5 13,317.0
Itemizers (#m) 61.6 63.3 65.6 67.8 69.6 71.2 72.7 74.3 75.9 77.6
Itemized Deduction ($b) 1,218.1 1,294.5 1,367.1 1,446.4 1,529.9 1,615.5 1,702.0 1,796.4 1,896.0 1,999.5
Standard Deduction Filers (#m) 101.3 99.9 99.8 99.8 100.3 101.0 101.8 102.6 103.3 104.1
Standard Deduction ($b) 883.3 883.7 882.0 887.1 911.1 936.4 964.6 993.5 1,024.3 1,055.6
Personal Exemption ($b) 1,229.5 1,246.3 1,279.1 1,295.3 1,341.4 1,389.3 1,440.0 1,493.5 1,549.9 1,607.4
Taxable Income ($b) 6,195.5 6,452.7 6,649.2 7,034.7 7,440.5 7,805.1 8,163.8 8,550.7 8,964.1 9,394.5
Regular Tax ($b) 1,147.6 1,170.0 1,207.0 1,283.0 1,368.3 1,445.4 1,519.6 1,600.0 1,684.4 1,770.9
AMT Income ($b) 8,238.5 8,543.5 8,792.0 9,228.7 9,720.4 10,174.2 10,627.6 11,114.7 11,633.6 12,172.3
AMT Liability ($b) 10.2 12.7 13.9 15.5 16.0 16.4 17.0 17.8 18.7 19.8
AMT Filers (#m) 2.8 3.2 3.4 3.7 3.9 4.0 4.1 4.2 4.4 4.5
Tax before Credits ($b) 1,157.8 1,182.6 1,220.9 1,298.5 1,384.3 1,461.8 1,536.7 1,617.8 1,703.1 1,790.7
Refundable Credits ($b) 79.8 79.0 78.5 77.7 79.2 81.1 83.2 85.4 87.5 89.6
Nonrefundable Credits ($b) 31.2 31.1 31.5 31.9 31.9 31.9 31.9 31.9 31.8 31.7
Returns (#m) 149.4 155.1 157.6 160.3 162.9 165.3 167.5 169.7 171.9 174.1
AGI ($b) 8,459.1 9,734.0 10,003.0 10,462.2 10,981.2 11,458.1 11,929.5 12,437.7 12,977.2 13,535.8
Itemizers (#m) 57.6 64.6 66.8 68.9 70.5 71.8 73.0 74.2 75.4 76.7
Itemized Deduction ($b) 1,142.0 1,319.9 1,389.7 1,465.6 1,545.2 1,624.4 1,703.0 1,788.0 1,877.6 1,970.9
Standard Deduction Filers (#m) 91.8 90.5 90.8 91.3 92.4 93.5 94.5 95.5 96.5 97.4
Standard Deduction ($b) 798.1 813.4 815.7 825.9 854.4 883.7 914.7 946.5 979.4 1,012.0
Personal Exemption ($b) 1,172.4 1,230.9 1,263.0 1,279.9 1,325.6 1,371.5 1,418.9 1,468.6 1,520.3 1,572.4
Taxable Income ($b) 5,874.2 6,879.5 7,058.6 7,424.4 7,813.8 8,162.0 8,502.7 8,871.6 9,265.9 9,675.9
Regular Tax ($b) 1,109.5 1,298.8 1,332.8 1,405.6 1,489.4 1,565.8 1,639.8 1,719.8 1,804.4 1,891.0
AMT Income ($b) 7,814.3 8,992.8 9,222.1 9,637.8 10,110.3 10,541.2 10,967.3 11,426.8 11,914.7 12,419.5
AMT Liability ($b) 10.9 14.3 15.7 17.5 18.1 18.6 19.3 20.1 21.1 22.2
AMT Filers (#m) 3.0 3.8 4.0 4.3 4.5 4.7 4.8 4.9 5.1 5.2
Tax before Credits ($b) 1,120.4 1,313.1 1,348.5 1,423.1 1,507.5 1,584.4 1,659.1 1,739.9 1,825.4 1,913.3
Refundable Credits ($b) 67.2 68.4 67.3 65.8 66.5 67.5 68.6 69.8 71.0 71.9
Nonrefundable Credits ($b) 26.7 27.0 27.2 27.6 27.5 27.3 27.0 26.8 26.4 26.1
Reform Surtaxes ($b) 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
Other Taxes ($b) 6.0 7.0 7.1 7.4 8.0 8.5 9.1 9.7 10.3 11.0
Ind Income Tax ($b) 1,052.8 1,079.5 1,117.9 1,196.3 1,281.1 1,357.4 1,430.7 1,510.3 1,594.1 1,680.4
Payroll Taxes ($b) 997.0 1,031.6 1,074.0 1,133.9 1,192.6 1,247.7 1,300.3 1,356.4 1,417.6 1,482.5
Combined Liability ($b) 2,049.8 2,111.1 2,191.9 2,330.2 2,473.8 2,605.1 2,731.0 2,866.7 3,011.7 3,162.9
With Income Tax <= 0 (#m) 67.2 66.3 66.5 66.4 66.7 67.1 67.7 68.2 68.7 69.2
With Combined Tax <= 0 (#m) 43.8 43.3 43.5 43.5 43.8 44.2 44.5 44.9 45.3 45.6
Other Taxes ($b) 6.7 7.8 7.8 8.0 8.5 9.1 9.6 10.2 10.8 11.4
Ind Income Tax ($b) 1,033.2 1,225.6 1,261.8 1,337.7 1,422.1 1,498.7 1,573.0 1,653.5 1,738.8 1,826.6
Payroll Taxes ($b) 933.0 1,069.6 1,107.9 1,165.7 1,220.5 1,270.4 1,316.6 1,365.6 1,418.8 1,475.0
Combined Liability ($b) 1,966.2 2,295.1 2,369.7 2,503.4 2,642.6 2,769.1 2,889.6 3,019.1 3,157.6 3,301.6
With Income Tax <= 0 (#m) 58.0 54.0 54.6 55.0 55.8 56.7 57.6 58.4 59.2 60.0
With Combined Tax <= 0 (#m) 36.0 34.9 35.4 35.9 36.6 37.4 38.2 39.0 39.8 40.5
Loading