Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2027 Extrapolation #1624

Merged
merged 3 commits into from
Nov 5, 2017
Merged

Conversation

andersonfrailey
Copy link
Collaborator

This PR updates the weights, growth factors, and adjustment factors to extrapolate to 2027. We were originally going to wait to do this until we updated the PUF.csv file, but given the activity around tax reform and the unexpected road blocks to updating the PUF, a higher priority was placed on getting this out. There is no update to PUF.csv, just the associated weights and growth factors.

More details can be seen in TaxData PR #122. A note book with the changes can be seen here.

There is one issue I was having with the test suite. In test_policy.py, there is a function test_constant_inflation_rate_with_reform. The test compares implied inflation rates with those in policy.inflation_rates. It seems to me that the error has to do with how the round function works. Here is the assertion error message that comes up when running py.test:

E       assert 0.023099 == 0.0231
E        +  where 0.023099 = round((1.023099324734464 - 1.0), 6)
E        +  and   0.0231 = round(0.0231, 6)

I found that 0.0231 is the result of round(0.023099999999999999, 6). So the numbers are the same to the point where if both were rounded to 4 digits, this test would pass. I'd appreciate any insights into how to handle this.

cc. @MattHJensen @codykallen

@MattHJensen
Copy link
Contributor

I found that 0.0231 is the result of round(0.023099999999999999, 6). So the numbers are the same to the point where if both were rounded to 4 digits, this test would pass. I'd appreciate any insights into how to handle this.

What do you think about rounding to fewer decimals.

For example instead of

assert round(grate - 1.0, 6) == round(irate2019, 6)

use

assert round(grate - 1.0, 4) == round(irate2019, 4)

@andersonfrailey
Copy link
Collaborator Author

@MattHJensen said:

What do you think about rounding to fewer decimals.

For example instead of

assert round(grate - 1.0, 6) == round(irate2019, 6)

use

assert round(grate - 1.0, 4) == round(irate2019, 4)

This solution was my first thought as well. Don't know if there's a specific reason why it wouldn't be satisfactory, if not I can make the change to the test in this PR.

@MattHJensen
Copy link
Contributor

This solution was my first thought as well. Don't know if there's a specific reason why it wouldn't be satisfactory, if not I can make the change to the test in this PR.

I can't think of any problem.

@MattHJensen
Copy link
Contributor

@andersonfrailey, to what should we attribute the minor changes before 2027? Could you explain the intuition for why adding a year would change results in intervening years?

@codykallen
Copy link
Contributor

@MattHJensen asked

to what should we attribute the minor changes before 2027? Could you explain the intuition for why adding a year would change results in intervening years?

Shouldn't this be caused by switching to the June 2017 CBO forecasts instead of whatever forecasts we were using?

@andersonfrailey
Copy link
Collaborator Author

@codykallen is correct. The June 2017 CBO forecasts will be a different from those in the August 2016 report, which is what we are currently using. This will affect the calculated growth rates, targets used during the re-weighting process, and subsequently the final weights. All of these factors combined will result in slightly different calculations for all of the years.

@MattHJensen
Copy link
Contributor

@codykallen is correct. The June 2017 CBO forecasts will be a different from those in the August 2016 report, which is what we are currently using. This will affect the calculated growth rates, targets used during the re-weighting process, and subsequently the final weights. All of these factors combined will result in slightly different calculations for all of the years.

Thanks @codykallen and @andersonfrailey. This PR LGTM as soon as the test error is fixed.

@andersonfrailey
Copy link
Collaborator Author

@MattHJensen, latest commit should fix the test error.

@codecov-io
Copy link

codecov-io commented Nov 5, 2017

Codecov Report

Merging #1624 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #1624   +/-   ##
======================================
  Coverage     100%    100%           
======================================
  Files          37      37           
  Lines        2852    2852           
======================================
  Hits         2852    2852
Impacted Files Coverage Δ
taxcalc/growdiff.py 100% <100%> (ø) ⬆️
taxcalc/policy.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a3614a1...f5a0502. Read the comment docs.

@MattHJensen
Copy link
Contributor

Thanks @andersonfrailey! Merging.

@MattHJensen MattHJensen merged commit 1dc14cf into PSLmodels:master Nov 5, 2017
Copy link
Collaborator

@martinholmer martinholmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andersonfrailey
Why this change in test_tbi.py?

  •                      (2017, 10)])
    
  •                      (2018, 10)])
    

@martinholmer
Copy link
Collaborator

Never mind. Answered my own question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants