Skip to content

Commit

Permalink
Merge pull request #1998 from martinholmer/growmod0
Browse files Browse the repository at this point in the history
Add empty shell of a GrowModel class
  • Loading branch information
martinholmer authored May 18, 2018
2 parents 936ddaf + 8600a9a commit 7088300
Show file tree
Hide file tree
Showing 25 changed files with 1,309 additions and 860 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include taxcalc/puf_weights.csv.gz
include taxcalc/puf_ratios.csv
include taxcalc/current_law_policy.json
include taxcalc/behavior.json
include taxcalc/growth.json
include taxcalc/growmodel.json
include taxcalc/consumption.json
include taxcalc/records_variables.json
include taxcalc/cps.csv.gz
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,7 @@ <h3 id="params-consump">Consumption Parameters</h3>

<h3 id="params-behavior">Behavior Parameters</h3>

<p><b>Behavior &mdash; Taxable Income</b><br><i>tc Name:</i> _BE_sub<br><i>TB Name:</i> Substitution elasticity of taxable income<br><i>Description:</i> Defined as proportional change in taxable income divided by proportional change in marginal net-of-tax rate (1-MTR) on taxpayer earnings caused by the reform. Must be zero or positive.<br><i>Default Value:</i><br>2013: 0.0</p><p><b>Behavior &mdash; Taxable Income</b><br><i>tc Name:</i> _BE_inc<br><i>TB Name:</i> Income elasticity of taxable income<br><i>Description:</i> Defined as dollar change in taxable income divided by dollar change in after-tax income caused by the reform. Must be zero or negative.<br><i>Default Value:</i><br>2013: 0.0</p><p><b>Behavior &mdash; Taxable Income</b><br><i>tc Name:</i> _BE_subinc_wrt_earnings<br><i>TB Name:</i> Income and substitution elasticities apply to earnings<br><i>Description:</i> False implies elasticities apply to taxable income; true implies they are both computed as proportional changes and applied to taxpayer earnings only. Note: must be false if both _BE_sub and _BE_inc are zero.<br><i>Default Value:</i><br>2013: False</p><p><b>Behavior &mdash; Capital Gains</b><br><i>tc Name:</i> _BE_cg<br><i>TB Name:</i> Semi-elasticity of long-term capital gains<br><i>Description:</i> Defined as change in logarithm of long-term capital gains divided by change in marginal tax rate (MTR) on long-term capital gains caused by the reform. Must be zero or negative. Read Behavior.response documentation for discussion of appropriate values.<br><i>Default Value:</i><br>2013: 0.0</p><p><b>Response Parameter &mdash; Behavior</b><br><i>tc Name:</i> _BE_charity<br><i>Long Name:</i> Elasticity of charitable contributions<br><i>Description:</i> Defined as proportional change in cash and non-cash charitable contributions divided by proportional change in the after-tax price of charitable contributions caused by the reform. Must be zero or negative.<br><i>Default Value:</i><br>&nbsp;&nbsp; for: [AGI < 50k, 50k <= AGI < 100k, 100k <= AGI]<br>2013: [0.0, 0.0, 0.0]</p>
<p><b>Behavior &mdash; Taxable Income</b><br><i>tc Name:</i> _BE_sub<br><i>TB Name:</i> Substitution elasticity of taxable income<br><i>Description:</i> Defined as proportional change in taxable income divided by proportional change in marginal net-of-tax rate (1-MTR) on taxpayer earnings caused by the reform. Must be zero or positive.<br><i>Default Value:</i><br>2013: 0.0</p><p><b>Behavior &mdash; Taxable Income</b><br><i>tc Name:</i> _BE_inc<br><i>TB Name:</i> Income elasticity of taxable income<br><i>Description:</i> Defined as dollar change in taxable income divided by dollar change in after-tax income caused by the reform. Must be zero or negative.<br><i>Default Value:</i><br>2013: 0.0</p><p><b>Behavior &mdash; Capital Gains</b><br><i>tc Name:</i> _BE_cg<br><i>TB Name:</i> Semi-elasticity of long-term capital gains<br><i>Description:</i> Defined as change in logarithm of long-term capital gains divided by change in marginal tax rate (MTR) on long-term capital gains caused by the reform. Must be zero or negative. Read Behavior.response documentation for discussion of appropriate values.<br><i>Default Value:</i><br>2013: 0.0</p>

<p><a href="#params">Back to Section Contents</a></p>

Expand Down
67 changes: 34 additions & 33 deletions docs/index.htmx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ via the command line</p>
<p><a href="#pol">Policy Parameters</a> that specify tax reforms</p>
<p><a href="#input">Input Variables</a> that specify tax filing units</p>
<p><a href="#output">Output Variables</a> that describe tax results</p>
<p><a href="#params">Response Parameters</a> that specify reform responses</p>
<p><a href="#params">Assumption Parameters</a> that specify economic
assumptions</p>


<h2 id="gui">TaxBrain GUI</h2>
Expand Down Expand Up @@ -197,8 +198,8 @@ relationship between tax policy and the macro economy to predict the
effect of tax reforms on economic growth.</i></p>

Clicking on one of these choices will allow you to specify some
addition economic response parameters and initiate the dynamic
analysis using your response parameter assumptions.
additional economic assumption parameters and initiate the dynamic
analysis using your economic assumptions.

<p><a href="#gui">Back to Section Contents</a>&nbsp;&nbsp;
<a href="#doc">Back to Document Contents</a></p>
Expand Down Expand Up @@ -334,26 +335,26 @@ part.</p>

<h3 id="cli-spec-assump">Specify Analysis Assumptions</h3>

<p>This part explains how to specify response assumption files used in
<p>This part explains how to specify economic assumption files used in
non-static tax analysis. If you want to start out doing static
analysis, you can skip this part now and come back to read it whenever
you want to go beyond static analysis.
The <a href="#cli-spec-funits">next part</a> of this section discusses
filing-unit input files.</p>

<p>The details of economic response assumptions are contained in a
<p>The details of economic assumptions are contained in a
text file that you write with a text editor. The assumptions are
expressed by specifying which response parameters are changed from
expressed by specifying which parameters are changed from
their default values, all of which are zero. The timing and magnitude of
these response parameter changes are written in JSON, a simple and
these parameter changes are written in JSON, a simple and
widely-used data-specification language.</p>

<p>For examples of response assumption files and the general rules for
<p>For examples of economic assumption files and the general rules for
writing JSON assumption files, go
to <a href="https://github.com/open-source-economics/Tax-Calculator/blob/master/taxcalc/responses/ASSUMPTIONS.md">this
to <a href="https://github.com/open-source-economics/Tax-Calculator/blob/master/taxcalc/assumptions/ASSUMPTIONS.md">this
page</a>.</p>

<p>If you want to upload policy reform and response assumption files
<p>If you want to upload policy reform and economic assumption files
to TaxBrain, you can go directly to this
section's <a href="#cli-taxbrain-upload">last part</a>, which
discusses uploading files to TaxBrain. If you want to analyze your
Expand Down Expand Up @@ -407,7 +408,7 @@ analyzing reforms that change the tax treatment of high-income filers.</p>

<p><b>Third</b>, when you want to estimate how your reform affects
total tax liabilities and/or the distribution of tax liabilities, you
can always upload your policy reform and response assumption files
can always upload your policy reform and economic assumption files
to TaxBrain. Combining this option with the first option provides a
complete tax analysis capability.
The <a href="#cli-taxbrain-upload">last part</a> of this section
Expand Down Expand Up @@ -490,7 +491,7 @@ using its own set of three age-count input variables.
one or more filing units. A baseline file is optional; no baseline
file implies the policy baseline is current-law policy. A policy
reform file is optional; no reform file implies no reform (that is,
you want to analyze current-law policy). A response assumption file
you want to analyze current-law policy). An economic assumption file
is also optional; no assumption file implies you want to conduct
static analysis. The output files written by tc are built-up from
the name of the input file, baseline file, reform file, and
Expand All @@ -516,7 +517,7 @@ projected to 2020. The name of the CSV-formatted output file is
<kbd>test-20-#-#-#.csv</kbd>. The first <kbd>#</kbd> symbol indicates
we did not specify a baseline file and the second <kbd>#</kbd> symbol
indicates we did not specify a policy reform file and the
third <kbd>#</kbd> symbol indicates we did not specify a response
third <kbd>#</kbd> symbol indicates we did not specify an economic
assumption file.
The variables included in the minimal output file include:
<kbd>RECID</kbd> (of filing unit in the input file),
Expand Down Expand Up @@ -640,7 +641,7 @@ The above command generates an output file named

<p>Example (6) produces 2021 output for the filing units in the
<kbd>test.csv</kbd> file using the policy reform specified in
the <kbd>ref3.json</kbd> file and the response assumptions
the <kbd>ref3.json</kbd> file and the economic assumptions
specified in the <kbd>res1.json</kbd> file. The output results
produced by this non-static analysis are written to the
<kbd>test-21-#-ref3-res1.csv</kbd> file.</p>
Expand Down Expand Up @@ -947,7 +948,7 @@ available in your SQLite tabulation session.</p>

<h3 id="cli-taxbrain-upload">Upload Files to TaxBrain</h3>

<p>Any policy reform or response assumption files you can use with tc
<p>Any policy reform or economic assumption files you can use with tc
can be uploaded to trigger a TaxBrain run. As mentioned above the
main advantages of doing this is getting access to the proprietary
<kbd>puf.csv</kbd> input file, getting fast execution of both reform
Expand Down Expand Up @@ -1201,7 +1202,7 @@ output variables that Tax-Calculator is programmed to calculate.</p>
<a href="#doc">Back to Document Contents</a></p>


<h2 id="params">Response Parameters</h2>
<h2 id="params">Assumption Parameters</h2>

<p>This section contains documentation of several sets of parameters
that characterize responses to a tax reform. Consumption
Expand All @@ -1212,31 +1213,26 @@ tax reform in a partial-equilibrium setting. Growdiff parameters are
used to specify baseline differences and/or reform responses in the
annual rate of growth in economic variables.</p>

<p>All the response parameters can be used by the tc CLI, but only
<p>All the assumption parameters can be used by the tc CLI, but only
those with a <i>TB Name</i> appear in the TaxBrain GUI. All these
dynamic response parameters control advanced features of
Tax-Calculator, so understanding the
assumption parameters control advanced features of Tax-Calculator, so
understanding the
<a href="https://github.com/open-source-economics/Tax-Calculator/tree/master/taxcalc">source
code</a> that uses them is essential. Default response parameter values are
zero and are projected into the future at that value, which implies no
response to the reform. Using the default no-reform-response
assumption for all the response parameters generates a static analysis
of the tax reform. The benefit value consumption parameters have a
default value of one, which implies the consumption value of the
in-kind benefits is equal to the government cost of providing the
benefits.</p>

<p>Note that some of the response parameters are incompatible with
each other, and therefore, cannot be used together. The behavior
parameters can not have non-zero values with specifying non-zero
growdiff response parameters.</p>

code</a> that uses them is essential. Default values of most
assumption parameters are zero and are projected into the future at
that value, which implies no response to the reform. Using the
default no-reform-response assumption for all the response parameters
generates a static analysis of the tax reform. The benefit value
consumption parameters have a default value of one, which implies the
consumption value of the in-kind benefits is equal to the government
cost of providing the benefits.</p>

<h3>Section Contents</h3>

<p><a href="#params-consump">Consumption Parameters</a></p>
<p><a href="#params-behavior">Behavior Parameters</a></p>
<p><a href="#params-growdiff">Growdiff Parameters</a></p>
<p><a href="#params-growmodel">Growmodel Parameters</a></p>


<h3 id="params-consump">Consumption Parameters</h3>
Expand All @@ -1257,6 +1253,11 @@ growdiff response parameters.</p>

<!-- growdiff@parameters -->


<h3 id="params-growdiff">Growmodel Parameters</h3>

<!-- growmodel@parameters -->

<p><a href="#params">Back to Section Contents</a>&nbsp;&nbsp;
<a href="#doc">Back to Document Contents</a></p>

Expand Down
18 changes: 10 additions & 8 deletions docs/make_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
CONSUMPTION_PATH = os.path.join(TAXCALC_PATH, 'consumption.json')
BEHAVIOR_PATH = os.path.join(TAXCALC_PATH, 'behavior.json')
GROWDIFF_PATH = os.path.join(TAXCALC_PATH, 'growdiff.json')
GROWMODEL_PATH = os.path.join(TAXCALC_PATH, 'growmodel.json')
OUTPUT_PATH = os.path.join(CURDIR_PATH, OUTPUT_FILENAME)


Expand All @@ -49,9 +50,10 @@ def main():
text = policy_params(POLICY_PATH, text)
text = io_variables('read', IOVARS_PATH, text)
text = io_variables('calc', IOVARS_PATH, text)
text = response_params('consumption', CONSUMPTION_PATH, text)
text = response_params('behavior', BEHAVIOR_PATH, text)
text = response_params('growdiff', GROWDIFF_PATH, text)
text = assumption_params('consumption', CONSUMPTION_PATH, text)
text = assumption_params('behavior', BEHAVIOR_PATH, text)
text = assumption_params('growdiff', GROWDIFF_PATH, text)
text = assumption_params('growmodel', GROWMODEL_PATH, text)

# write text variable to OUTPUT file
with open(OUTPUT_PATH, 'w') as ofile:
Expand Down Expand Up @@ -222,7 +224,7 @@ def io_variables(iotype, path, text):
return text


def response_param_text(pname, ptype, param):
def assumption_param_text(pname, ptype, param):
"""
Extract info from param for pname of ptype and return as HTML string.
"""
Expand All @@ -231,7 +233,7 @@ def response_param_text(pname, ptype, param):
if len(sec1) > 0:
txt = '<p><b>{} &mdash; {}</b>'.format(sec1, param['section_2'])
else:
txt = '<p><b>{} &mdash; {}</b>'.format('Response Parameter',
txt = '<p><b>{} &mdash; {}</b>'.format('Assumption Parameter',
ptype.capitalize())
txt += '<br><i>tc Name:</i> {}'.format(pname)
if len(sec1) > 0:
Expand All @@ -251,9 +253,9 @@ def response_param_text(pname, ptype, param):
return txt


def response_params(ptype, path, text):
def assumption_params(ptype, path, text):
"""
Read response parameters of ptype from path, integrate them into text,
Read assumption parameters of ptype from path, integrate them into text,
and return the integrated text.
"""
with open(path) as pfile:
Expand All @@ -263,7 +265,7 @@ def response_params(ptype, path, text):
ptext = ''
for pname in params:
param = params[pname]
ptext += response_param_text(pname, ptype, param)
ptext += assumption_param_text(pname, ptype, param)
# integrate parameter text into text
old = '<!-- {}@parameters -->'.format(ptype)
text = text.replace(old, ptext)
Expand Down
1 change: 1 addition & 0 deletions taxcalc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from taxcalc.filings import *
from taxcalc.growfactors import *
from taxcalc.growdiff import *
from taxcalc.growmodel import *
from taxcalc.records import *
from taxcalc.simpletaxio import *
from taxcalc.taxcalcio import *
Expand Down
18 changes: 18 additions & 0 deletions taxcalc/assumptions/ASSUMPTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,24 @@ Any key can have an empty value like the growdiff_baseline key above.
Empty values mean that the default assumption parameter values are
used.

Including just these four key:value pairs in the assumption file indicates
that the GrowModel is inactive. To activate the GrowModel, simply add a
fifth key:value pair like this when you want to use the default parameter
values of the GrowModel:
```
,
"growmodel": {
}
```
or add fifth key:value pair like this when you want to customize the
GrowModel parameter values:
```
,
"growmodel": {
<parameter_name>: {<calyear>: <parameter-value>}
}
```

The rules about structuring a non-empty value for a top-level key are
the same as for policy reform files, which are described
[here](../reforms/REFORMS.md). The assumption parameter names
Expand Down
3 changes: 3 additions & 0 deletions taxcalc/assumptions/economic_assumptions_template.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,8 @@
"_ATXPY": {"2017": [0.0]},
"_AUCOMP": {"2017": [0.0]},
"_AWAGE": {"2017": [0.0]}
},
"growmodel": {
"_active": {"2017": [false]}
}
}
Loading

0 comments on commit 7088300

Please sign in to comment.