Skip to content

Commit

Permalink
Merge pull request #1871 from martinholmer/new-puf-data
Browse files Browse the repository at this point in the history
Use new 2011 PUF data in Tax-Calculator
  • Loading branch information
martinholmer authored Feb 13, 2018
2 parents 6a5502c + ab6f0cf commit 0f718eb
Show file tree
Hide file tree
Showing 22 changed files with 249,443 additions and 215,864 deletions.
5 changes: 5 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ for a complete commit history.
- Improve data quality of several existing CPS variables, which causes changes in CPS tax results
[[#1853](https://github.com/open-source-economics/Tax-Calculator/pull/1853)
by Anderson Frailey with assistance from Martin Holmer]
- Use 2011 PUF data (rather than the older 2009 PUF data), which causes changes in PUF tax results
[[#1871](https://github.com/open-source-economics/Tax-Calculator/pull/1871)
by Anderson Frailey and Martin Holmer], which requires new `puf.csv` input file with this information:
* Byte size: 54714632
* MD5 checksum: de4a59c9bce0a7d5e6c3110172237c9b

**New Features**
- Add ability to extrapolate imputed benefits and benefit-related policy parameters
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/consumption.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@

"_BEN_other_value": {
"long_name": "Consumption value of other benefits",
"description": "Consumption value per dollar of other benefits, some of which are in-kind benefits (somewhere between xx% and yy% are in-kind benefits).",
"description": "Consumption value per dollar of other benefits, some of which are in-kind benefits (somewhere between 52% and 76% are in-kind benefits).",
"section_1": "",
"section_2": "",
"notes": "",
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/filings/forms/us8863.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class US8863(TaxForm):
_DESCRIPTIVE_NAME = 'Education Credits'
_EVAR_MAP = {
'line4': 'e87530', # Lifetime Learning Total Qualified Exp.s
'line7': 'p87521', # Tentative American Opportunity Credit
'line7': 'e87521', # American Opportunity Credit
'line30': 'P87482', # AOC qualified expenses per student
}
_NUMERIC_NAME = 'Form 8863'
Expand Down
14 changes: 7 additions & 7 deletions taxcalc/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,7 @@ def EITCamount(phasein_rate, earnings, max_amount,

@iterate_jit(nopython=True)
def EITC(MARS, DSI, EIC, c00100, e00300, e00400, e00600, c01000,
p25470, e27200, age_head, age_spouse, earned, earned_p, earned_s,
e27200, age_head, age_spouse, earned, earned_p, earned_s,
EITC_ps, EITC_MinEligAge, EITC_MaxEligAge, EITC_ps_MarriedJ,
EITC_rt, EITC_c, EITC_prt, EITC_InvestIncome_c, EITC_indiv,
c59660):
Expand All @@ -1156,7 +1156,7 @@ def EITC(MARS, DSI, EIC, c00100, e00300, e00400, e00600, c01000,
if not EITC_indiv:
# filing-unit and number-of-kids based EITC (rather than indiv EITC)
invinc = (e00400 + e00300 + e00600 +
max(0., c01000) + max(0., (0. - p25470)) + max(0., e27200))
max(0., c01000) + max(0., e27200))
if MARS == 3 or DSI == 1 or invinc > EITC_InvestIncome_c:
c59660 = 0.
else:
Expand Down Expand Up @@ -1264,15 +1264,15 @@ def PersonalTaxCredit(MARS, c00100,


@iterate_jit(nopython=True)
def AmOppCreditParts(exact, p87521, num, c00100, CR_AmOppRefundable_hc,
def AmOppCreditParts(exact, e87521, num, c00100, CR_AmOppRefundable_hc,
CR_AmOppNonRefundable_hc, c10960, c87668):
"""
American Opportunity Credit (Form 8863) nonrefundable (c87668) and
refundable (c10960) parts
Logic corresponds to Form 8863, Part I
This function applies a phaseout to the Form 8863, line 1,
American Opportunity Credit amount, p87521, and then applies
American Opportunity Credit amount, e87521, and then applies
the 0.4 refundable rate.
Notes
Expand All @@ -1291,7 +1291,7 @@ def AmOppCreditParts(exact, p87521, num, c00100, CR_AmOppRefundable_hc,
----------
exact : whether or not to do rounding of phaseout fraction
p87521 : total tentative American Opportunity Credit for all students,
e87521 : total tentative American Opportunity Credit for all students,
Form 8863, line 1
num : number of people filing jointly
Expand All @@ -1310,14 +1310,14 @@ def AmOppCreditParts(exact, p87521, num, c00100, CR_AmOppRefundable_hc,
c87668 : Tentative nonrefundable part of American Opportunity Credit
"""
if p87521 > 0.:
if e87521 > 0.:
c87658 = max(0., 90000. * num - c00100)
c87660 = 10000. * num
if exact == 1: # exact calculation as on tax forms
c87662 = 1000. * min(1., round(c87658 / c87660, 3))
else:
c87662 = 1000. * min(1., c87658 / c87660)
c87664 = c87662 * p87521 / 1000.
c87664 = c87662 * e87521 / 1000.
c10960 = 0.4 * c87664 * (1. - CR_AmOppRefundable_hc)
c87668 = c87664 - c10960 * (1. - CR_AmOppNonRefundable_hc)
else:
Expand Down
4 changes: 2 additions & 2 deletions taxcalc/growdiff.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@

"_ASCHEI": {
"long_name": "ASCHEI additive difference from default projection",
"description": "Default projection is in growfactors.csv file. ASCHEI extrapolates input variables: e02000 when positive, and p25470, e26270, k1bx14p, k1bx14s and e27200 for all values.",
"description": "Default projection is in growfactors.csv file. ASCHEI extrapolates input variables: e02000 when positive, and e26270, k1bx14p, k1bx14s and e27200 for all values.",
"section_1": "",
"section_2": "",
"notes": "",
Expand Down Expand Up @@ -248,7 +248,7 @@

"_ATXPY": {
"long_name": "ATXPY additive difference from default projection",
"description": "Default projection is in growfactors.csv file. ATXPY extrapolates input variables: e00700, e00800, e01400, e01500, e01700, e03150, e03210, e03220, e03230, e03300, e03400, e03500, e07240, e07260, p08000, e09700, e09800, e09900, e11200, e18400, e18500, e19800, e20100, e20400, g20500, e07600, e32800, e58990, e62900, e87530, p87521 and cmbtp.",
"description": "Default projection is in growfactors.csv file. ATXPY extrapolates input variables: e00700, e00800, e01400, e01500, e01700, e03150, e03210, e03220, e03230, e03300, e03400, e03500, e07240, e07260, p08000, e09700, e09800, e09900, e11200, e18400, e18500, e19800, e20100, e20400, g20500, e07600, e32800, e58990, e62900, e87530, e87521 and cmbtp.",
"section_1": "",
"section_2": "",
"notes": "",
Expand Down
4 changes: 1 addition & 3 deletions taxcalc/growfactors.csv
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
YEAR,ATXPY,ASCHF,ABOOK,ACPIU,ACPIM,AWAGE,ASCHCI,ASCHCL,ASCHEI,ASCHEL,AINTS,ADIVS,ACGNS,ASOCSEC,AUCOMP,AIPD,ABENEFITS
2009,1.0,1.0,1.0,1.0,1.0,1.0053,1.0041,1.1629,1.1089,1.2953,1.0357,1.0606,1.1781,1.0,1.0034,1.0,1.0
2010,1.019734,1.285006,1.239687,1.0168,1.0341,1.01428,1.036295,0.861365,1.051964,0.876537,0.824078,1.113447,1.483637,1.023297,1.4395,0.8912,0.99167
2011,1.054092,1.628865,1.032354,1.031176,1.030655,1.029487,1.036772,0.969799,1.037889,0.932017,0.85377,1.052349,1.014976,1.004847,0.768253,0.973631,0.992422
2011,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
2012,1.0439,0.950294,1.105021,1.020887,1.036405,1.032695,1.049014,0.956138,1.165919,0.926988,0.923669,1.327788,1.589653,1.028314,0.771046,0.923015,0.992382
2013,1.012394,1.14209,1.0337,1.014761,1.024624,1.019855,0.994934,1.049962,0.99716,1.013174,0.893554,0.819308,0.776176,1.014701,0.728979,0.896242,0.99244
2014,1.029602,0.931733,0.976534,1.015927,0.964216,1.040096,1.040639,1.030451,1.076041,0.991213,0.925988,1.176075,1.387526,1.004792,0.641088,0.970605,0.992592
Expand Down
35 changes: 17 additions & 18 deletions taxcalc/puf_ratios.csv
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
agi_bin,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18
INT2010,0.901255090116,0.293042718343,0.907329353348,0.86558797554,0.85655897288,0.933970619464,0.859796964501,0.842821575568,0.796799905684,0.831229628111,0.924122485079,0.927642848073,1.02014814978,1.04037552467,1.06010996178,1.03788293609,1.06775704965,1.01354100423,2.82176720585
INT2011,1.04407200751,0.854658120887,0.784112896258,0.897946239013,0.937497841252,0.849279248173,0.909758857502,0.938870392295,0.99163841837,0.878351351761,0.973089815045,1.02836909296,1.07352494979,1.03163988494,1.04749188738,1.13489323556,1.0943734775,1.11073061458,1.071669732
INT2012,0.867470108865,0.94289292562,0.830023458784,0.806822727159,0.700105733855,0.787249996459,0.793348077229,0.781769961614,0.823481413638,0.894965848896,0.913871738809,0.96732328283,1.03938424354,1.02579240239,0.93802459599,1.00995184949,1.00028988208,1.23199527,1.38464241664
INT2013,1.13607217325,0.783386869841,0.743313987486,0.757073338762,0.88722967575,0.854536194833,0.931618779529,0.898579172617,0.832273018183,0.877959912767,1.01960873273,1.0071112512,1.01708714966,1.04192760853,1.15821622776,1.07638887373,1.1324243664,1.00670780933,1.12318452683
INT2014,0.925348351747,0.912694379477,0.854893630945,0.763904257114,0.840739746431,0.861927973187,0.978470281075,0.866088026911,0.826563954007,1.02643979777,0.854259772293,1.06527687876,1.02913371936,0.941669246765,1.04344429732,1.073173007,1.02957817719,1.07472201737,1.06434514676
INT2015,0.994294129592,0.987466821693,0.974112215726,0.983073612875,0.979631946495,0.98599591611,0.98031403535,0.984210786207,0.991450839817,1.00025116036,0.999254946989,1.00600411041,1.00690408308,0.998177664351,1.00962025433,1.00658393429,1.00742229903,1.03531188496,1.02888663942
INT2016,1.00199725745,0.988106651505,0.971699908268,0.967748343236,0.975605688205,0.974073522167,0.988642833409,0.978520633683,0.983673402247,1.00565229183,1.01939460704,1.00828978848,1.00320291344,1.00290788732,1.00189313704,0.996891519492,1.00690917754,1.02479731008,1.01694010282
INT2017,0.985600199239,0.992570440801,0.962068007693,0.971668326138,0.974478695568,0.975964060389,0.977166156942,0.979650751165,0.98727083988,1.00604460318,1.00882917168,1.00823122141,1.01533895326,1.00194036491,1.00107807288,1.00984401148,1.00170376346,1.02937144186,1.03335550702
INT2018,0.995114850925,0.977043395715,0.967582661538,0.96369473537,0.971483016264,0.972433750637,0.979628579914,0.986357968672,0.993541502075,1.01005971862,1.01188997978,1.00647774205,1.00518277803,0.99494987806,0.995284859747,0.995542996831,1.0214819482,1.07031844006,1.01394555979
INT2019,0.999502058685,0.993251501945,0.974580573792,0.978231296357,0.978435363759,0.981080247998,0.98761504598,0.994907581346,0.988260055323,1.00047669248,1.01031862504,1.00670621012,1.00469323852,1.0045193481,0.993903212969,1.00019952317,1.00973181202,1.03275609249,1.0103855664
INT2020,0.993839075848,0.987641270197,0.978057587499,0.979208776329,0.97788551722,0.981593779298,0.977986888167,0.995484635802,1.00351102515,1.0094112044,1.00739600718,1.00181355221,1.00575943704,0.997440031047,0.994423932554,1.00158059538,1.00919427127,1.05872788463,1.00170123608
INT2021,1.0016069749,0.990498670116,0.978228045198,0.975166965533,0.992659954352,0.986455342115,0.985146730174,0.985610784273,1.01563499555,1.01436798215,1.0076922246,1.00036548304,1.00313262684,1.00110527673,1.00096825974,0.997106043091,1.00419103447,1.00624267122,0.998965118491
INT2022,1.00081339196,0.985457978078,0.975996599648,0.981886463637,0.982117471267,0.995484246542,0.996347503877,0.992086167429,1.01912774091,1.00429823014,1.00071074273,1.00662585962,1.00172719362,0.99606598264,0.993853661621,1.00224185004,1.00827496062,1.00493947603,1.01435963176
INT2023,0.997242355089,0.994433178411,0.974097098746,0.976818864212,0.986597058053,0.987757226907,0.982471862295,1.00473803768,1.00972433129,1.01596534078,1.00552133904,0.997034176774,1.0032299111,1.00135344281,0.993885891672,1.00594673553,1.00806625959,1.00582056307,1.00388052114
INT2024,0.998424558516,0.990531838183,0.977435325043,0.978693391122,0.980018841788,0.982475363844,0.985610645891,1.00675213406,1.0066360888,1.01924399548,1.0071416331,0.994729919458,1.00430256598,1.0013501595,0.999680986542,1.00666641663,1.01059892853,1.0093209809,0.995161179744
INT2025,0.992924992417,0.993375987667,0.98418221013,0.980688294622,0.981877097449,0.983607067241,0.989277418724,0.993291586703,1.00022050741,1.00915547361,1.01127361685,1.0047076048,1.00103455061,0.995977775206,1.00062321952,1.00113048758,1.01208349102,1.01335349324,1.01822191885
INT2026,1.00586699744,0.994465668823,0.976086012136,0.975290854099,0.99299149489,0.982577367189,1.00041293233,0.994427741687,0.997940730851,1.00950631595,0.995490124433,1.00083420359,1.00349121661,1.0028049326,1.00444778537,0.998400537541,1.01107862195,1.00720978891,1.01908274618
INT2027,1.09794460165,0.98683365078,0.95312268248,0.903812538558,0.981760474894,1.04279717002,1.09497421475,1.11111500536,1.08502255161,0.942436070529,0.890427541239,0.891932365082,1.02345919441,1.20038041235,1.18410975796,1.17656753719,1.11175063116,0.939093298574,0.859404441543
INT2011,1.04578041699,0.251394199993,0.963043888383,0.986778080124,0.991661221904,0.96476040638,0.855210652598,0.917080544899,0.99010553799,0.941741969967,0.952306939142,0.959520881504,0.968112980303,0.969444566604,0.988066000297,0.988937290282,0.975388823456,1.03191397902,1.73435147729
INT2012,0.763440777504,0.918994815533,0.831211187581,0.813167737413,0.701419327423,0.799013001001,0.777432003976,0.787323548948,0.826960724641,0.900477477708,0.907289393575,0.955193657464,1.05052908187,1.02651917774,1.00538715845,1.12127491772,1.09091806894,1.22598740693,1.35009955152
INT2013,1.13248967651,0.777873803126,0.779069117444,0.775791376912,0.905210639652,0.873485013186,0.948766878902,0.897571225759,0.837283675736,0.854571960429,0.971180172891,1.01908827709,1.04377052721,1.05409661229,1.07487609906,0.961598483091,1.04121773053,0.960513633894,1.2131854162
INT2014,0.912183909158,0.879242622584,0.851325743899,0.786903718392,0.851849817151,0.87452107583,1.01051432167,0.867204902929,0.832663845048,1.01201506514,0.845006607979,1.04688506692,1.02732324812,0.941504640459,1.08323279943,1.15825164116,1.08255808314,1.05739154208,1.05884052087
INT2015,0.999187796727,0.993217655483,0.990002539147,0.977740213359,0.979185732834,0.982001661933,0.972061252876,0.981880268971,0.983322244424,0.984026649063,1.00578351886,1.01922388486,1.00825702989,0.996484529442,0.994015986114,0.987373508748,0.994440773692,1.01267013363,1.02722347183
INT2016,0.996023831602,0.997017481616,0.963898946063,0.979997233182,0.980347104551,0.979612507641,0.982635801961,0.993164383738,0.980298376387,0.987422530633,0.993388768975,1.03086973515,0.99771731007,0.991269158762,0.989764055952,0.993189475972,1.00399601947,1.00501759977,1.0354948668
INT2017,0.988056043765,0.984570170793,0.965289775264,0.970859548487,0.982983509497,0.971025615751,0.980818580398,0.980513664788,0.978875645651,0.983234949728,1.00480961379,1.0229714953,1.00487803597,0.995034647564,0.988069040069,0.985598239644,0.989300472659,1.04332520543,1.0627026483
INT2018,0.994484274156,0.998144880367,0.987509284036,0.967491559823,0.977104647798,0.980091052092,0.983062729401,0.993711274996,0.980772613176,0.995606749566,1.01257365885,1.01527138322,0.996048702273,0.994751525011,0.994887274819,0.985895174874,0.99432419117,1.02714372365,1.03989341613
INT2019,0.99974926615,0.991452980585,0.977891890741,0.97697349878,0.977559894086,0.980238231728,0.980922838618,0.983271526723,0.984123857951,0.999631769486,1.00820601035,1.00869760212,1.00125305865,0.99291651205,0.992860899926,0.993687503238,1.00141152194,1.02327241802,1.04621894186
INT2020,0.99095372349,0.998018561656,0.978858394153,0.982691229464,0.979364883314,0.983973470727,0.983227422031,0.981966346528,0.986349274892,0.996710064015,1.00729789609,1.01342024656,1.00204176069,0.996955295961,0.999426666308,0.987575983074,0.991105394008,1.02727425628,1.04363553252
INT2021,0.994603297569,1.00163890445,0.974155599988,0.981166247747,0.982554573911,0.980040496318,1.01873039347,0.983016742253,0.998908534734,1.00601341957,0.997912219208,1.00251091274,1.01211861613,0.993918758952,1.00522948444,0.988169351957,1.00149744861,1.00391944857,1.01330589721
INT2022,0.999799954806,0.990537140381,0.987225095242,0.984597780049,0.978612141905,0.981288915147,0.98451208453,0.994536692955,0.991346617365,1.00633278335,1.01157775425,1.00748920105,1.00113456501,0.998736047431,0.99102867703,0.988101144905,0.999261477082,1.00937931756,1.0207187327
INT2023,1.00035066482,0.995888155499,0.988995998618,0.977117069671,0.980428597938,0.986310398738,0.982977018638,0.993690211462,0.990046429032,0.999916204305,1.01474111209,1.00048032693,1.00327353648,1.00064589481,0.990493786772,0.989008808543,1.00776229266,1.01796885459,1.02083659039
INT2024,0.994715474095,0.992677183929,0.986576189878,0.976070410321,0.982646385079,0.983049078466,1.02442753402,0.985453472607,0.992920704982,1.00460805058,1.00123754654,1.00570330104,1.00320353306,0.998139031364,1.00119876471,0.991050340434,1.00055534489,1.02152253701,1.01696899159
INT2025,1.01002616032,0.997287224567,0.975535444222,0.979306658434,0.981460721259,0.977919509994,0.995295054337,1.00233514542,0.997489527492,1.00243344009,1.00836499951,0.9996877024,1.00068595975,1.00345274648,0.99016434594,0.993041202598,0.998999802323,1.0189879535,1.01465582432
INT2026,0.995515455125,0.996075483772,0.980684600825,0.980048782736,0.982525351371,0.982655130899,0.983824519362,0.987325511827,1.00773748444,1.0035655189,1.00300082924,1.00398035865,1.00403856758,0.998076619269,1.00057337113,0.990926033898,1.00839424736,1.01505756769,1.01996922366
INT2027,1.00239975283,1.00579061015,0.979508385219,0.980147780618,0.983752636374,0.986629696223,0.987159480221,1.01533213508,1.00205871712,0.99913349126,0.999178024788,1.00113932811,1.00247418607,1.00063282348,0.997291170331,0.998893596555,1.00828075584,1.00927854602,0.999454076302
Loading

0 comments on commit 0f718eb

Please sign in to comment.