Skip to content

Commit

Permalink
Merge pull request #2127 from martinholmer/0-23-2
Browse files Browse the repository at this point in the history
Update documentation and RELEASES info for release 0.23.2
  • Loading branch information
martinholmer committed Nov 22, 2018
2 parents 9c49074 + e2467d1 commit fb733ab
Show file tree
Hide file tree
Showing 8 changed files with 146 additions and 24 deletions.
23 changes: 20 additions & 3 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,26 @@ Go [here](https://github.com/open-source-economics/Tax-Calculator/pulls?q=is%3Ap
for a complete commit history.


2018-11-22 Release 0.23.2
-------------------------
(last merged pull request is
[#2126](https://github.com/open-source-economics/Tax-Calculator/pull/2126))

**API Changes**
- None

**New Features**
- Refactor `create_diagnostic_table` utility function to work better when using the Behavioral-Repsonses `behresp` package
[[#2126](https://github.com/open-source-economics/Tax-Calculator/pull/2126)
by Martin Holmer responding to question from Ernie Tedeschi]

**Bug Fixes**
- None


_Earlier Releases:_


2018-11-20 Release 0.23.1
-------------------------
(last merged pull request is
Expand All @@ -27,9 +47,6 @@ for a complete commit history.
by Martin Holmer]


_Earlier Releases:_


2018-11-13 Release 0.23.0
-------------------------
(last merged pull request is
Expand Down
3 changes: 2 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ <h2 id="whatsnew">What's New</h2>
<p><a href="https://github.com/open-source-economics/Tax-Calculator/blob/master/RELEASES.md#2018-11-13-release-0230">Behavior class is going away soon</a>
and being replaced by the Behavioral-Responses <kbd>behresp</kbd> package,
the use of which is demonstrated in
<a href="https://open-source-economics.github.io/Tax-Calculator/cookbook.html">Cookbook</a> recipe 2</p>
<a href="https://open-source-economics.github.io/Tax-Calculator/cookbook.html">Cookbook</a>
recipe 2, which requires Tax-Calculator release 0.23.2 or higher</p>

<p><a href="https://github.com/open-source-economics/Tax-Calculator/blob/master/RELEASES.md#2018-10-24-release-0220">Automatic scaling of table results</a>
(so that Python scripts, and Cookbook recipes, do not need to change
Expand Down
3 changes: 2 additions & 1 deletion docs/index.htmx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ previously visited pages.</i></p>
<p><a href="https://github.com/open-source-economics/Tax-Calculator/blob/master/RELEASES.md#2018-11-13-release-0230">Behavior class is going away soon</a>
and being replaced by the Behavioral-Responses <kbd>behresp</kbd> package,
the use of which is demonstrated in
<a href="https://open-source-economics.github.io/Tax-Calculator/cookbook.html">Cookbook</a> recipe 2</p>
<a href="https://open-source-economics.github.io/Tax-Calculator/cookbook.html">Cookbook</a>
recipe 2, which requires Tax-Calculator release 0.23.2 or higher</p>

<p><a href="https://github.com/open-source-economics/Tax-Calculator/blob/master/RELEASES.md#2018-10-24-release-0220">Automatic scaling of table results</a>
(so that Python scripts, and Cookbook recipes, do not need to change
Expand Down
6 changes: 3 additions & 3 deletions docs/recipe00.graph.html

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions docs/recipe00.res.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
Tax before Credits ($b) 1576.084
Refundable Credits ($b) 78.598
Nonrefundable Credits ($b) 93.685
Reform Surtaxes ($b) 0.000
Other Taxes ($b) 9.627
Ind Income Tax ($b) 1413.428
Payroll Taxes ($b) 1316.606
Expand All @@ -103,7 +102,6 @@
Tax before Credits ($b) 1570.973
Refundable Credits ($b) 81.346
Nonrefundable Credits ($b) 88.471
Reform Surtaxes ($b) 0.000
Other Taxes ($b) 9.627
Ind Income Tax ($b) 1410.783
Payroll Taxes ($b) 1316.606
Expand Down
55 changes: 45 additions & 10 deletions docs/recipe02.py.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,63 @@

# specify Calculator object for static analysis of reform policy
pol.implement_reform(params['policy'])
calc2sa = Calculator(policy=pol, records=recs)
calc2 = Calculator(policy=pol, records=recs)

# calculate reform income tax liabilities for cyr under static assumptions
calc2sa.advance_to_year(cyr)
calc2sa.calc_all()
itax_rev2sa = calc2sa.weighted_total('iitax')
calc2.advance_to_year(cyr)
calc2.calc_all()
itax_rev2sa = calc2.weighted_total('iitax')

# specify behavioral-response assumptions
behresp_json = '{"BE_sub": {"2018": 0.25}}'
behresp_dict = Calculator.read_json_assumptions(behresp_json)

# specify Calculator object for analysis of reform with behavioral response
calc2br = Calculator(policy=pol, records=recs)
calc2br.advance_to_year(cyr)
_, df2br = behresp.response(calc1, calc2br, behresp_dict)
calc2 = Calculator(policy=pol, records=recs)
calc2.advance_to_year(cyr)
_, df2br = behresp.response(calc1, calc2, behresp_dict)

# calculate reform income tax liabilities for cyr with behavioral response
itax_rev2br = (df2br['iitax'] * df2br['s006']).sum()

# print total income tax revenue estimates for cyr
# (estimates in billons of dollars rounded to nearest hundredth of a billion)
print('{}_CURRENT_LAW_P__itax_rev($B)= {:.2f}'.format(cyr, itax_rev1 * 1e-9))
print('{}_REFORM_STATIC__itax_rev($B)= {:.2f}'.format(cyr, itax_rev2sa * 1e-9))
print('{}_REFORM_DYNAMIC_itax_rev($B)= {:.2f}'.format(cyr, itax_rev2br * 1e-9))
print('{}_CURRENT_LAW_P__itax_rev($B)= {:.3f}'.format(cyr, itax_rev1 * 1e-9))
print('{}_REFORM_STATIC__itax_rev($B)= {:.3f}'.format(cyr, itax_rev2sa * 1e-9))
print('{}_REFORM_DYNAMIC_itax_rev($B)= {:.3f}'.format(cyr, itax_rev2br * 1e-9))

# create multi-year diagnostic tables for
# (1) baseline,
# (2) reform excluding behavioral responses, and
# (3) reform including behavioral responses
num_years = 3 # number of diagnostic table years beginning with cyr
dvar_list1 = list()
year_list1 = list()
dvar_list2 = list()
year_list2 = list()
dvar_list3 = list()
year_list3 = list()
for year in range(cyr, cyr + num_years):
calc1.advance_to_year(year)
calc2.advance_to_year(year)
# exclude reform's behavioral responses by passing empty dictionary
df1, df2sa = behresp.response(calc1, calc2, dict())
dvar_list1.append(df1)
year_list1.append(year)
dvar_list2.append(df2sa)
year_list2.append(year)
# include reform's behavioral responses by passing meaningful dictionary
_, df2br = behresp.response(calc1, calc2, behresp_dict)
dvar_list3.append(df2br)
year_list3.append(year)
dtable1 = create_diagnostic_table(dvar_list1, year_list1)
dtable2 = create_diagnostic_table(dvar_list2, year_list2)
dtable3 = create_diagnostic_table(dvar_list3, year_list3)
print()
print('DIAGNOSTIC TABLE FOR BASELINE')
print(dtable1)
print('DIAGNOSTIC TABLE FOR REFORM EXCLUDING BEHAVIORAL RESPONSES')
print(dtable2)
print('DIAGNOSTIC TABLE FOR REFORM INCLUDING BEHAVIORAL RESPONSES')
print(dtable3)
</pre>
76 changes: 73 additions & 3 deletions docs/recipe02.res.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,77 @@
Your data include the following unused variables that will be ignored:
filer
Tax-Calculator startup automatically extrapolated your data to 2014.
2020_CURRENT_LAW_P__itax_rev($B)= 1413.43
2020_REFORM_STATIC__itax_rev($B)= 1410.78
2020_REFORM_DYNAMIC_itax_rev($B)= 1400.52
2020_CURRENT_LAW_P__itax_rev($B)= 1413.428
2020_REFORM_STATIC__itax_rev($B)= 1410.783
2020_REFORM_DYNAMIC_itax_rev($B)= 1400.520

DIAGNOSTIC TABLE FOR BASELINE
2020 2021 2022
Returns (#m) 167.510 169.750 171.930
AGI ($b) 11946.468 12455.585 12995.947
Itemizers (#m) 31.030 32.320 33.530
Itemized Deduction ($b) 872.795 932.349 993.361
Standard Deduction Filers (#m) 136.480 137.430 138.400
Standard Deduction ($b) 2438.381 2506.054 2577.176
Personal Exemption ($b) 0.000 0.000 0.000
Taxable Income ($b) 9126.239 9530.399 9961.776
Regular Tax ($b) 1574.257 1653.576 1737.312
AMT Income ($b) 11332.086 11798.728 12295.435
AMT Liability ($b) 1.827 1.886 1.957
AMT Filers (#m) 0.420 0.420 0.420
Tax before Credits ($b) 1576.084 1655.462 1739.269
Refundable Credits ($b) 78.598 79.303 80.627
Nonrefundable Credits ($b) 93.685 94.880 96.109
Other Taxes ($b) 9.627 10.228 10.827
Ind Income Tax ($b) 1413.428 1491.508 1573.359
Payroll Taxes ($b) 1316.606 1365.571 1418.759
Combined Liability ($b) 2730.034 2857.079 2992.118
With Income Tax <= 0 (#m) 60.370 60.990 61.600
With Combined Tax <= 0 (#m) 39.230 39.940 40.690
DIAGNOSTIC TABLE FOR REFORM EXCLUDING BEHAVIORAL RESPONSES
2020 2021 2022
Returns (#m) 167.510 169.750 171.930
AGI ($b) 11946.468 12455.585 12995.947
Itemizers (#m) 30.950 32.240 33.440
Itemized Deduction ($b) 870.479 929.591 990.516
Standard Deduction Filers (#m) 136.560 137.510 138.490
Standard Deduction ($b) 2439.801 2507.597 2578.807
Personal Exemption ($b) 327.446 338.037 349.054
Taxable Income ($b) 8879.741 9276.106 9699.277
Regular Tax ($b) 1569.188 1650.129 1735.328
AMT Income ($b) 11334.037 11801.077 12297.846
AMT Liability ($b) 1.785 1.840 1.905
AMT Filers (#m) 0.420 0.430 0.430
Tax before Credits ($b) 1570.973 1651.969 1737.233
Refundable Credits ($b) 81.346 82.099 83.708
Nonrefundable Credits ($b) 88.471 89.606 90.782
Other Taxes ($b) 9.627 10.228 10.827
Ind Income Tax ($b) 1410.783 1490.492 1573.570
Payroll Taxes ($b) 1316.606 1365.571 1418.759
Combined Liability ($b) 2727.388 2856.063 2992.330
With Income Tax <= 0 (#m) 62.570 63.260 63.830
With Combined Tax <= 0 (#m) 39.560 40.290 41.120
DIAGNOSTIC TABLE FOR REFORM INCLUDING BEHAVIORAL RESPONSES
2020 2021 2022
Returns (#m) 167.510 169.750 171.930
AGI ($b) 11923.979 12431.231 12969.403
Itemizers (#m) 30.920 32.210 33.400
Itemized Deduction ($b) 869.139 928.236 988.950
Standard Deduction Filers (#m) 136.590 137.540 138.530
Standard Deduction ($b) 2440.435 2508.187 2579.569
Personal Exemption ($b) 327.575 338.174 349.207
Taxable Income ($b) 8857.672 9252.228 9673.232
Regular Tax ($b) 1559.072 1639.261 1723.626
AMT Income ($b) 11312.613 11777.834 12272.592
AMT Liability ($b) 1.819 1.875 1.939
AMT Filers (#m) 0.430 0.440 0.440
Tax before Credits ($b) 1560.891 1641.136 1725.565
Refundable Credits ($b) 81.060 81.806 83.441
Nonrefundable Credits ($b) 88.722 89.870 91.037
Other Taxes ($b) 9.412 9.996 10.578
Ind Income Tax ($b) 1400.520 1479.456 1561.665
Payroll Taxes ($b) 1316.263 1365.168 1418.274
Combined Liability ($b) 2716.783 2844.624 2979.939
With Income Tax <= 0 (#m) 62.420 63.080 63.660
With Combined Tax <= 0 (#m) 39.450 40.160 41.000
</pre>
2 changes: 1 addition & 1 deletion read-the-docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
# |version| and |release|, also used in various other places throughout the
# built documents.
#
version = '0.23.1'
version = '0.23.2'
release = version

# The language for content autogenerated by Sphinx. Refer to documentation
Expand Down

0 comments on commit fb733ab

Please sign in to comment.