Skip to content

Commit

Permalink
Merge pull request #421 from bodiyang/CBO_2023_Feb
Browse files Browse the repository at this point in the history
CBO 2023 Feb baseline update
  • Loading branch information
bodiyang committed Mar 14, 2023
2 parents db4056d + 563fde6 commit 24149f5
Show file tree
Hide file tree
Showing 22 changed files with 196 additions and 185 deletions.
2 changes: 1 addition & 1 deletion cps_stage1/stage1.py
Expand Up @@ -6,7 +6,7 @@

def main(syr=2014):
SYR = str(syr) # Start year of CPS
EYR = 2032 # Last year in our extrapolation
EYR = 2033 # Last year in our extrapolation

# Read in state SOI estimates
soi_estimates = pd.read_csv(
Expand Down
48 changes: 24 additions & 24 deletions cps_stage1/stage_2_targets.csv
@@ -1,24 +1,24 @@
,2014,2015,2016,2017,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032
Single,69579590,71086947,71410690,73021932,72028792,71924422,73183813,74331876,75333822,76224441,77122018,77984804,78861507,79745168,80635787,81540322,82451814,83377223,84309589,85248914,86209112,87169310
Joint,55128595,57272012,57201828,57987204,57069122,56986429,57984256,58893878,59687730,60393376,61104535,61788129,62482750,63182883,63888529,64605200,65327385,66060595,66799319,67543555,68304329,69065104
HH,22077498,22134303,21659639,21894095,22854626,22821510,23221112,23585391,23903307,24185899,24470699,24744460,25022636,25303020,25585612,25872620,26161835,26455466,26751304,27049351,27354020,27658689
SS_return,27401498,28087514,28329015,28967603,31684352,32736570,33818929,34953351,36139836,37386604,38614191,39891101,41154310,42384637,43664287,44875433,46007115,47097695,48141692,49089784,49843325,50509181
Dep_return,96916673,96505181,94809260,94708629,99911398,100735190,101549290,102373082,103187182,104001282,104805690,105610099,106414507,107209224,107984557,108759890,109525532,110281482,111018049,111744924,112452416,113150216
INTS,156367939,95881223,96640233,106055367,124828526,125813644,138072890,143545768,146829495,143483221,145797466,144515249,159776760,178478366,194850089,209533038,221792285,235380659,247983914,261900661,275614129,289108682
DIVS,254702232,260252720,254065327,282336042,340613295,332513764,369521998,401130545,421201081,415393870,416234388,452554926,492313944,522725391,546973043,563757920,575703455,588413096,604764980,624580813,646663497,670962090
SCHCI,374659000,391975736,389078638,416010104,435503622,432281554,462216808,485895257,491852335,497996743,543105686,581770495,607509568,626542246,647635547,670714542,695367104,723541461,752914726,783037310,814171473,846317215
SCHCL,57400238,60161435,60996610,69637956,63668344,64552308,73696166,77467361,78425945,79396009,86593999,92758785,96862902,99899374,103257288,106936643,110868560,115362998,120046858,124851258,129810638,134936479
CGNS,705007630,713598090,634341278,859894631,1249696525,1110880523,1505896298,1632163164,1523239485,2000388649,2297760868,2430936809,2356558504,2164655427,2062640823,2012514781,2007297724,2035004524,2081676029,2143928203,2213089451,2289159775
Pension,663223262,689991999,693626543,729187412,776568117,800178866,846471849,889515039,925594384,986014024,1058835938,1082181397,1138886986,1190817367,1241421302,1294412840,1347868635,1405900671,1464861219,1527336850,1590939961,1657925510
SCHEI,846331543,891134646,882933054,973306129,1140431754,1129937243,1245546132,1348629314,1385360103,1312829490,1644760721,1734387231,1761723740,1757661349,1785167124,1786521254,1808441241,1858628702,1933190511,2007583053,2080113666,2155691073
SCHEL,166947674,177896945,176446339,206369393,169401805,168032834,196514107,212774811,218567895,207131979,259486770,273627238,277951182,277316781,281657421,281857758,285330270,293243589,305013400,316749822,328185738,340105801
SS,575126918,605152093,619856114,644989570,709246515,726500323,755946821,795975655,847794590,899095911,952065100,1016191751,1097687236,1171648557,1244919727,1322159272,1402216939,1488255926,1577285573,1668903291,1762879029,1762879029
UCOMP,33288898,27225383,25420264,23946035,9810238,9161105,8628482,7962704,7490002,7746327,66767543,10193061,7633144,8711705,9410771,10239665,11098519,12097186,12882804,13372150,13824879,14211031
wage1,114320683,112017897,111270085,107376379,132211870,134189618,140763057,147839507,154870229,156870841,171538185,186582787,194756716,201444476,208303716,215951770,224308612,232894095,241639628,250728122,260205307,270048317
wage2,261995646,261659142,253415638,247511878,302997965,307530489,322595239,338812769,354925502,359510425,393124467,427603094,446335783,461662528,477382267,494909775,514061657,533737530,553780197,574608851,596328290,618886115
wage3,381259619,383184602,382875414,382789227,440926749,447522541,469444969,493044939,516492406,523164449,572080058,622253824,649513887,671817575,694693152,720199420,748069498,776702096,805868457,836178596,867785019,900611472
wage4,418567676,428313928,436140082,441282302,484073517,491314738,515382379,541291719,567033631,574358565,628060798,683144304,713071893,737558102,762672162,790674340,821271637,852706070,884726497,918002627,952701887,988740564
wage5,418379915,424369612,426147995,437485582,483856372,491094344,515151189,541048906,566779271,574100919,627779062,682837859,712752023,737227248,762330043,790319659,820903231,852323563,884329626,917590830,952274525,988297035
wage6,916618937,952347137,962308451,1000500360,1060069801,1075927308,1128632897,1185371609,1241743674,1257784505,1375386715,1496013767,1561552021,1615174229,1670171365,1731493172,1798498016,1867336098,1937457447,2010328653,2086316363,2165237253
wage7,840581301,835434509,852517230,870406373,972132275,986674331,1035007756,1087039738,1138735488,1153445661,1261292242,1371912741,1432014304,1481188310,1531623189,1587858078,1649304571,1712432226,1776736696,1843562909,1913247099,1985621149
wage8,3433224075,3714896131,3792750634,4090211841,3970523643,4029918419,4227328804,4439845374,4650988654,4711070076,5151552725,5603365013,5848840534,6049684143,6255677587,6485360278,6736328958,6994164086,7256805727,7529747041,7814361317,8109961910
,2014,2015,2016,2017,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033
Single,69579590,71086947,71410690,73021932,72028792,71924422,73183813,74331876,75333822,76224441,77122018,77984804,78861507,79745168,80635787,81540322,82451814,83377223,84309589,85248914,86209112,87169310,88150383
Joint,55128595,57272012,57201828,57987204,57069122,56986429,57984256,58893878,59687730,60393376,61104535,61788129,62482750,63182883,63888529,64605200,65327385,66060595,66799319,67543555,68304329,69065104,69842417
HH,22077498,22134303,21659639,21894095,22854626,22821510,23221112,23585391,23903307,24185899,24470699,24744460,25022636,25303020,25585612,25872620,26161835,26455466,26751304,27049351,27354020,27658689,27969982
SS_return,27401498,28087514,28329015,28967603,31684352,32736570,33818929,34953351,36139836,37386604,38614191,39891101,41154310,42384637,43664287,44875433,46007115,47097695,48141692,49089784,49843325,50509181,51128455
Dep_return,96916673,96505181,94809260,94708629,99911398,100735190,101549290,102373082,103187182,104001282,104805690,105610099,106414507,107209224,107984557,108759890,109525532,110281482,111018049,111744924,112452416,113150216,113828632
INTS,156367939,95881223,96640233,106055367,124828526,125813644,138072890,143545768,146829495,146407301,147423693,155851925,184373437,200807707,208407189,223277780,238382923,250517075,260993727,271798752,282244130,293189886,305105123
DIVS,254702232,260252720,254065327,282336042,340613295,332513764,369521998,401130545,421201081,463481652,494147800,519032208,531334326,529525940,539612149,558944048,583064349,608228930,632425642,657106288,682347280,708148616,734484826
SCHCI,374659000,391975736,389078638,416010104,435503622,432281554,462216808,485895257,491852335,503691560,536549154,552846820,573190804,600728241,631525210,664682532,696940672,729461073,762580929,796037977,829794753,864188449,898844407
SCHCL,57400238,60161435,60996610,69637956,63668344,64552308,73696166,77467361,78425945,80308673,85549315,88149545,91386919,95783777,100691497,105978059,111121121,116304362,121585184,126917666,132301809,137783531,143311174
CGNS,705007630,713598090,634341278,859894631,1249696525,1110880523,1505896298,1631599158,1522675479,1983609468,3514815539,2928178690,2558331688,2358673527,2262087482,2213653457,2207308389,2227189604,2268291549,2325538168,2393782907,2470135233,2552409624
Pension,663223262,689991999,693626543,729187412,776568117,800178866,846471849,889515039,925594384,996293984,1069779122,1093456192,1161502899,1215621917,1267154364,1326247557,1384478559,1444102331,1504588292,1567660824,1632258770,1700769733,1770474498
SCHEI,846331543,891134646,882933054,973306129,1140431754,1129937243,1245546132,1348629314,1385360103,1322308403,1621317337,1711451646,1505793081,1517895622,1677005952,1790752912,1894259260,1968482536,2033988597,2104657281,2178795924,2258943521,2339006485
SCHEL,166947674,177896945,176446339,206369393,169401805,168032834,196514107,212774811,218567895,208634508,255797226,270021168,237566540,239486438,264595369,282542243,298869726,310572758,320906819,332058924,343761956,356399894,369021139
SS,575126918,605152093,619856114,644989570,709246515,726500323,755946821,795975655,848657280,898463271,939067232,1016191751,1097687236,1171648557,1244919727,1322159272,1402216939,1488255926,1577285573,1668903291,1762879029,1762879029,1762879029
UCOMP,33288898,27225383,25420264,23946035,9810238,9161105,8628482,7962704,7490002,7746327,66767543,10193061,7633144,8711705,9410771,10239665,11098519,12097186,12882804,13372150,13824879,14211031,14211031
wage1,114320683,112017897,111270085,107376379,132211870,134189618,140763057,147839507,154870229,157088051,170920853,185370987,194653827,203902370,213848270,223108245,231648000,240542149,249802124,259302173,269030863,278908170,288934094
wage2,261995646,261659142,253415638,247511878,302997965,307530489,322595239,338812769,354925502,360008217,391709690,424825940,446099986,467295434,490089055,511310703,530881777,551265039,572486686,594258524,616554354,639190778,662167796
wage3,381259619,383184602,382875414,382789227,440926749,447522541,469444969,493044939,516492406,523888842,570021256,618212472,649170753,680014656,713184243,744066272,772546366,802208364,833090393,864773068,897218261,930159092,963595561
wage4,418567676,428313928,436140082,441282302,484073517,491314738,515382379,541291719,567033631,575153844,625800532,678707487,712695182,746557307,782972695,816876676,848143682,880708247,914612229,949395203,985015312,1021179559,1057887944
wage5,418379915,424369612,426147995,437485582,483856372,491094344,515151189,541048906,566779271,574895841,625519811,678403032,712375481,746222416,782621469,816510242,847763222,880313179,914201952,948969323,984573454,1020721479,1057413397
wage6,916618937,952347137,962308451,1000500360,1060069801,1075927308,1128632897,1185371609,1241743674,1259526081,1370436973,1486297606,1560727064,1634881536,1714627384,1788873517,1857344952,1928657905,2002904039,2079075073,2157079344,2236275221,2316662701
wage7,840581301,835434509,852517230,870406373,972132275,986674331,1035007756,1087039738,1138735488,1155042766,1256753103,1363002580,1431257781,1499260808,1572391382,1640478467,1703269890,1768667115,1836754201,1906606507,1978139976,2050766200,2124485180
wage8,3433224075,3714896131,3792750634,4090211841,3970523643,4029918419,4227328804,4439845374,4650988654,4717593201,5133013315,5566972838,5845750633,6123498460,6422188955,6700280105,6956741943,7223846776,7501937926,7787238847,8079406216,8376036776,8677130527
Binary file modified cps_stage2/cps_weights.csv.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion cps_stage2/solver.jl
Expand Up @@ -80,7 +80,7 @@ function Solve_func(year, tol)

end

year_list = [x for x in 2014:2032]
year_list = [x for x in 2014:2033]
tol = 0.70

# Run solver function for all years and tolerances (in order)
Expand Down
2 changes: 1 addition & 1 deletion cps_stage2/stage2.py
Expand Up @@ -11,7 +11,7 @@
STAGE_1_PATH = Path(CUR_PATH, "..", "puf_stage1", "Stage_I_factors.csv")
STAGE_2_PATH = Path(CUR_PATH, "..", "cps_stage1", "stage_2_targets.csv")
START_YEAR = 2014
END_YEAR = 2032
END_YEAR = 2033

# Read hashes used to see which years can be skipped
with open(Path(CUR_PATH, "..", "datahashes.json")) as f:
Expand Down
Expand Up @@ -108,7 +108,7 @@ column of this table.
Source: [BLS Database](http://data.bls.gov/timeseries/CUSR0000SAM?output_view=pct_1mth)

Series ID: CUSR0000SAM
Access Date: February 28 2023
Access Date: March 07 2023

Manual Instructions:

Expand Down
6 changes: 4 additions & 2 deletions history/report_utils.py
Expand Up @@ -805,7 +805,7 @@ def validation_table(df_tax_data, df_cbo, category):
new_df = new_df.rename_axis(index=None).squeeze()
new_df.index = new_df.index.astype(str)
df_cbo = df_cbo.drop(
columns=["2019", "2020", "2021", "2022", "2032"], axis=1, inplace=False
columns=["2019", "2020", "2021", "2022", "2033"], axis=1, inplace=False
)
df_cbo = df_cbo.transpose()
df_cbo_sal = df_cbo.loc[:, df_cbo.columns.str.contains(category)].squeeze()
Expand Down Expand Up @@ -1271,7 +1271,9 @@ def CBO_validation(cbo_df, new, name, template_args):
)
new_taxable_inc = run_calc_var(new, year, "c04800")
new_tot_inctax = run_calc_var(new, year, "c05800")
new_tot_cdt = run_calc_var(new, year, "c07100")
new_tot_cdt = run_calc_var(new, year, "c07100") + run_calc_var(
new, year, "refund"
)
new_inctax_af_credit = run_calc_var(new, year, "c05800") - run_calc_var(
new, year, "c07100"
)
Expand Down
Binary file added history/reports/taxdata_report_2023-03-08.pdf
Binary file not shown.
32 changes: 16 additions & 16 deletions puf_stage1/CBO_baseline.csv
@@ -1,16 +1,16 @@
,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032
GDP,14718.6,14418.7,14964.4,15517.9,16163.2,16800,17348.1,18036.7,18624.5,19479.6,20527.2,21372.6,20893.8,22997.5,25135.4,26529.1,27531.2,28525.2,29516.8,30613.8,31788.4,33032.1,34322.7,35654.3,37026.3
TPY,12429.6,12087.5,12429.3,13202,13887.7,14166.9,14694.2,15458.5,15928.7,16850.2,17706,18424.4,19627.6,21076.8,21542.2,22671,23704.3,24711.9,25766.2,26830.9,27985.3,29159.3,30402.8,31669,33002.8
Wages,6531.9,6251.4,6377.5,6633.2,6932.1,7124.7,7477.8,7854.8,8085.3,8474.7,8900.5,9323.5,9444.1,10326.9,11233.1,11725.2,12128,12540.6,13001,13503.9,14020.9,14547.5,15094.7,15665.6,16257.7
SCHC,979.5,937.5,986.7,1068.1,1187.9,1253.5,1268.5,1336.8,1298.7,1466.4,1541.5,1560.5,1579.9,1723.1,1845.7,1927.4,1987.8,2054.7,2127.9,2206.1,2295.5,2388.7,2484.3,2583,2685
SCHF,47,35.5,46,75.5,72.3,83.2,78.1,40,43.2,39.5,38.9,38.4,70.2,97.8,66.4,57.7,51.5,47.7,45.5,44.8,44.9,45.6,46.4,47.4,48.4
INTS,1361.6,1264.3,1195,1231.6,1255.9,1255.2,1302,1302.8,1415.3,1553.4,1615,1652,1614.4,1640.3,1626,1797.7,2008,2192.2,2357.5,2495.4,2648.2,2790.1,2946.6,3101,3252.8
DIVS,805.4,553.7,544.6,682.2,832.7,824.5,815.5,951.1,962.5,1154.5,1253.3,1316,1297.8,1300.5,1413.9,1538.2,1633.2,1708.9,1761.4,1798.7,1838.4,1889.5,1951.4,2020.4,2096.3
RENTS,262.1,333.7,402.8,485.3,533,595.8,610.8,659.6,707.4,652.7,681.9,692.1,711.6,727.5,772.3,813.4,836.3,844.2,862.7,899.5,937,978.8,1024,1074.1,1127.4
CGNS,498,263,394,404,647,511,716,725,641,871,944,881,1157,1329,1406,1363,1252,1193,1164,1161,1177,1204,1240,1280,1324
BOOK,1285.1,1397,1746.4,1816.6,2022.8,2106.9,2072.9,2088.1,2073.5,2128.9,2305,2367.8,2243.8,2811.1,2964.3,3011.1,3004.1,3051.2,3053.4,3091,3176.7,3304.2,3431.3,3555.3,3684.4
RETS,142.5,140.5,142.9,145.4,144.9,146.6,148.3,147.8,149.7,149.9,152.5,153.5,160.1,164.3,160.7,163.8,165.4,167.1,168.8,170.6,172.5,174.3,176.2,178.1,180.1
SOCSEC,503,544.5,572.5,591.5,627.2,663.2,698.2,733.7,762.1,791.1,833,887.2,940.9,996.3,1063.4,1148.7,1226.1,1302.8,1383.6,1467.4,1557.4,1650.6,1746.5,1844.8,
CPIU,215.3,214.5,218.1,224.9,229.6,233,236.7,237,240,245.1,251.1,255.6,258.8,271,287.5,296.4,303.5,310.5,317.7,325.1,332.8,340.7,348.7,356.9,365.2
CPIM,364.1,375.6,388.4,400.3,414.9,425.1,435.3,446.8,463.7,475.3,484.7,498.4,518.9,525.3,538.7,505.6,512.7,519.7,526.9,534.3,542,549.9,557.9,566.1,574.4
UCOMP,51.1,131.2,138.9,107.2,83.6,62.2,43.8,39.9,31.2,31.1,28.7,27,27.925,240.656,36.743,27.511,31.4,33.922,36.907,40.003,43.608,46.439,48.195,49.829,51.225
,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033
GDP,14718.6,14418.7,14964.4,15517.9,16163.2,16800,17348.1,18036.7,18624.5,19479.6,20527.2,21372.6,21060.5,23315.1,25419.5,26438.4,27591.9,28947,30262.4,31573.1,32843.4,34138.2,35468.3,36831.8,38224.9,39645.9
TPY,12429.6,12087.5,12429.3,13202,13887.7,14166.9,14694.2,15458.5,15928.7,16850.2,17706,18424.4,19832.3,21294.8,21766.7,23120.9,24197.9,25223.9,26400.2,27559.6,28745.6,29949.9,31206.2,32491.9,33855.8,35242.2
Wages,6531.9,6251.4,6377.5,6633.2,6932.1,7124.7,7477.8,7854.8,8085.3,8474.7,8900.5,9323.5,9457.4,10290.1,11160.2,11719,12275.6,12874.2,13431.8,13945.9,14481.3,15039,15610.8,16196.8,16790.9,17394.6
SCHC,979.5,937.5,986.7,1068.1,1187.9,1253.5,1268.5,1336.8,1298.7,1466.4,1541.5,1560.5,1598,1702.3,1754,1818.5,1905.9,2003.6,2108.8,2211.1,2314.3,2419.4,2525.5,2632.6,2741.7,2851.7
SCHF,47,35.5,46,75.5,72.3,83.2,78.1,40,43.2,39.5,38.9,38.4,45.2,51.3,90.1,93.8,82.3,72.9,66.7,62.8,60.5,59.1,58.4,58.1,58.1,58.3
INTS,1361.6,1264.3,1195,1231.6,1255.9,1255.2,1302,1302.8,1415.3,1553.4,1615,1652,1647.3,1658.6,1753.4,2074.3,2259.3,2344.8,2512,2682,2818.5,2936.4,3058,3175.5,3298.6,3432.7
DIVS,805.4,553.7,544.6,682.2,832.7,824.5,815.5,951.1,962.5,1154.5,1253.3,1316,1448.1,1543.9,1621.6,1660.1,1654.4,1685.9,1746.3,1821.7,1900.3,1975.9,2053,2131.9,2212.5,2294.8
RENTS,262.1,333.7,402.8,485.3,533,595.8,610.8,659.6,707.4,652.7,681.9,692.1,719.9,723.8,783.4,840.8,865.4,873,892,929.9,969.1,1012.5,1059.2,1110.7,1165.3,1216.6
CGNS,498,263,394,404,647,511,716,725,641,871.3,944,881,1147.7,2033.6,1694.2,1480.2,1364.7,1308.8,1280.8,1277.1,1288.6,1312.4,1345.5,1385,1429.2,1476.8
BOOK,1285.1,1397,1746.4,1816.6,2022.8,2106.9,2072.9,2088.1,2073.5,2128.9,2305,2367.8,2260.1,2771.1,2925.1,2573.6,2594.4,2866.3,3060.7,3237.6,3364.5,3476.4,3597.2,3723.9,3860.9,3997.7
RETS,142.5,140.5,142.9,145.4,144.9,146.6,148.3,147.8,149.7,149.9,152.5,153.5,160.1,164.4,170.7,167.3,168.6,169.9,171.2,172.6,174,175.5,177,178.6,180.1,181.6
SOCSEC,503,544.5,572.5,591.5,627.2,663.2,698.2,733.7,762.1,791.1,833,888.1,940.2,982.7,1063.4,1148.7,1226.1,1302.8,1383.6,1467.4,1557.4,1650.6,1746.5,1844.8,,
CPIU,215.3,214.5,218.1,224.9,229.6,233,236.7,237,240,245.1,251.1,255.6,258.8,271,292.9,306.9,316.2,323.1,329.7,336.5,343.8,351.6,359.6,367.8,376.1,384.7
CPIM,364.1,375.6,388.4,400.3,414.9,425.1,435.3,446.8,463.7,475.3,484.7,498.4,518.9,525.3,546.6,551.6,527.7,534.6,541.2,548,555.3,563.1,571.1,579.3,587.6,596.2
UCOMP,51.1,131.2,138.9,107.2,83.6,62.2,43.8,39.9,31.2,31.1,28.7,27,27.925,240.656,36.743,27.511,31.4,33.922,36.907,40.003,43.608,46.439,48.195,49.829,51.225,

0 comments on commit 24149f5

Please sign in to comment.