diff --git a/environment.yml b/environment.yml index b0cd963..c468845 100644 --- a/environment.yml +++ b/environment.yml @@ -8,9 +8,12 @@ dependencies: - behresp>=0.11.0 - pandas>=0.23 - numpy>=1.14 +- scipy - paramtools>=0.10.1 - pytest - dask +- distributed +- multiprocessing - bokeh - markdown - tabulate diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..6f19f43 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,5 @@ +[pytest] +testpaths = + taxbrain +markers = + local: marks tests that run locally and not on GH Actions (mostly due to run time) \ No newline at end of file diff --git a/taxbrain/cli.py b/taxbrain/cli.py index 3482892..271b7ac 100644 --- a/taxbrain/cli.py +++ b/taxbrain/cli.py @@ -47,7 +47,7 @@ def make_tables(tb, year, outpath): def cli_core(startyear, endyear, data, usecps, reform, behavior, assump, - baseline, outdir, name, make_report, author): + baseline, outdir, name, ogusa, make_report, author): """ Core logic for the CLI @@ -81,7 +81,7 @@ def cli_core(startyear, endyear, data, usecps, reform, behavior, assump, tb = TaxBrain( start_year=startyear, end_year=endyear, microdata=data, use_cps=usecps, reform=reform, behavior=behavior, - assump=assump, base_policy=baseline, verbose=True + assump=assump, ogusa=ogusa, base_policy=baseline, verbose=True ) tb.run() @@ -206,6 +206,13 @@ def cli_main(): ), default=None ) + parser.add_argument( + "--ogusa", + help=( + "If this argument is present, the model will be run using OG-USA" + ), + action="store_true" + ) parser.add_argument( "--report", help=( @@ -227,7 +234,7 @@ def cli_main(): cli_core( args.startyear, args.endyear, args.data, args.usecps, args.reform, args.behavior, args.assump, args.baseline, args.outdir, args.name, - args.report + args.ogusa, args.author, args.report ) diff --git a/taxbrain/ogusa_baseline/ClosedEconBaseline.csv b/taxbrain/ogusa_baseline/ClosedEconBaseline.csv new file mode 100644 index 0000000..fff1dd1 --- /dev/null +++ b/taxbrain/ogusa_baseline/ClosedEconBaseline.csv @@ -0,0 +1,7 @@ +6.562680348380078854e-01,6.562871667600174153e-01,6.558243577754427900e-01,6.551191680477388424e-01,6.540606900841303695e-01,6.527078664086063409e-01,6.511566302520928051e-01,6.489515868953991129e-01,6.391058893320427092e-01,6.368212233743906214e-01,6.337860106824244610e-01,6.307685007538144095e-01,6.275680151930459472e-01,6.240876691716688018e-01,6.203397956168890115e-01,6.162375700489377550e-01,6.115415792178018339e-01,6.062387727259070935e-01,6.002413975502884913e-01,5.933688933650866915e-01,5.853841790641995946e-01,5.940685766536670798e-01,6.013196535235925122e-01,6.074149535762491947e-01,6.125660682960171188e-01,6.169536603045433498e-01,6.206464487409470987e-01,6.237617685789976774e-01,6.264216280526491154e-01,6.287276972639709305e-01,6.307099350696986351e-01,6.324115349674543918e-01,6.338727329034854474e-01,6.351255394967731949e-01,6.361761108108656693e-01,6.370564285433935048e-01,6.377541081038016202e-01,6.383009155731178552e-01,6.387009304956684508e-01,6.389341708105293893e-01,6.389564620979732990e-01,6.397511795060355499e-01,6.404501979372297926e-01,6.410596557685820374e-01,6.415936983192414012e-01,6.420824797545843232e-01,6.425144654939638489e-01,6.428936604414275946e-01,6.432182645958171019e-01,6.434894908887194287e-01,6.437026758337491827e-01,6.438727583664352050e-01,6.440162659627649555e-01,6.441334257999800084e-01,6.442282575038081882e-01,6.443134965584115248e-01,6.443854143755927133e-01,6.444442185369313458e-01,6.444895027705069834e-01,6.445294203027784885e-01,6.445578710319375126e-01,6.445889457544353718e-01,6.446325215670802855e-01,6.446691641284079122e-01,6.446975283567352166e-01,6.447302807043082673e-01,6.447606940713701551e-01,6.447932564569240910e-01,6.448268272154032976e-01,6.448644457582486389e-01,6.449041978780052364e-01,6.449449560193916131e-01,6.449932840189818162e-01,6.450404071043226439e-01,6.450804987466453033e-01,6.451129816957394958e-01,6.451419544686844976e-01,6.451659646986840357e-01,6.451844767290182414e-01,6.452000679894351887e-01,6.452130377284448493e-01,6.452232267468531735e-01,6.452326511960800870e-01,6.452374264706386420e-01,6.452341938997276927e-01,6.452270783135716226e-01,6.452181540860558728e-01,6.452068781701874034e-01,6.451939924949110505e-01,6.451814829985629274e-01,6.451688006317937152e-01,6.451524651163438318e-01,6.451369392291992355e-01,6.451242524812915713e-01,6.451136964445668420e-01,6.451056063075621960e-01,6.451025816002881053e-01,6.451035238605924427e-01,6.451075017786164212e-01,6.451139443866735768e-01,6.451223637137057931e-01,6.451322695424086540e-01,6.451431577575292842e-01,6.451545268268660260e-01,6.451658997840713505e-01,6.451768388297206558e-01,6.451869542662911350e-01,6.451959117161190083e-01,6.452034373981334614e-01,6.452093249941541764e-01,6.452134462782297408e-01,6.452157590173810409e-01,6.452163058163329357e-01,6.452152080328920070e-01,6.452126567319960149e-01,6.452089002308492027e-01,6.452042307820791134e-01,6.451989744308339603e-01,6.451934850619872597e-01,6.451881443269757987e-01,6.451833706459924045e-01,6.451866665082749419e-01,6.451894222107814603e-01,6.451916968053424961e-01,6.451935825537682412e-01,6.451951532762449926e-01,6.451964688782789725e-01,6.451975768625025642e-01,6.451985152196527684e-01,6.451993145041376998e-01,6.451999993148016532e-01,6.452005895356666132e-01,6.452011012881284646e-01,6.452015476440258190e-01,6.452019392310726076e-01,6.452022846947398360e-01,6.452025910751253424e-01,6.452028641069713633e-01,6.452031084721866483e-01,6.452033280004183524e-01,6.452035258345065749e-01,6.452037045574583463e-01,6.452038663061128165e-01,6.452040128633267368e-01,6.452041457256491030e-01,6.452042661595800421e-01,6.452043752509669661e-01,6.452044739459735778e-01,6.452045630788747488e-01,6.452046433977369766e-01,6.452047155802195233e-01,6.452047802480087579e-01,6.452048379792005850e-01,6.452048893148756292e-01,6.452049347655813838e-01,6.452049748145262109e-01,6.452050099201293021e-01,6.452050405176525949e-01,6.452050670201547877e-01,6.452050898168839588e-01,6.452051092743913419e-01,6.452051257368217607e-01,6.452051395260632871e-01,6.452051509413230246e-01,6.452051602597426161e-01,6.452051677370013172e-01,6.452051736069701615e-01,6.452051780820973192e-01,6.452051813542862835e-01,6.452051835956993386e-01,6.452051849594933053e-01,6.452051855810897463e-01,6.452051855792527713e-01,6.452051850576470127e-01,6.452051841058860093e-01,6.452051828008180667e-01,6.452051812076847748e-01,6.452051793817623615e-01,6.452051773693829873e-01,6.452051752091192416e-01,6.452051729328383001e-01,6.452051705666455028e-01,6.452051681317757525e-01,6.452051656452836292e-01,6.452051631207539328e-01,6.452051605688566838e-01,6.452051579978623774e-01,6.452051554140803002e-01,6.452051528222314536e-01,6.452051502257722948e-01,6.452051476271587482e-01,6.452051450280794631e-01,6.452051424296316728e-01,6.452051398324765152e-01,6.452051372369572713e-01,6.452051346431991741e-01,6.452051320511797972e-01,6.452051294607845655e-01,6.452051268718483890e-01,6.452051242841883028e-01,6.452051216976226744e-01,6.452051191119856366e-01,6.452051165271350808e-01,6.452051139429524351e-01,6.452051113593662013e-01,6.452051087763397419e-01,6.452051061938639531e-01,6.452051036119499372e-01,6.452051010306232293e-01,6.452050984499180242e-01,6.452050958698728467e-01,6.452050932905273317e-01,6.452050907119191159e-01,6.452050881340818389e-01,6.452050855570443666e-01,6.452050829808292365e-01,6.452050804054523248e-01,6.452050778309230683e-01,6.452050752572435766e-01,6.452050726844096307e-01,6.452050701124103504e-01,6.452050675412275282e-01,6.452050649708359620e-01,6.452050624012031221e-01,6.452050598322869313e-01,6.452050572640344317e-01,6.452050546963790101e-01,6.452050521292365115e-01,6.452050495624996884e-01,6.452050469960319834e-01,6.452050444296587584e-01,6.452050418631545270e-01,6.452050392962300762e-01,6.452050367285060428e-01,6.452050341594952609e-01,6.452050315885619058e-01,6.452050290148834133e-01,6.452050264373880850e-01,6.452050238546973571e-01,6.452050212650013439e-01,6.452050186659403774e-01,6.452050160544697821e-01,6.452050134265984171e-01,6.452050107771311049e-01,6.452050080991816872e-01,6.452050053837804500e-01,6.452050026190023768e-01,6.452049997890521027e-01,6.452049968726654150e-01,6.452049938414015084e-01,6.452049906566479365e-01,6.452049872657371621e-01,6.452049835957271995e-01,6.452049795450448544e-01,6.452049749694042102e-01,6.452049696596040551e-01,6.452049633016272434e-01,6.452050297948710433e-01,6.452049762743409245e-01,6.452049961287317226e-01,6.452049870213836247e-01,6.452049858497460599e-01,6.452049829831545402e-01,6.452049803518256077e-01,6.452049776681658688e-01,6.452049749769751541e-01,6.452049722800637932e-01,6.452049695820269992e-01,6.452049668852621878e-01,6.452049641920394318e-01,6.452049615035533314e-01,6.452049588207720010e-01,6.452049561440424963e-01,6.452049534736588043e-01,6.452049508096879826e-01,6.452049481520321095e-01,6.452049455005524070e-01,6.452049428549805343e-01,6.452049402152064683e-01,6.452049375807018539e-01,6.452049349516280063e-01,6.452049323274828829e-01,6.452049297083750634e-01,6.452049270938940984e-01,6.452049244839753728e-01,6.452049218786508611e-01,6.452049192775242137e-01,6.452049166808768721e-01,6.452049140887949896e-01,6.452049115017723935e-01,6.452049089200486698e-01,6.452049063443507926e-01,6.452049037754747918e-01,6.452049012147031970e-01,6.452048986636104155e-01,6.452048961236576119e-01,6.452048935977188204e-01,6.452048910891560185e-01,6.452048886020773644e-01,6.452048861417234438e-01,6.452048837147387195e-01,6.452048813294963825e-01,6.452048789966062792e-01,6.452048767294829013e-01,6.452048745450719158e-01,6.452048724648948852e-01,6.452048705162050091e-01,6.452048687338359789e-01,6.452048671622743203e-01,6.452048658585509688e-01,6.452048648962420696e-01,6.452048643708041542e-01,6.452048644066701311e-01,6.452048651669539669e-01,6.452048668674026377e-01,6.452048697963157498e-01,6.452048743431169076e-01,6.452048810416814995e-01,6.452048906399689976e-01,6.452049042263451328e-01 +4.591538138206874842e-01,4.599214368578904977e-01,4.609738442878505427e-01,4.620183569668399048e-01,4.631217477920953618e-01,4.641184246347700437e-01,4.649601981362633807e-01,4.657044165015243875e-01,4.654965425567232362e-01,4.655370264247321033e-01,4.653179854631129264e-01,4.654834516233071207e-01,4.658594965273082367e-01,4.664131919945573301e-01,4.671697568783173549e-01,4.681162287211153572e-01,4.692024652460566325e-01,4.705087612485966408e-01,4.721011743292415908e-01,4.740794211762967558e-01,4.765954621546260039e-01,4.787637751003426256e-01,4.806140007901919531e-01,4.821823071341226896e-01,4.835029595203114150e-01,4.846044713566429740e-01,4.855064445704099230e-01,4.862407431452300810e-01,4.868357339647949589e-01,4.873145792136697185e-01,4.876709323255848938e-01,4.879361259634232284e-01,4.881325286566779997e-01,4.882767599465159258e-01,4.883849367846769263e-01,4.884732336356907845e-01,4.885559945863194309e-01,4.886512613296986052e-01,4.887835754657233189e-01,4.889954261275694103e-01,4.893627053032684748e-01,4.896085519322687651e-01,4.897771868981245502e-01,4.898913685699084475e-01,4.899718062465148738e-01,4.900353776460592559e-01,4.900912404442557824e-01,4.901446764330125161e-01,4.902015798916218858e-01,4.902715313855791623e-01,4.903566417372943742e-01,4.904559146412325044e-01,4.905654695568855139e-01,4.906769051165876805e-01,4.907900157844165001e-01,4.909097914446549638e-01,4.910384440847195830e-01,4.911734302815707887e-01,4.913071427274340874e-01,4.914405869378486447e-01,4.915688814170727228e-01,4.916899688399740120e-01,4.918014746025141104e-01,4.918952917710771588e-01,4.919741048408948769e-01,4.920378665197071566e-01,4.920868968531288967e-01,4.921238565048688951e-01,4.921457611199901439e-01,4.921550730490396042e-01,4.921546847134937730e-01,4.921451732435451754e-01,4.921265336237019561e-01,4.920963365287580604e-01,4.920567581268865398e-01,4.920124165565574192e-01,4.919681015948481617e-01,4.919259296123730252e-01,4.918876967019081281e-01,4.918552575396478166e-01,4.918287926847239033e-01,4.918078831905870474e-01,4.917921303246789444e-01,4.917792499211824375e-01,4.917705263291439755e-01,4.917689447254517399e-01,4.917740072562179487e-01,4.917841322961589157e-01,4.917988294775049729e-01,4.918171364142213675e-01,4.918370631078842203e-01,4.918576920132957109e-01,4.918812817775329305e-01,4.919066880752354654e-01,4.919319244939067137e-01,4.919562253722244427e-01,4.919789251078274805e-01,4.919976293816303303e-01,4.920112400456109758e-01,4.920194461705172384e-01,4.920223115104726541e-01,4.920201517612116660e-01,4.920134817647488501e-01,4.920029726690860472e-01,4.919894047965640560e-01,4.919736182181019823e-01,4.919564682320782811e-01,4.919387887732475928e-01,4.919213635181339805e-01,4.919049045497682626e-01,4.918900349039441733e-01,4.918772703323224804e-01,4.918670017775142456e-01,4.918594837740420944e-01,4.918548292585304127e-01,4.918530100973830810e-01,4.918538638848418687e-01,4.918571054786166075e-01,4.918623389463548934e-01,4.918690654840213727e-01,4.918766805453214097e-01,4.918857047160897777e-01,4.918925775617513096e-01,4.918979309387064847e-01,4.919021583162664912e-01,4.919055303673604551e-01,4.919082431611468964e-01,4.919104419781665238e-01,4.919122364215489651e-01,4.919137103221503104e-01,4.919149285016321538e-01,4.919159415314762196e-01,4.919167891686478944e-01,4.919175028541498129e-01,4.919181075857428365e-01,4.919186233279688736e-01,4.919190660899433465e-01,4.919194487549582440e-01,4.919197817199753020e-01,4.919200733939089187e-01,4.919203305906972301e-01,4.919205588383659400e-01,4.919207626288231161e-01,4.919209456148121440e-01,4.919211107685943496e-01,4.919212605096394686e-01,4.919213968102069678e-01,4.919215212813141669e-01,4.919216352425288541e-01,4.919217397808547942e-01,4.919218357969357136e-01,4.919219240434020146e-01,4.919220051549743622e-01,4.919220796746511248e-01,4.919221480737108743e-01,4.919222107683381973e-01,4.919222681320556401e-01,4.919223205054947812e-01,4.919223682065796965e-01,4.919224115344229542e-01,4.919224507723402029e-01,4.919224861910598823e-01,4.919225180512175055e-01,4.919225466047062456e-01,4.919225720952742908e-01,4.919225947586301495e-01,4.919226148224555284e-01,4.919226325059427585e-01,4.919226480190774797e-01,4.919226615622165899e-01,4.919226733254831174e-01,4.919226834881733068e-01,4.919226922181950123e-01,4.919226996719041622e-01,4.919227059938733881e-01,4.919227113168174181e-01,4.919227157617001023e-01,4.919227194381221580e-01,4.919227224446361957e-01,4.919227248693235910e-01,4.919227267904270340e-01,4.919227282770548548e-01,4.919227293898897346e-01,4.919227301819594778e-01,4.919227306993630422e-01,4.919227309819569904e-01,4.919227310640341133e-01,4.919227309749707455e-01,4.919227307398319482e-01,4.919227303799298956e-01,4.919227299133324682e-01,4.919227293553213864e-01,4.919227287187982744e-01,4.919227280146424852e-01,4.919227272520227401e-01,4.919227264386656917e-01,4.919227255810819099e-01,4.919227246847634460e-01,4.919227237543489228e-01,4.919227227937666425e-01,4.919227218063574325e-01,4.919227207949770642e-01,4.919227197620906211e-01,4.919227187097905407e-01,4.919227176399171841e-01,4.919227165541124047e-01,4.919227154538567959e-01,4.919227143404961700e-01,4.919227132152595994e-01,4.919227120792745156e-01,4.919227109335768677e-01,4.919227097791188386e-01,4.919227086167758944e-01,4.919227074473522254e-01,4.919227062715849641e-01,4.919227050901485154e-01,4.919227039036581650e-01,4.919227027126739649e-01,4.919227015177033424e-01,4.919227003192058190e-01,4.919226991175948416e-01,4.919226979132408362e-01,4.919226967064750378e-01,4.919226954975930433e-01,4.919226942868551999e-01,4.919226930744920456e-01,4.919226918607055854e-01,4.919226906456708459e-01,4.919226894295408714e-01,4.919226882124468903e-01,4.919226869945019232e-01,4.919226857758031701e-01,4.919226845564348971e-01,4.919226833364690465e-01,4.919226821159725649e-01,4.919226808950080132e-01,4.919226796736406171e-01,4.919226784519434847e-01,4.919226772300120398e-01,4.919226760079659644e-01,4.919226747859668514e-01,4.919226735642567849e-01,4.919226723431743276e-01,4.919226711232146942e-01,4.919226699050607277e-01,4.919226686897287260e-01,4.919226674786547071e-01,4.919226662739193956e-01,4.919226650784466193e-01,4.919226638965141785e-01,4.919226627342761504e-01,4.919226616007396080e-01,4.919226605090467608e-01,4.919226594787878271e-01,4.919226585395053419e-01,4.919226577371685338e-01,4.919226571465411535e-01,4.919226418741109441e-01,4.919226510963132237e-01,4.919226457893354221e-01,4.919226451930310273e-01,4.919226436908837874e-01,4.919226423083453703e-01,4.919226409395714983e-01,4.919226395868480650e-01,4.919226382517927765e-01,4.919226369338305926e-01,4.919226356323605498e-01,4.919226343465138429e-01,4.919226330752046739e-01,4.919226318173048895e-01,4.919226305715461711e-01,4.919226293366693037e-01,4.919226281113746047e-01,4.919226268944462688e-01,4.919226256846682133e-01,4.919226244808966308e-01,4.919226232820523292e-01,4.919226220871219524e-01,4.919226208952504065e-01,4.919226197055311944e-01,4.919226185172531074e-01,4.919226173296833426e-01,4.919226161422814436e-01,4.919226149545282700e-01,4.919226137659551967e-01,4.919226125762763968e-01,4.919226113851506432e-01,4.919226101923244165e-01,4.919226089975273220e-01,4.919226078006017078e-01,4.919226066013621113e-01,4.919226053996558212e-01,4.919226041952792783e-01,4.919226029880205409e-01,4.919226017777627025e-01,4.919226005641563759e-01,4.919225993467548630e-01,4.919225981250224256e-01,4.919225968982490760e-01,4.919225956654953436e-01,4.919225944255193883e-01,4.919225931766890714e-01,4.919225919168810357e-01,4.919225906433059015e-01,4.919225893523045956e-01,4.919225880390874495e-01,4.919225866973999106e-01,4.919225853189942987e-01,4.919225838930215700e-01,4.919225824050967311e-01,4.919225808362102659e-01,4.919225791609731502e-01,4.919225773454118378e-01,4.919225753436373694e-01,4.919225730933456386e-01,4.919225705089502743e-01,4.919225674715456131e-01,4.919225638123438937e-01,4.919225592845994921e-01 +1.708634998888129974e-01,1.701140517799071272e-01,1.686171517826240418e-01,1.636198592737923008e-01,1.615054032915168580e-01,1.592165590674856634e-01,1.536373395228178840e-01,1.507980957995826987e-01,1.416523416208679276e-01,1.394412048660398362e-01,1.367765780970195966e-01,1.337442705170541757e-01,1.303275650118322915e-01,1.264673634522752721e-01,1.221501622390783748e-01,1.173064493818081200e-01,1.117589357333579336e-01,1.054149325494078138e-01,9.812504248970888021e-02,8.961802264327300982e-02,1.906064230109649760e-01,1.863115143058888812e-01,1.825135401045747674e-01,1.792479641987005934e-01,1.764017530385884047e-01,1.739162506946654307e-01,1.718522725009892227e-01,1.699863103014678245e-01,1.684333692524986326e-01,1.670160250094325782e-01,1.657734399411625592e-01,1.647728780125736758e-01,1.638972018543130016e-01,1.631231088986619948e-01,1.624639572320039083e-01,1.619231911755585340e-01,1.615003791385976051e-01,1.610941357225124104e-01,1.606258978895072076e-01,1.599859396186651406e-01,1.654699967738924027e-01,1.652851918185083147e-01,1.651337564199433228e-01,1.650217283924300116e-01,1.649520148988057322e-01,1.649243408506815278e-01,1.649425622271301073e-01,1.649365005837450937e-01,1.648810313583350950e-01,1.648141792684536533e-01,1.647347433735975031e-01,1.646367675357716109e-01,1.645169311259457867e-01,1.643983922949323606e-01,1.642714100425630708e-01,1.640856612303911444e-01,1.638881137491883244e-01,1.636698072165663209e-01,1.634453642069984003e-01,1.632157224344210622e-01,1.630187722449341070e-01,1.628591711401334852e-01,1.627173779104118534e-01,1.626072470589781105e-01,1.625180758526432179e-01,1.624575718652732093e-01,1.624286332299622604e-01,1.624153776586971798e-01,1.624210943322155210e-01,1.624509578490671569e-01,1.624941817926692789e-01,1.625500685018457236e-01,1.626104437685589321e-01,1.626745939376541550e-01,1.627402225333718366e-01,1.628067722102524151e-01,1.628677472986177488e-01,1.629187932448912246e-01,1.629603134401436115e-01,1.629908534232951123e-01,1.630097169613857755e-01,1.630204756184496784e-01,1.630181096508205307e-01,1.630064340493002639e-01,1.629913233979534137e-01,1.629698327324797802e-01,1.629403319005808815e-01,1.629063901882896737e-01,1.628701483899097635e-01,1.628310426770886998e-01,1.627884976143716411e-01,1.627513590285640799e-01,1.627172391901163806e-01,1.626848456816956112e-01,1.626569988096784325e-01,1.626369692716296278e-01,1.626221522034749789e-01,1.626140573621976948e-01,1.626135498884042629e-01,1.626204004662206160e-01,1.626338267648348435e-01,1.626527414782326098e-01,1.626758715329745808e-01,1.627018453843736001e-01,1.627292692532924523e-01,1.627567956914020009e-01,1.627831826662435866e-01,1.628073392874305192e-01,1.628283616154975189e-01,1.628455576771239421e-01,1.628584573234130861e-01,1.628668116612586036e-01,1.628705903997222926e-01,1.628699711555712248e-01,1.628653192659219595e-01,1.628571637050457710e-01,1.628461714295499352e-01,1.628331197794772311e-01,1.628188730405286666e-01,1.628043696955379094e-01,1.627919687532080051e-01,1.627851779888513928e-01,1.627798908111317555e-01,1.627758734026281129e-01,1.627727741372193559e-01,1.627703586207769337e-01,1.627684617501585773e-01,1.627669634162751677e-01,1.627657743466064399e-01,1.627648272201129842e-01,1.627640705804058729e-01,1.627634647230360443e-01,1.627629787448370280e-01,1.627625883981689281e-01,1.627622745460008957e-01,1.627620219894663212e-01,1.627618185972543596e-01,1.627616546314989421e-01,1.627615222529832373e-01,1.627614151360292638e-01,1.627613281662825262e-01,1.627612572031622573e-01,1.627611988970478762e-01,1.627611505492216892e-01,1.627611099891830282e-01,1.627610754798243242e-01,1.627610456406209938e-01,1.627610193878519240e-01,1.627609958786255806e-01,1.627609744667122271e-01,1.627609546653863148e-01,1.627609361164363833e-01,1.627609185656020419e-01,1.627609018394868823e-01,1.627608858282290072e-01,1.627608704691374530e-01,1.627608557340169959e-01,1.627608416195576169e-01,1.627608281361234699e-01,1.627608153018260673e-01,1.627608031385507914e-01,1.627607916680120503e-01,1.627607809087199264e-01,1.627607708735605563e-01,1.627607615690469522e-01,1.627607529948140730e-01,1.627607451426156260e-01,1.627607379967479506e-01,1.627607315348391648e-01,1.627607257282854825e-01,1.627607205431336190e-01,1.627607159413255733e-01,1.627607118818443777e-01,1.627607083219853035e-01,1.627607052181234693e-01,1.627607025268931196e-01,1.627607002057167573e-01,1.627606982136988734e-01,1.627606965122359028e-01,1.627606950653255335e-01,1.627606938397281322e-01,1.627606928050835400e-01,1.627606919342345915e-01,1.627606912028971564e-01,1.627606905896066269e-01,1.627606900755524943e-01,1.627606896443876128e-01,1.627606892820347984e-01,1.627606889764523501e-01,1.627606887174388728e-01,1.627606884963985756e-01,1.627606883061520904e-01,1.627606881407479555e-01,1.627606879952809837e-01,1.627606878657446021e-01,1.627606877489007342e-01,1.627606876421558990e-01,1.627606875434495226e-01,1.627606874511802193e-01,1.627606873641116447e-01,1.627606872813152084e-01,1.627606872020928019e-01,1.627606871259346111e-01,1.627606870525164506e-01,1.627606869816164981e-01,1.627606869130802103e-01,1.627606868467976753e-01,1.627606867826787429e-01,1.627606867206428110e-01,1.627606866606103875e-01,1.627606866025013144e-01,1.627606865462287722e-01,1.627606864917061635e-01,1.627606864388340124e-01,1.627606863875188381e-01,1.627606863376547253e-01,1.627606862891415318e-01,1.627606862418808920e-01,1.627606861957686668e-01,1.627606861507133740e-01,1.627606861066206445e-01,1.627606860634063235e-01,1.627606860209869222e-01,1.627606859792953831e-01,1.627606859382610960e-01,1.627606858978267734e-01,1.627606858579444538e-01,1.627606858185710603e-01,1.627606857796741746e-01,1.627606857412302599e-01,1.627606857032215526e-01,1.627606856656449441e-01,1.627606856284968817e-01,1.627606855917849149e-01,1.627606855555230325e-01,1.627606855197243352e-01,1.627606854844023676e-01,1.627606854495600164e-01,1.627606854151877336e-01,1.627606853812324506e-01,1.627606853475898063e-01,1.627606853140666221e-01,1.627606852803236137e-01,1.627606852458070019e-01,1.627606852096423751e-01,1.627606851704803681e-01,1.627606851262468624e-01,1.627606850738323452e-01,1.627606850085279167e-01,1.627606849234064512e-01,1.627606848080573876e-01,1.627606846470188717e-01,1.627606844170823575e-01,1.627606840832711566e-01,1.627606835919213069e-01,1.627606828583469945e-01,1.627607402006157056e-01,1.627605888957379676e-01,1.627607525679248823e-01,1.627606580247686896e-01,1.627606924018376588e-01,1.627606832756265387e-01,1.627606848292180164e-01,1.627606844430187216e-01,1.627606843638820244e-01,1.627606842713531510e-01,1.627606841980993035e-01,1.627606841364408474e-01,1.627606840857418469e-01,1.627606840425022128e-01,1.627606840060080717e-01,1.627606839738839906e-01,1.627606839456725574e-01,1.627606839198671995e-01,1.627606838959732016e-01,1.627606838732023053e-01,1.627606838509680909e-01,1.627606838291975055e-01,1.627606838065114303e-01,1.627606837846518051e-01,1.627606837611268453e-01,1.627606837378254845e-01,1.627606837126922557e-01,1.627606836870134632e-01,1.627606836604822416e-01,1.627606836318651329e-01,1.627606836031412207e-01,1.627606835729928925e-01,1.627606835424864062e-01,1.627606835103609928e-01,1.627606834778412281e-01,1.627606834443129369e-01,1.627606834105361777e-01,1.627606833762544891e-01,1.627606833403452136e-01,1.627606833056800539e-01,1.627606832711359086e-01,1.627606832369108414e-01,1.627606832035921602e-01,1.627606831717234304e-01,1.627606831419303735e-01,1.627606831151848787e-01,1.627606830925270032e-01,1.627606830754961820e-01,1.627606830662866599e-01,1.627606830673857807e-01,1.627606830826011652e-01,1.627606831166124035e-01,1.627606831759418338e-01,1.627606832693269112e-01,1.627606834082617748e-01,1.627606836081185726e-01,1.627606838895079289e-01,1.627606842802236109e-01,1.627606848171747611e-01,1.627606855492653715e-01,1.627606865418507187e-01,1.627606878816083569e-01,1.627606896813695858e-01,1.627606458433352721e-01 +3.699751483298713284e-01,3.694664232909520840e-01,3.686688757008190764e-01,3.677490032562431010e-01,3.669205429291572118e-01,3.660033809694294149e-01,3.650941949002098896e-01,3.640830581680095657e-01,3.566573842362689706e-01,3.565272469250285736e-01,3.557584802925430334e-01,3.549784859321424291e-01,3.541413350902889445e-01,3.532040993612787783e-01,3.521924766609965118e-01,3.510827855405078690e-01,3.497605064079065684e-01,3.482422852916087774e-01,3.465163137152053596e-01,3.445036996879043967e-01,3.421013645979570361e-01,3.430176139871854990e-01,3.437536762965179848e-01,3.443732708334455439e-01,3.449055387820021412e-01,3.453853717422183944e-01,3.457821206163868566e-01,3.461040892050615825e-01,3.463978104685936366e-01,3.466749466467797802e-01,3.469415134680655100e-01,3.471939128430954757e-01,3.474238582907520079e-01,3.476334732343946965e-01,3.478074732971994654e-01,3.479531408964424699e-01,3.480426197541563460e-01,3.480866041497350238e-01,3.480848351671986252e-01,3.480201120315050689e-01,3.478673128515784585e-01,3.478804650216699157e-01,3.478896286936506987e-01,3.478924873806454321e-01,3.478906331104777427e-01,3.478980393310320274e-01,3.478959697872805457e-01,3.478803471186778795e-01,3.478498675280929930e-01,3.478032181540041123e-01,3.477322445353770441e-01,3.476458594648766942e-01,3.475550769396306694e-01,3.474632694373266384e-01,3.473728093978296627e-01,3.472905597274752454e-01,3.472144279026674885e-01,3.471417288126337208e-01,3.470761508283210506e-01,3.470214356303641390e-01,3.469735320917993748e-01,3.469406638464720416e-01,3.469257276122027500e-01,3.469162162015537731e-01,3.469072263217602425e-01,3.469082381927834358e-01,3.469127256809722004e-01,3.469202330099961928e-01,3.469318801499283178e-01,3.469496980734447789e-01,3.469697635946046854e-01,3.469906425592559351e-01,3.470168243164034050e-01,3.470435811658260650e-01,3.470670721808147841e-01,3.470863900326981444e-01,3.471031140498731515e-01,3.471157175770694381e-01,3.471238292828136562e-01,3.471289161727283412e-01,3.471312934007473872e-01,3.471313078506090277e-01,3.471301972860094676e-01,3.471270639776321554e-01,3.471199547453719947e-01,3.471103487868699156e-01,3.470995408953073125e-01,3.470878535052088765e-01,3.470757137260533920e-01,3.470643033508228337e-01,3.470537347103158643e-01,3.470424475518374963e-01,3.470319026456672451e-01,3.470231648033525462e-01,3.470161892427641726e-01,3.470111420416001069e-01,3.470092111059703832e-01,3.470101949009915532e-01,3.470136706989579989e-01,3.470192097715827373e-01,3.470263636549251740e-01,3.470346667909645633e-01,3.470436485204094201e-01,3.470528527660155516e-01,3.470618587868822824e-01,3.470702958149819994e-01,3.470778514342910404e-01,3.470842760137703431e-01,3.470893838634803164e-01,3.470930532776586586e-01,3.470952279610474145e-01,3.470959183107389379e-01,3.470951989109688496e-01,3.470932026506757251e-01,3.470901124093888068e-01,3.470861505538968550e-01,3.470815672799706930e-01,3.470766300965782980e-01,3.470716160334222922e-01,3.470668080118852750e-01,3.470624973825955917e-01,3.470599141193252413e-01,3.470578980697103244e-01,3.470562861587067061e-01,3.470549806288940609e-01,3.470539128825949615e-01,3.470530334656412030e-01,3.470523048545393063e-01,3.470516981781270327e-01,3.470511909480991641e-01,3.470507653856740315e-01,3.470504073073602536e-01,3.470501052979811929e-01,3.470498500699851774e-01,3.470496340177109951e-01,3.470494508618924279e-01,3.470492953841692874e-01,3.470491632196973653e-01,3.470490507052111373e-01,3.470489547557177312e-01,3.470488727683232466e-01,3.470488025390457976e-01,3.470487422039258418e-01,3.470486901903382937e-01,3.470486451700420805e-01,3.470486060216463331e-01,3.470485718021403820e-01,3.470485417235210091e-01,3.470485151282630687e-01,3.470484914715326608e-01,3.470484703022266304e-01,3.470484512486188833e-01,3.470484340070901785e-01,3.470484183298510605e-01,3.470484040160543016e-01,3.470483909028743152e-01,3.470483788584607932e-01,3.470483677759878538e-01,3.470483575685419653e-01,3.470483481635207590e-01,3.470483395001344729e-01,3.470483315268190760e-01,3.470483241990833800e-01,3.470483174773194568e-01,3.470483113258454044e-01,3.470483057121125925e-01,3.470483006052638153e-01,3.470482959754492280e-01,3.470482917936403844e-01,3.470482880313869312e-01,3.470482846605453808e-01,3.470482816534468107e-01,3.470482789828884806e-01,3.470482766225159166e-01,3.470482745467522445e-01,3.470482727309421311e-01,3.470482711513693808e-01,3.470482697857089627e-01,3.470482686129689465e-01,3.470482676135883682e-01,3.470482667694725354e-01,3.470482660639952477e-01,3.470482654820100099e-01,3.470482650097270749e-01,3.470482646346914613e-01,3.470482643456850314e-01,3.470482641326531059e-01,3.470482639866219188e-01,3.470482638996103542e-01,3.470482638645464579e-01,3.470482638751771765e-01,3.470482639259928059e-01,3.470482640121415607e-01,3.470482641293622939e-01,3.470482642739143309e-01,3.470482644425225693e-01,3.470482646323198028e-01,3.470482648407982595e-01,3.470482650657676360e-01,3.470482653053168498e-01,3.470482655577796227e-01,3.470482658217029504e-01,3.470482660958199572e-01,3.470482663790239175e-01,3.470482666703576524e-01,3.470482669689864963e-01,3.470482672741771468e-01,3.470482675852814558e-01,3.470482679017236616e-01,3.470482682229898419e-01,3.470482685486190877e-01,3.470482688781969527e-01,3.470482692113496803e-01,3.470482695477391522e-01,3.470482698870590021e-01,3.470482702290315080e-01,3.470482705734044271e-01,3.470482709199490534e-01,3.470482712684573312e-01,3.470482716187408001e-01,3.470482719706282637e-01,3.470482723239650680e-01,3.470482726786112693e-01,3.470482730344406908e-01,3.470482733913399231e-01,3.470482737492065484e-01,3.470482741079496392e-01,3.470482744674875386e-01,3.470482748277476936e-01,3.470482751886657113e-01,3.470482755501845262e-01,3.470482759122531236e-01,3.470482762748262617e-01,3.470482766378621409e-01,3.470482770013223472e-01,3.470482773651688557e-01,3.470482777293624199e-01,3.470482780938581313e-01,3.470482784586043090e-01,3.470482788235291771e-01,3.470482791885386997e-01,3.470482795535070331e-01,3.470482799182492695e-01,3.470482802825087809e-01,3.470482806459044278e-01,3.470482810079151270e-01,3.470482813677694400e-01,3.470482817243779050e-01,3.470482820761439102e-01,3.470482824208173112e-01,3.470482827551120142e-01,3.470482830742893654e-01,3.470482833713817161e-01,3.470482836362182577e-01,3.470482838535569603e-01,3.470482840002460656e-01,3.470482840396729163e-01,3.470482921024620748e-01,3.470482847491360712e-01,3.470482891357452582e-01,3.470482883688235654e-01,3.470482890860845382e-01,3.470482894782475625e-01,3.470482899105924446e-01,3.470482903280672216e-01,3.470482907383483639e-01,3.470482911414922156e-01,3.470482915382570588e-01,3.470482919291614787e-01,3.470482923148480170e-01,3.470482926958160519e-01,3.470482930725913850e-01,3.470482934456243229e-01,3.470482938153795494e-01,3.470482941822827239e-01,3.470482945467202596e-01,3.470482949090704095e-01,3.470482952696658518e-01,3.470482956288523657e-01,3.470482959868633754e-01,3.470482963440452706e-01,3.470482967005836805e-01,3.470482970567602687e-01,3.470482974127222509e-01,3.470482977686542569e-01,3.470482981247315912e-01,3.470482984810122629e-01,3.470482988376558109e-01,3.470482991947487772e-01,3.470482995524244996e-01,3.470482999107311062e-01,3.470483002697739017e-01,3.470483006296268824e-01,3.470483009904116734e-01,3.470483013522515092e-01,3.470483017151833049e-01,3.470483020794431495e-01,3.470483024452689635e-01,3.470483028129380254e-01,3.470483031828169307e-01,3.470483035553831308e-01,3.470483039312508011e-01,3.470483043112255750e-01,3.470483046963509510e-01,3.470483050879741849e-01,3.470483054878603091e-01,3.470483058982905544e-01,3.470483063222713493e-01,3.470483067637217256e-01,3.470483072277931735e-01,3.470483077212854761e-01,3.470483082532304087e-01,3.470483088356118850e-01,3.470483094844210026e-01,3.470483102211289195e-01,3.470483110748214250e-01,3.470483120850967329e-01,3.470483133065271897e-01,3.470483148155929509e-01,3.470483167230536403e-01 +1.152980871645526095e+00,1.154601798675062296e+00,1.156283294010398865e+00,1.157928844073819130e+00,1.158667874885286109e+00,1.159168490010279662e+00,1.159293030907042166e+00,1.158575589945612716e+00,1.164753439052977013e+00,1.161012948413439494e+00,1.157975859710064448e+00,1.154994575202251683e+00,1.151850259792503328e+00,1.148501539174514363e+00,1.144883146436989740e+00,1.140906676372225315e+00,1.136492599099939937e+00,1.131549402324158793e+00,1.125935536302145046e+00,1.119546496195803931e+00,1.112237269303320009e+00,1.125723724493481681e+00,1.137024949885582004e+00,1.146484564221916580e+00,1.154423368760294055e+00,1.161077182047583145e+00,1.166686981363863840e+00,1.171452633332181970e+00,1.175450647011145877e+00,1.178834931170267497e+00,1.181643156862552058e+00,1.183969958813452239e+00,1.185920242698170313e+00,1.187547744068668143e+00,1.188917082094501643e+00,1.190063905696997937e+00,1.191060970891153037e+00,1.191931575948356414e+00,1.192684615830075678e+00,1.193342036653966876e+00,1.193907827562876278e+00,1.195347552735160024e+00,1.196622069867929072e+00,1.197750889179621137e+00,1.198755012721360647e+00,1.199642636407521223e+00,1.200456802182439775e+00,1.201219140484346637e+00,1.201930873719375459e+00,1.202598880577156804e+00,1.203242745437069772e+00,1.203859661750383392e+00,1.204442437161572954e+00,1.204979803295646468e+00,1.205471005846320498e+00,1.205916000552165412e+00,1.206315015908141497e+00,1.206677728648906989e+00,1.206990525270777104e+00,1.207255601201891348e+00,1.207475586524232813e+00,1.207648219623619346e+00,1.207781885029654667e+00,1.207883697399442902e+00,1.207968186497243801e+00,1.208026073409922407e+00,1.208067472979627910e+00,1.208102376449544213e+00,1.208124753624823411e+00,1.208133219692473004e+00,1.208137849200743519e+00,1.208141527342021293e+00,1.208140920694900533e+00,1.208136057108476713e+00,1.208129389040081936e+00,1.208122989865371810e+00,1.208119036964980353e+00,1.208120127573995006e+00,1.208126551611194532e+00,1.208138030081642667e+00,1.208154029535437601e+00,1.208173046375686788e+00,1.208194548624953901e+00,1.208214390101071345e+00,1.208233075377352250e+00,1.208253177630218778e+00,1.208274079597837503e+00,1.208293644024283520e+00,1.208311772115517657e+00,1.208328069266887406e+00,1.208341117084958283e+00,1.208349827554181743e+00,1.208357467984983780e+00,1.208364136280837275e+00,1.208368662536947191e+00,1.208371094392296952e+00,1.208372164171814589e+00,1.208370518410006422e+00,1.208365882880488185e+00,1.208358679789900192e+00,1.208349556131856462e+00,1.208339214417821994e+00,1.208328348943573660e+00,1.208317608077787542e+00,1.208307563175003541e+00,1.208298684982860527e+00,1.208291331225213705e+00,1.208285744706770304e+00,1.208282059186304602e+00,1.208280312093476194e+00,1.208280459472963697e+00,1.208282386319019519e+00,1.208285913123424038e+00,1.208290804933770168e+00,1.208296783325052859e+00,1.208303539607949117e+00,1.208310750445447335e+00,1.208318095444119722e+00,1.208325273125583132e+00,1.208332013428324858e+00,1.208338085750424451e+00,1.208353259426667048e+00,1.208365448746405502e+00,1.208375329390425135e+00,1.208383414562812064e+00,1.208390081412765715e+00,1.208395614378195981e+00,1.208400233125860534e+00,1.208404109378004243e+00,1.208407378700554036e+00,1.208410149102464581e+00,1.208412507239148725e+00,1.208414523075557634e+00,1.208416253452977873e+00,1.208417744775460712e+00,1.208419035113128981e+00,1.208420155832893306e+00,1.208421132882884219e+00,1.208421987794795927e+00,1.208422738489185022e+00,1.208423399920464991e+00,1.208423984604591217e+00,1.208424503037178521e+00,1.208424964035829330e+00,1.208425375030477644e+00,1.208425742299561678e+00,1.208426071161722293e+00,1.208426366133988905e+00,1.208426631069278168e+00,1.208426869266479686e+00,1.208427083566094185e+00,1.208427276427273211e+00,1.208427449990292502e+00,1.208427606131627030e+00,1.208427746507046763e+00,1.208427872588661245e+00,1.208427985694241258e+00,1.208428087011006458e+00,1.208428177615215926e+00,1.208428258488661644e+00,1.208428330529456973e+00,1.208428394561621655e+00,1.208428451342854704e+00,1.208428501571344071e+00,1.208428545890259942e+00,1.208428584891640289e+00,1.208428619120777148e+00,1.208428649079316575e+00,1.208428675227558591e+00,1.208428697986813738e+00,1.208428717741726555e+00,1.208428734842076135e+00,1.208428749604824493e+00,1.208428762315711724e+00,1.208428773231464470e+00,1.208428782581707273e+00,1.208428790571071776e+00,1.208428797380697528e+00,1.208428803170345844e+00,1.208428808080279637e+00,1.208428812233109273e+00,1.208428815735556050e+00,1.208428818680077343e+00,1.208428821146587895e+00,1.208428823203864688e+00,1.208428824910927402e+00,1.208428826318254989e+00,1.208428827468895017e+00,1.208428828399469968e+00,1.208428829141069416e+00,1.208428829720060937e+00,1.208428830158788214e+00,1.208428830476196980e+00,1.208428830688362376e+00,1.208428830808950583e+00,1.208428830849598068e+00,1.208428830820246214e+00,1.208428830729410430e+00,1.208428830584407532e+00,1.208428830391546027e+00,1.208428830156286882e+00,1.208428829883376077e+00,1.208428829576954744e+00,1.208428829240652203e+00,1.208428828877662120e+00,1.208428828490819118e+00,1.208428828082653395e+00,1.208428827655437132e+00,1.208428827211216028e+00,1.208428826751836604e+00,1.208428826278966639e+00,1.208428825794114703e+00,1.208428825298642151e+00,1.208428824793778666e+00,1.208428824280632252e+00,1.208428823760200332e+00,1.208428823233377081e+00,1.208428822700963634e+00,1.208428822163676086e+00,1.208428821622151261e+00,1.208428821076956039e+00,1.208428820528591130e+00,1.208428819977499735e+00,1.208428819424071765e+00,1.208428818868650279e+00,1.208428818311535924e+00,1.208428817752991380e+00,1.208428817193247795e+00,1.208428816632506120e+00,1.208428816070944212e+00,1.208428815508718390e+00,1.208428814945968321e+00,1.208428814382819683e+00,1.208428813819389713e+00,1.208428813255786993e+00,1.208428812692118770e+00,1.208428812128491403e+00,1.208428811565017469e+00,1.208428811001813097e+00,1.208428810439014178e+00,1.208428809876768373e+00,1.208428809315238883e+00,1.208428808754621775e+00,1.208428808195133763e+00,1.208428807637039526e+00,1.208428807080613732e+00,1.208428806526192556e+00,1.208428805974126830e+00,1.208428805424835550e+00,1.208428804878704188e+00,1.208428804336167062e+00,1.208428803797604756e+00,1.208428803263414508e+00,1.208428802733842566e+00,1.208428802209199349e+00,1.208428801690016430e+00,1.208428801178264234e+00,1.208428802438419769e+00,1.208428791220163889e+00,1.208428800163521277e+00,1.208428795264774536e+00,1.208428795921806520e+00,1.208428795018447133e+00,1.208428794409532436e+00,1.208428793745333740e+00,1.208428793084001196e+00,1.208428792423271503e+00,1.208428791766773092e+00,1.208428791116531009e+00,1.208428790474081804e+00,1.208428789840248374e+00,1.208428789215563626e+00,1.208428788600080406e+00,1.208428787993689468e+00,1.208428787395988024e+00,1.208428786806506894e+00,1.208428786224624796e+00,1.208428785649667159e+00,1.208428785080947421e+00,1.208428784517655785e+00,1.208428783959234476e+00,1.208428783404827067e+00,1.208428782853887995e+00,1.208428782305636107e+00,1.208428781759546711e+00,1.208428781215069359e+00,1.208428780671570335e+00,1.208428780128735003e+00,1.208428779586080415e+00,1.208428779043310142e+00,1.208428778499988976e+00,1.208428777955887767e+00,1.208428777410699206e+00,1.208428776864229670e+00,1.208428776316236020e+00,1.208428775766361651e+00,1.208428775214609230e+00,1.208428774660732508e+00,1.208428774104475023e+00,1.208428773545583201e+00,1.208428772983766386e+00,1.208428772418669972e+00,1.208428771849874739e+00,1.208428771276839786e+00,1.208428770698911192e+00,1.208428770115295148e+00,1.208428769524970470e+00,1.208428768926672170e+00,1.208428768318787982e+00,1.208428767699286199e+00,1.208428767065577780e+00,1.208428766414253008e+00,1.208428765740847455e+00,1.208428765039427200e+00,1.208428764302001746e+00,1.208428763517434223e+00,1.208428762669896850e+00,1.208428761736194623e+00,1.208428760680888558e+00,1.208428759445584477e+00 +6.738214240263724897e-02,6.707879525251313202e-02,6.676539725400669478e-02,6.645995784215348590e-02,6.632318630111469493e-02,6.623068122705036420e-02,6.620768891733604111e-02,6.634026311743634885e-02,6.520636610894113561e-02,6.589086017745593438e-02,6.645129144258191123e-02,6.700552749838818711e-02,6.759451966837468073e-02,6.822687546376880741e-02,6.891610456771563031e-02,6.968075525171825435e-02,7.053852353805969977e-02,7.151048348443433955e-02,7.262913222051206596e-02,7.392179360746148342e-02,7.542672447759438126e-02,7.267176344919534792e-02,7.043476207101304065e-02,6.861054906961013000e-02,6.711246715760882386e-02,6.587934911169093799e-02,6.485528696312153896e-02,6.399630547822796056e-02,6.328334528149544280e-02,6.268521857610578896e-02,6.219261132651772439e-02,6.178697531433248458e-02,6.144872471175161915e-02,6.116766676053422835e-02,6.093203956671677107e-02,6.073529398502133803e-02,6.056467815290581674e-02,6.041603362744586703e-02,6.028771031039391326e-02,6.017586908008128177e-02,6.007975588182674909e-02,5.983579497698586491e-02,5.962052805529476085e-02,5.943041626873134253e-02,5.926173545392218744e-02,5.911296158133064887e-02,5.897677724276922939e-02,5.884950226067157258e-02,5.873088529208192465e-02,5.861973925938149949e-02,5.851277815806363997e-02,5.841044838390918592e-02,5.831392039344812650e-02,5.822503317041705095e-02,5.814388197506410033e-02,5.807044703519031320e-02,5.800466638526591973e-02,5.794492513195645400e-02,5.789344755970587952e-02,5.784985407682055603e-02,5.781369767299234658e-02,5.778533810839163454e-02,5.776338883133252944e-02,5.774667570446495590e-02,5.773280955011064752e-02,5.772331158011239499e-02,5.771652001265978327e-02,5.771079447242242338e-02,5.770712432933736147e-02,5.770573638682561374e-02,5.770497747631456176e-02,5.770437430270355939e-02,5.770447389075018807e-02,5.770527177855497986e-02,5.770636549964211492e-02,5.770741484226735163e-02,5.770806258221750085e-02,5.770788266647954023e-02,5.770682759954805230e-02,5.770494325098476929e-02,5.770231729650533714e-02,5.769919655060840036e-02,5.769566836356672390e-02,5.769241302144942352e-02,5.768934760502629489e-02,5.768604994302613254e-02,5.768262140469378879e-02,5.767941258010232664e-02,5.767643959400264170e-02,5.767376712222515439e-02,5.767162774545136344e-02,5.767019978565085525e-02,5.766894726535738008e-02,5.766785419536788609e-02,5.766711242953874439e-02,5.766671409535346904e-02,5.766653907684318736e-02,5.766680936013497683e-02,5.766756987218987773e-02,5.766875135694551208e-02,5.767024771572473729e-02,5.767194375150969804e-02,5.767372561344948079e-02,5.767548697827788035e-02,5.767713414834793606e-02,5.767858992250358280e-02,5.767979563487783679e-02,5.768071146812166206e-02,5.768131549195028296e-02,5.768160157832934176e-02,5.768157695050170342e-02,5.768126048743488221e-02,5.768068164871192199e-02,5.767987898710889849e-02,5.767889818315674599e-02,5.767778987702766591e-02,5.767660710582589445e-02,5.767540241769257559e-02,5.767422525243094678e-02,5.767311989192733246e-02,5.767212414243166885e-02,5.766963582264037630e-02,5.766763702511433498e-02,5.766601684154682578e-02,5.766469108870211913e-02,5.766359790638499877e-02,5.766269064467870881e-02,5.766193327926792678e-02,5.766129765037862620e-02,5.766076152863049142e-02,5.766030720422757327e-02,5.765992046929067916e-02,5.765958985294707129e-02,5.765930603629922102e-02,5.765906141182104705e-02,5.765884973841364086e-02,5.765866587398553456e-02,5.765850556483151368e-02,5.765836528127664395e-02,5.765824208563539305e-02,5.765813352646011192e-02,5.765803755202737052e-02,5.765795244179011680e-02,5.765787675025675629e-02,5.765780925939387180e-02,5.765774893991137962e-02,5.765769491983736839e-02,5.765764645858945797e-02,5.765760292443541934e-02,5.765756377645063491e-02,5.765752854884217266e-02,5.765749683832224748e-02,5.765746829387058403e-02,5.765744260770759577e-02,5.765741950823188161e-02,5.765739875394883945e-02,5.765738012866623852e-02,5.765736343759656629e-02,5.765734850414669377e-02,5.765733516721566199e-02,5.765732327942667268e-02,5.765731270555866234e-02,5.765730332127136371e-02,5.765729501198890022e-02,5.765728767216307671e-02,5.765728120463687462e-02,5.765727551992540223e-02,5.765727053570793986e-02,5.765726617645029750e-02,5.765726237301863066e-02,5.765725906229829389e-02,5.765725618689762633e-02,5.765725369481247004e-02,5.765725153916377577e-02,5.765724967783503879e-02,5.765724807315848743e-02,5.765724669156865878e-02,5.765724550335557530e-02,5.765724448231792504e-02,5.765724360545401717e-02,5.765724285265869803e-02,5.765724220643374254e-02,5.765724165162096349e-02,5.765724117511977775e-02,5.765724076565621053e-02,5.765724041355668739e-02,5.765724011054804837e-02,5.765723984957552700e-02,5.765723962463791680e-02,5.765723943064078594e-02,5.765723926326379867e-02,5.765723911884595987e-02,5.765723899428310678e-02,5.765723888694132548e-02,5.765723879458151124e-02,5.765723871529680744e-02,5.765723864745820465e-02,5.765723858967018722e-02,5.765723854073344368e-02,5.765723849961375269e-02,5.765723846541585818e-02,5.765723843736154930e-02,5.765723841477157080e-02,5.765723839705054476e-02,5.765723838367443899e-02,5.765723837417818798e-02,5.765723836814633935e-02,5.765723836520585122e-02,5.765723836502080479e-02,5.765723836728788021e-02,5.765723837173303279e-02,5.765723837810840524e-02,5.765723838619005864e-02,5.765723839577576587e-02,5.765723840668320055e-02,5.765723841874811906e-02,5.765723843182310460e-02,5.765723844577593654e-02,5.765723846048829287e-02,5.765723847585471629e-02,5.765723849178113619e-02,5.765723850818400831e-02,5.765723852498917668e-02,5.765723854213097854e-02,5.765723855955134924e-02,5.765723857719871198e-02,5.765723859502769333e-02,5.765723861299787423e-02,5.765723863107354019e-02,5.765723864922286251e-02,5.765723866741787745e-02,5.765723868563355642e-02,5.765723870384818067e-02,5.765723872204195355e-02,5.765723874019894335e-02,5.765723875830548739e-02,5.765723877635225286e-02,5.765723879433361232e-02,5.765723881225185560e-02,5.765723883011397710e-02,5.765723884793612364e-02,5.765723886575308682e-02,5.765723888361495852e-02,5.765723890160115439e-02,5.765723891981445332e-02,5.765723893841678827e-02,5.765723895761958040e-02,5.765723897772255524e-02,5.765723899910427108e-02,5.765723902230421305e-02,5.765723904801998978e-02,5.765723907718838664e-02,5.765723911097576926e-02,5.765723915090216478e-02,5.765723919873765729e-02,5.765723925628164770e-02,5.765723932442340383e-02,5.765723443907722762e-02,5.765724035451545021e-02,5.765723724007323914e-02,5.765723847582648887e-02,5.765723835704209682e-02,5.765723855828146227e-02,5.765723870767993503e-02,5.765723886260602782e-02,5.765723901222953585e-02,5.765723915551807660e-02,5.765723929114442703e-02,5.765723941837638811e-02,5.765723953681738123e-02,5.765723964640447063e-02,5.765723974723734047e-02,5.765723983960138049e-02,5.765723992385796137e-02,5.765724000047506292e-02,5.765724006993876161e-02,5.765724013277233329e-02,5.765724018950529189e-02,5.765724024065795039e-02,5.765724028677785690e-02,5.765724032831392315e-02,5.765724036578616374e-02,5.765724039961245273e-02,5.765724043026318468e-02,5.765724045812339188e-02,5.765724048355846953e-02,5.765724050695647529e-02,5.765724052859219628e-02,5.765724054876546212e-02,5.765724056771069639e-02,5.765724058569259014e-02,5.765724060290496750e-02,5.765724061954444896e-02,5.765724063575968644e-02,5.765724065169482854e-02,5.765724066752701826e-02,5.765724068329678570e-02,5.765724069907639943e-02,5.765724071493161240e-02,5.765724073089901341e-02,5.765724074698869162e-02,5.765724076318291813e-02,5.765724077943058107e-02,5.765724079565154314e-02,5.765724081171649806e-02,5.765724082743712425e-02,5.765724084256530768e-02,5.765724085678338579e-02,5.765724086968236628e-02,5.765724088076405740e-02,5.765724088942190267e-02,5.765724089500327831e-02,5.765724089680875075e-02,5.765724089421619264e-02,5.765724088684073823e-02,5.765724087500736367e-02,5.765724086045797420e-02,5.765724084794830728e-02,5.765724084843978914e-02,5.765724088764605931e-02 +8.180075724249723235e-02,8.227888576320586955e-02,8.069179706054914469e-02,7.854953094915509415e-02,7.716151631580231429e-02,7.385088234683458153e-02,7.377319230185613863e-02,7.243873154420431282e-02,7.201667143156520456e-02,7.075727614214036287e-02,7.010502441673722995e-02,6.943378227299430716e-02,6.894446460526035270e-02,6.853067440867595395e-02,6.814184439604477339e-02,6.772232025856191051e-02,6.716099113568246848e-02,6.660748977103436719e-02,6.615499593820499402e-02,6.573806766737817775e-02,6.525065860030798692e-02,6.554158766594522789e-02,6.589504250842224964e-02,6.620022742991996112e-02,6.649527254343445826e-02,6.675960729370754299e-02,6.686955023995047598e-02,6.700210031970475766e-02,6.710334901736286772e-02,6.720857194957427505e-02,6.734140966877616430e-02,6.739007888049558526e-02,6.743029419761412124e-02,6.746337843003998025e-02,6.743091310218232715e-02,6.731531037340994506e-02,6.706380600556686999e-02,6.676528748280573244e-02,6.647713952955400241e-02,6.622086439908464461e-02,6.596354594412241756e-02,6.585067398766386582e-02,6.577886342977953826e-02,6.572243844920487577e-02,6.566609746124504876e-02,6.561125337190203133e-02,6.551859953724360752e-02,6.544625249487469321e-02,6.542320170322124540e-02,6.539217292177863794e-02,6.533975092142482732e-02,6.528568223803869752e-02,6.523151992503302410e-02,6.516608894272096775e-02,6.511355678188734952e-02,6.513272674311249011e-02,6.516924002317842080e-02,6.521091718165608619e-02,6.526990122224554658e-02,6.533785144965723046e-02,6.537687927944620114e-02,6.540346888640040379e-02,6.542413901718925617e-02,6.543278616910312706e-02,6.542860113959961255e-02,6.541516267850790156e-02,6.539304415969367235e-02,6.536313708738059058e-02,6.533125289552745019e-02,6.529775123260732339e-02,6.526511828177970764e-02,6.523362529354247152e-02,6.520814947447836629e-02,6.518691124681864901e-02,6.516839366001722644e-02,6.515235382219516924e-02,6.514144500500013146e-02,6.513597344671237521e-02,6.513566713591205370e-02,6.514106211411677116e-02,6.515186589557706021e-02,6.516710741884458591e-02,6.518631078129955014e-02,6.520757053018916283e-02,6.522781655488182895e-02,6.524700594948497356e-02,6.526570368404094324e-02,6.528327295985439371e-02,6.529893076632288518e-02,6.531267571829979524e-02,6.532381648090475335e-02,6.533037103748265406e-02,6.533266712496581252e-02,6.533186593701222067e-02,6.532798298377540114e-02,6.532112568077109993e-02,6.531251866637106940e-02,6.530269894389834073e-02,6.529171717828299859e-02,6.527988685715399586e-02,6.526768597503521119e-02,6.525564465139450931e-02,6.524428567212520180e-02,6.523408497856308941e-02,6.522544466244134531e-02,6.521867598099029273e-02,6.521398773448645880e-02,6.521148024381782926e-02,6.521114603485743400e-02,6.521287683180310157e-02,6.521647657771413586e-02,6.522167882650549420e-02,6.522816511358052460e-02,6.523558351226756147e-02,6.524356665546476863e-02,6.525174850218926070e-02,6.525977956540633673e-02,6.526734115317543716e-02,6.527415862644200817e-02,6.528001380567383105e-02,6.528475659046624469e-02,6.528400875576563511e-02,6.528375201273085848e-02,6.528356023761031079e-02,6.528341753178447393e-02,6.528331203793248660e-02,6.528323510008543495e-02,6.528317991805694664e-02,6.528314135982435373e-02,6.528311550460985657e-02,6.528309933128650933e-02,6.528309049116762242e-02,6.528308715134517604e-02,6.528308787457626217e-02,6.528309152982955665e-02,6.528309722821000471e-02,6.528310426751925133e-02,6.528311209888978950e-02,6.528312029489885537e-02,6.528312852505868680e-02,6.528313654088006845e-02,6.528314415880027977e-02,6.528315124922191848e-02,6.528315772511268655e-02,6.528316353489974078e-02,6.528316865460011276e-02,6.528317308319557533e-02,6.528317683690042228e-02,6.528317994582197303e-02,6.528318245116425389e-02,6.528318440036251502e-02,6.528318584486303422e-02,6.528318683954709156e-02,6.528318743985350725e-02,6.528318770063305798e-02,6.528318767489893482e-02,6.528318741334594721e-02,6.528318696319281023e-02,6.528318636804353314e-02,6.528318566652187294e-02,6.528318489310612482e-02,6.528318407816101343e-02,6.528318324778630000e-02,6.528318242368778834e-02,6.528318162343618725e-02,6.528318086103010454e-02,6.528318014708425765e-02,6.528317948891008971e-02,6.528317889107321248e-02,6.528317835592477303e-02,6.528317788383043718e-02,6.528317747361664369e-02,6.528317712286089980e-02,6.528317682821407897e-02,6.528317658573468130e-02,6.528317639092000302e-02,6.528317623907582690e-02,6.528317612557869853e-02,6.528317604584663036e-02,6.528317599551364259e-02,6.528317597059654642e-02,6.528317596752265806e-02,6.528317598291598356e-02,6.528317601376981694e-02,6.528317605742889329e-02,6.528317611158214462e-02,6.528317617424890529e-02,6.528317624375032380e-02,6.528317631867924797e-02,6.528317639786990201e-02,6.528317648036871534e-02,6.528317656540522096e-02,6.528317665236683942e-02,6.528317674077362132e-02,6.528317683025744445e-02,6.528317692054122490e-02,6.528317701142373475e-02,6.528317710276509978e-02,6.528317719447375433e-02,6.528317728649564444e-02,6.528317737880461047e-02,6.528317747139353311e-02,6.528317756426808838e-02,6.528317765744147405e-02,6.528317775093871178e-02,6.528317784477939700e-02,6.528317793897739363e-02,6.528317803354062587e-02,6.528317812847163337e-02,6.528317822376787649e-02,6.528317831942258287e-02,6.528317841542512212e-02,6.528317851176208830e-02,6.528317860841763298e-02,6.528317870537435341e-02,6.528317880261370887e-02,6.528317890011664515e-02,6.528317899786389988e-02,6.528317909583651601e-02,6.528317919401611935e-02,6.528317929238504347e-02,6.528317939092677380e-02,6.528317948962575334e-02,6.528317958846796554e-02,6.528317968744047628e-02,6.528317978653171150e-02,6.528317988573160979e-02,6.528317998503133102e-02,6.528318008442297871e-02,6.528318018390046051e-02,6.528318028345778123e-02,6.528318038309052773e-02,6.528318048279410646e-02,6.528318058256432632e-02,6.528318068239613581e-02,6.528318078228377563e-02,6.528318088221868321e-02,6.528318098218853505e-02,6.528318108217623372e-02,6.528318118215219179e-02,6.528318128207852289e-02,6.528318138189544151e-02,6.528318148151807110e-02,6.528318158083007416e-02,6.528318167964286545e-02,6.528318177771018360e-02,6.528318187466357336e-02,6.528318196998406098e-02,6.528318206292735293e-02,6.528318215240888622e-02,6.528318223692018696e-02,6.528318231426780138e-02,6.528318238124211637e-02,6.528318243324793269e-02,6.528318246345593545e-02,6.528318246179617979e-02,6.528318241271283129e-02,6.528318531999234564e-02,6.528318271388472427e-02,6.528318423013872163e-02,6.528318395337132096e-02,6.528318417892453596e-02,6.528318429170396064e-02,6.528318441475049194e-02,6.528318453071363381e-02,6.528318464253028697e-02,6.528318475070932214e-02,6.528318485581487141e-02,6.528318495832692581e-02,6.528318505869817878e-02,6.528318515726110050e-02,6.528318525436310749e-02,6.528318535024803249e-02,6.528318544518488253e-02,6.528318553937083324e-02,6.528318563299109756e-02,6.528318572621688576e-02,6.528318581918285401e-02,6.528318591202333931e-02,6.528318600481615441e-02,6.528318609769534486e-02,6.528318619070593021e-02,6.528318628394959300e-02,6.528318637745005037e-02,6.528318647126196694e-02,6.528318656542790588e-02,6.528318665994110870e-02,6.528318675484222344e-02,6.528318685014462830e-02,6.528318694588215731e-02,6.528318704205346434e-02,6.528318713868598577e-02,6.528318723579511207e-02,6.528318733342371172e-02,6.528318743161869164e-02,6.528318753038911404e-02,6.528318762984433588e-02,6.528318773010190201e-02,6.528318783129941072e-02,6.528318793362383743e-02,6.528318803732147124e-02,6.528318814271173720e-02,6.528318825021726945e-02,6.528318836038052297e-02,6.528318847390633672e-02,6.528318859171464150e-02,6.528318871497928999e-02,6.528318884525405319e-02,6.528318898455498509e-02,6.528318913551828251e-02,6.528318930160537104e-02,6.528318948736917815e-02,6.528318969886300061e-02,6.528318994407134035e-02,6.528319023361549289e-02,6.528319058179053724e-02,6.528319100782574436e-02,6.528319153786675544e-02,6.528319220769567000e-02,6.528319306727184412e-02 diff --git a/taxbrain/ogusa_baseline/SS/SS_vars.pkl b/taxbrain/ogusa_baseline/SS/SS_vars.pkl new file mode 100644 index 0000000..8aa89aa Binary files /dev/null and b/taxbrain/ogusa_baseline/SS/SS_vars.pkl differ diff --git a/taxbrain/ogusa_baseline/TPI/TPI_vars.pkl b/taxbrain/ogusa_baseline/TPI/TPI_vars.pkl new file mode 100644 index 0000000..7b08937 Binary files /dev/null and b/taxbrain/ogusa_baseline/TPI/TPI_vars.pkl differ diff --git a/taxbrain/report.py b/taxbrain/report.py index cbc7601..2cf527c 100644 --- a/taxbrain/report.py +++ b/taxbrain/report.py @@ -1,14 +1,23 @@ import shutil +from taxbrain.utils import is_paramtools_format import behresp import taxbrain import taxcalc as tc from pathlib import Path -from .report_utils import (form_intro, form_baseline_intro, write_text, date, - largest_tax_change, notable_changes, - behavioral_assumptions, consumption_assumptions, - policy_table, convert_table, growth_assumptions, - md_to_pdf, DIFF_TABLE_ROW_NAMES, - dollar_str_formatting) +# from taxbrain.report_utils import ( +# form_intro, form_baseline_intro, write_text, date, +# largest_tax_change, notable_changes, +# behavioral_assumptions, consumption_assumptions, +# policy_table, convert_table, growth_assumptions, +# md_to_pdf, DIFF_TABLE_ROW_NAMES, +# dollar_str_formatting) +from taxbrain.report_utils import ( + form_intro, form_baseline_intro, write_text, date, + largest_tax_change, notable_changes, + behavioral_assumptions, consumption_assumptions, + policy_table, convert_table, growth_assumptions, + DIFF_TABLE_ROW_NAMES, + dollar_str_formatting) CUR_PATH = Path(__file__).resolve().parent @@ -42,7 +51,7 @@ def report(tb, name=None, change_threshold=0.05, description=None, created clean: bool boolean indicating whether all of the files written to create the - report should be deleated and a byte representation of the PDF returned + report should be deleted and a byte representation of the PDF returned Returns -------- @@ -143,7 +152,7 @@ def export_plot(plot, graph): pol_areas = list(pol_areas) # add policy areas to the intro text text_args["introduction"] = form_intro(pol_areas, description) - # write final sentance of introduction + # write final sentence of introduction current_law = tb.params["base_policy"] text_args["baseline_intro"] = form_baseline_intro(current_law) @@ -230,7 +239,7 @@ def export_plot(plot, graph): if verbose: print("Compiling assumptions") text_args["behavior_assumps"] = behavioral_assumptions(tb) - # consumption asssumptions + # consumption assumptions text_args["consump_assumps"] = consumption_assumptions(tb) # growth assumptions text_args["growth_assumps"] = growth_assumptions(tb) diff --git a/taxbrain/report_utils.py b/taxbrain/report_utils.py index f03f31f..8cc7b9f 100644 --- a/taxbrain/report_utils.py +++ b/taxbrain/report_utils.py @@ -2,7 +2,7 @@ Helper Functions for creating the automated reports """ import json -import pypandoc +# import pypandoc import numpy as np import pandas as pd import taxcalc as tc @@ -11,7 +11,7 @@ from datetime import datetime from tabulate import tabulate from collections import defaultdict, deque -from .utils import is_paramtools_format +from taxbrain import utils from typing import Union @@ -43,30 +43,31 @@ '$100-200K', '$200-500K', '$500K-1M', '>$1M', 'ALL'] -def md_to_pdf(md_text, outputfile_path): - """ - Convert Markdown version of report to a PDF. Returns bytes that can be - saved as a PDF +# def md_to_pdf(md_text, outputfile_path): +# """ +# Convert Markdown version of report to a PDF. Returns bytes that can be +# saved as a PDF - Parameters - ---------- - md_text: str - report template written in markdown - outputfile_path: str - path to where the final file sohould be written +# Parameters +# ---------- +# md_text: str +# report template written in markdown +# outputfile_path: str +# path to where the final file sohould be written + +# Returns +# ------- +# None +# Markdown text is saved as a PDF and the HTML used to create +# the report +# """ +# # convert markdown text to pdf with pandoc +# pypandoc.convert_text( +# md_text, 'pdf', format='md', outputfile=outputfile_path, +# extra_args=['-V', 'geometry:margin=1.5cm', +# '--pdf-engine', 'pdflatex'] +# ) - Returns - ------- - None - Markdown text is saved as a PDF and the HTML used to create - the report - """ - # convert markdown text to pdf with pandoc - pypandoc.convert_text( - md_text, 'pdf', format='md', outputfile=outputfile_path, - extra_args=['-V', 'geometry:margin=1.5cm', - '--pdf-engine', 'pdflatex'] - ) def convert_table(df, tablefmt: str = "pipe") -> str: @@ -126,7 +127,7 @@ def policy_table(params): } reform_years = set() reform_by_year = defaultdict(lambda: deque()) - if is_paramtools_format(params): + if utils.is_paramtools_format(params): params = convert_params(params) pol = tc.Policy() # policy object used for getting original value # loop through all of the policy parameters in a given reform diff --git a/taxbrain/taxbrain.py b/taxbrain/taxbrain.py index b0e572a..2fd84a8 100644 --- a/taxbrain/taxbrain.py +++ b/taxbrain/taxbrain.py @@ -6,6 +6,7 @@ from dask import compute, delayed from collections import defaultdict from taxbrain.utils import weighted_sum, update_policy +from taxbrain.tbogusa import run_ogusa from typing import Union @@ -23,10 +24,11 @@ class TaxBrain: } def __init__(self, start_year: int, end_year: int = LAST_BUDGET_YEAR, - microdata: Union[str, dict] = None, use_cps: bool = False, + microdata: Union[str, pd.DataFrame] = None, + use_cps: bool = False, reform: Union[str, dict] = None, behavior: dict = None, - assump=None, base_policy: Union[str, dict] = None, - verbose=False): + assump=None, ogusa: bool = False, + base_policy: Union[str, dict] = None, verbose=False): """ Constructor for the TaxBrain class @@ -56,6 +58,9 @@ def __init__(self, start_year: int, end_year: int = LAST_BUDGET_YEAR, assump: str A string pointing to a JSON file containing user specified economic assumptions. + ogusa: bool + A boolean value to indicate whether or not the analysis should + be run with OG-USA base_policy: str or dict Individual income tax policy to use as the baseline for the analysis. This policy will be implemented in the base @@ -99,6 +104,7 @@ def __init__(self, start_year: int, end_year: int = LAST_BUDGET_YEAR, # Process user inputs early to throw any errors quickly self.params = self._process_user_mods(reform, assump) self.params["behavior"] = behavior + self.ogusa = ogusa if base_policy: base_policy = self._process_user_mods(base_policy, None) self.params["base_policy"] = base_policy["policy"] @@ -107,7 +113,8 @@ def __init__(self, start_year: int, end_year: int = LAST_BUDGET_YEAR, self.has_run = False - def run(self, varlist: list = DEFAULT_VARIABLES): + def run(self, varlist: list = DEFAULT_VARIABLES, client=None, + num_workers=1): """ Run the calculators. TaxBrain will determine whether to do a static or partial equilibrium run based on the user's inputs when initializing @@ -122,6 +129,18 @@ def run(self, varlist: list = DEFAULT_VARIABLES): ------- None """ + if self.ogusa: + if self.verbose: + print("Running OG-USA") + if self.use_cps: + data_source = "cps" + else: + data_source = "puf" + og_results = run_ogusa( + iit_reform=self.params["policy"], + data_source=data_source, start_year=self.start_year, + client=client, num_workers=num_workers) + self._apply_ogusa(og_results) base_calc, reform_calc = self._make_calculators() if not isinstance(varlist, list): msg = f"'varlist' is of type {type(varlist)}. Must be a list." @@ -450,3 +469,28 @@ def _make_calculators(self): # delete all unneeded variables del gd_base, gd_reform, records, gf_base, gf_reform, policy return base_calc, reform_calc + + def _apply_ogusa(self, og_results): + """ + Apply the results of the OG-USA run + Parameters + ---------- + og_results: Numpy array + percentage changes in macro variables used to update grow + factors + + Returns + ------- + None + """ + # changes in wage growth rates are at the 4th index + wage_change = og_results + gf = tc.GrowFactors() + grow_diff = {} + for i, yr in enumerate(range(self.start_year, self.end_year)): + cur_val = gf.factor_value("AWAGE", yr) + grow_diff[yr] = float(cur_val * (1 + wage_change[i])) + final_growdiffs = { + "AWAGE": grow_diff + } + self.params["growdiff_response"] = final_growdiffs diff --git a/taxbrain/typing.py b/taxbrain/tb_typing.py similarity index 100% rename from taxbrain/typing.py rename to taxbrain/tb_typing.py diff --git a/taxbrain/tbogusa.py b/taxbrain/tbogusa.py new file mode 100644 index 0000000..8622b35 --- /dev/null +++ b/taxbrain/tbogusa.py @@ -0,0 +1,95 @@ +import shutil +import os +from ogusa.execute import runner +from ogusa.utils import safe_read_pickle +from pathlib import Path + + +CUR_PATH = Path(__file__).resolve().parent +REFORM_DIR = Path(CUR_PATH, "ogusa_reform") +BASE_DIR = Path(CUR_PATH, "ogusa_baseline") + + +def run_ogusa(iit_base={}, iit_reform={}, og_spec_base={}, + og_spec_reform={}, data_source='cps', start_year=2021, + num_years=10, client=None, num_workers=1): + """ + Runs OG-USA model and returns percentage changes in macro variables + used as growth factors for microdata. + + Parameters + ---------- + iit_base: dict + baseline policy for Tax-Calculator + iit_reform: dict + reform policy for Tax-Calculator + og_spec_base: dict + OG-USA specifications for the baseline simulation + og_spec_reform: dict + OG-USA specifications for the reform simulation + data_source: str or Pandas DataFrame + path or DataFrame of microdata to be used by Tax-Calculator + start_year: int + year to start simulations in + num_years: int + number of years over which to return the results + client: Dask Client or None + Dask client to use + num_workers: int + number of workers for parallelization + + Returns + ------- + pct_w: Numpy array + percentage changes in wages, starting from start_year going to + start_year + num_years + """ + + ''' + ------------------------------------------------------------------------ + Run OG-USA baseline + ------------------------------------------------------------------------ + ''' + og_spec_base['start_year'] = start_year + og_spec_base['tax_func_type'] = 'GS' + og_spec_base['age_specific'] = False + kwargs = {'output_base': BASE_DIR, 'baseline_dir': BASE_DIR, + 'test': False, 'time_path': True, 'baseline': True, + 'og_spec': og_spec_base, 'guid': '', + 'iit_reform': iit_base, + 'run_micro': True, 'tax_func_path': None, + 'data': data_source, 'client': client, + 'num_workers': num_workers} + runner(**kwargs) + + ''' + ------------------------------------------------------------------------ + Run reform policy + ------------------------------------------------------------------------ + ''' + og_spec_reform['start_year'] = start_year + og_spec_reform['tax_func_type'] = 'GS' + og_spec_reform['age_specific'] = False + kwargs = {'output_base': REFORM_DIR, 'baseline_dir': BASE_DIR, + 'test': False, 'time_path': True, 'baseline': False, + 'og_spec': og_spec_reform, 'guid': '', + 'iit_reform': iit_reform, 'run_micro': False, + 'tax_func_path': None, 'data': data_source, + 'client': client, 'num_workers': num_workers} + runner(**kwargs) + + # return ans - the percentage changes in macro aggregates and prices + # due to policy changes from the baseline to the reform + base_tpi = safe_read_pickle( + os.path.join(BASE_DIR, 'TPI', 'TPI_vars.pkl')) + reform_tpi = safe_read_pickle( + os.path.join(REFORM_DIR, 'TPI', 'TPI_vars.pkl')) + + # compute pct change in wages over first num_years + pct_w = ((reform_tpi['w'] - base_tpi['w']) / base_tpi['w'])[:num_years] + + # remove newly created directories + shutil.rmtree(BASE_DIR) + shutil.rmtree(REFORM_DIR) + + return pct_w \ No newline at end of file diff --git a/taxbrain/tests/test_brain.py b/taxbrain/tests/test_brain.py index 92f19e5..c2b4185 100644 --- a/taxbrain/tests/test_brain.py +++ b/taxbrain/tests/test_brain.py @@ -2,9 +2,24 @@ import pytest import pandas as pd import numpy as np +from distributed import Client, LocalCluster +import multiprocessing from taxbrain import TaxBrain +NUM_WORKERS = min(multiprocessing.cpu_count(), 4) + + +@pytest.fixture(scope="module") +def dask_client(): + cluster = LocalCluster(n_workers=NUM_WORKERS, threads_per_worker=2) + client = Client(cluster) + yield client + # teardown + client.close() + cluster.close() + + def test_arg_validation(): with pytest.raises(ValueError): TaxBrain(2018, 2020) @@ -128,3 +143,14 @@ def test_user_input(reform_json_str, assump_json_str): TaxBrain(2018, 2020, use_cps=True, reform=True) with pytest.raises(TypeError): TaxBrain(2018, 2020, use_cps=True, assump=True) + + +@pytest.mark.local +def test_taxbrain_with_ogusa(dask_client): + base = {"II_em": {2019: 0}} + reform = {"II_em": {2025: 2000}} + + tb = TaxBrain(2018, 2019, use_cps=True, reform=reform, + base_policy=base, ogusa=True) + + tb.run(client=None, num_workers=1) \ No newline at end of file diff --git a/taxbrain/tests/test_cli.py b/taxbrain/tests/test_cli.py index 75b2e2b..84c0b4f 100644 --- a/taxbrain/tests/test_cli.py +++ b/taxbrain/tests/test_cli.py @@ -17,6 +17,10 @@ def test_cli(): baseline = None outdir = "" name = "test_cli" + ogusa = False + cli_core( + startyear, endyear, data, usecps, reform, behavior, assump, baseline, + outdir, name, ogusa make_report = False author = None cli_core( diff --git a/taxbrain/tests/test_tbogusa.py b/taxbrain/tests/test_tbogusa.py new file mode 100644 index 0000000..72ff002 --- /dev/null +++ b/taxbrain/tests/test_tbogusa.py @@ -0,0 +1,27 @@ +import pytest +import multiprocessing +import time +import taxbrain + +NUM_WORKERS = min(multiprocessing.cpu_count(), 7) + + +@pytest.mark.local +def test_run_ogusa(): + base = {"II_em": {2019: 0}} + reform = {"II_em": {2025: 2000}} + p = multiprocessing.Process( + target=taxbrain.tbogusa.run_ogusa, name="run_ogusa", + args=(base, reform, {}, + {}, 'cps', 2019, + 10, None, NUM_WORKERS)) + p.start() + time.sleep(300) + if p.is_alive(): + p.terminate() + p.join() + timetest = True + else: + print("run_ogusa did not run for minimum time") + timetest = False + print('timetest ==', timetest) diff --git a/taxbrain/utils.py b/taxbrain/utils.py index 79346e4..41769cc 100644 --- a/taxbrain/utils.py +++ b/taxbrain/utils.py @@ -10,7 +10,7 @@ from typing import Union, Tuple import taxcalc as tc -from .typing import ParamToolsAdjustment, TaxcalcReform, PlotColors +from taxbrain.tb_typing import TaxcalcReform, ParamToolsAdjustment, PlotColors def weighted_sum(df, var, wt="s006"): @@ -254,7 +254,8 @@ def update_policy( policy_obj.implement_reform(reform, **kwargs) -def is_paramtools_format(reform: Union[TaxcalcReform, ParamToolsAdjustment]): +def is_paramtools_format(reform: Union[TaxcalcReform, + ParamToolsAdjustment]): """ Check first item in reform to determine if it is using the ParamTools adjustment or the Tax-Calculator reform format.