-
-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix GDP elasticity logic to use lagged average MTR
- Loading branch information
1 parent
70a8ece
commit 8ee99a3
Showing
8 changed files
with
123 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,34 @@ | ||
from taxcalc import Policy, Records, Calculator, proportional_change_gdp | ||
""" | ||
Tests of proportional_change_in_gdp function. | ||
""" | ||
# CODING-STYLE CHECKS: | ||
# pep8 --ignore=E402 test_macro_elasticity.py | ||
# pylint --disable=locally-disabled test_macro_elasticity.py | ||
|
||
import pytest | ||
from taxcalc import (Policy, Records, # pylint: disable=import-error | ||
Calculator, proportional_change_in_gdp) | ||
|
||
def test_proportional_change_gdp(cps_subsample): | ||
|
||
def test_proportional_change_in_gdp(cps_subsample): | ||
""" | ||
Test correct and incorrect calls to proportional_change_in_gdp function. | ||
""" | ||
rec1 = Records.cps_constructor(data=cps_subsample) | ||
calc1 = Calculator(policy=Policy(), records=rec1) | ||
rec2 = Records.cps_constructor(data=cps_subsample) | ||
pol2 = Policy() | ||
reform = {2013: {'_II_em': [0.0]}} # reform increases taxes and MTRs | ||
reform = {2015: {'_II_em': [0.0]}} # reform increases taxes and MTRs | ||
pol2.implement_reform(reform) | ||
calc2 = Calculator(policy=pol2, records=rec2) | ||
gdp_diff = proportional_change_gdp(calc1, calc2, elasticity=0.36) | ||
assert gdp_diff < 0. # higher MTRs imply negative GDP effect | ||
assert calc1.current_year == 2014 # because using CPS data | ||
gdpc = proportional_change_in_gdp(2015, calc1, calc2, elasticity=0.36) | ||
assert gdpc == 0.0 # no effect in first year of reform | ||
calc1.increment_year() | ||
calc2.increment_year() | ||
assert calc1.current_year == 2015 | ||
gdpc = proportional_change_in_gdp(2016, calc1, calc2, elasticity=0.36) | ||
assert gdpc < 0.0 # higher average MTR implies reduction in GDP | ||
# don't increment year to 2016 | ||
with pytest.raises(ValueError): | ||
gdpc = proportional_change_in_gdp(2017, calc1, calc2, elasticity=0.36) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters