{"action":"created","issue":{"url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/issues/368","labels_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/issues/368/labels{/name}","comments_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/issues/368/comments","events_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/issues/368/events","html_url":"https://github.com/OpenSourcePolicyCenter/Tax-Calculator/pull/368","id":108981827,"number":368,"title":"[WIP]Adjust economic growth rates","user":{"login":"Amy-Xu","id":10549597,"avatar_url":"https://avatars.githubusercontent.com/u/10549597?v=3","gravatar_id":"","url":"https://api.github.com/users/Amy-Xu","html_url":"https://github.com/Amy-Xu","followers_url":"https://api.github.com/users/Amy-Xu/followers","following_url":"https://api.github.com/users/Amy-Xu/following{/other_user}","gists_url":"https://api.github.com/users/Amy-Xu/gists{/gist_id}","starred_url":"https://api.github.com/users/Amy-Xu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Amy-Xu/subscriptions","organizations_url":"https://api.github.com/users/Amy-Xu/orgs","repos_url":"https://api.github.com/users/Amy-Xu/repos","events_url":"https://api.github.com/users/Amy-Xu/events{/privacy}","received_events_url":"https://api.github.com/users/Amy-Xu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-09-29T23:40:50Z","updated_at":"2015-10-07T18:20:31Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/pulls/368","html_url":"https://github.com/OpenSourcePolicyCenter/Tax-Calculator/pull/368","diff_url":"https://github.com/OpenSourcePolicyCenter/Tax-Calculator/pull/368.diff","patch_url":"https://github.com/OpenSourcePolicyCenter/Tax-Calculator/pull/368.patch"},"body":"This PR added functionality for the type of sensitivity analysis to:\r\n- increase/decrease economic growth by an X percentage \r\n- to set it to at a certain target rate. \r\n\r\nTwo functions in records.py are relevant.\r\n\r\n`factor_adjustment(percentage, year)` will take the user-specified percentage adjustment for one year and apply this adjustment to all dollar amount factors. For example, if users set this percentage at 0.01, then it means the initial annual growth rate of 0.03 will be increased to 0.03 * (1 + 0.01) = 0.0303. \r\n\r\n`factor_target(target, year)` will take the target, divide it by the GDP growth rate of that year, and get a general target ratio. Then apply this ratio to all other factors. For example, if our user expects GDP grows at 4% a year, and current rate is 2%. Then the ratio would be 4% over 2% which is 2, so all other rates would be doubled for this particular year. This ratio varies by year as current GDP growth rates are different. @feenberg @MattHJensen Do you think this is a reasonable way of implementation?\r\n\r\nCurrently the functions are getting all these adjustment parameters from params.json. I'm aware that @martinholmer is actually refactoring the Record class. So I will definitely rewrite this section after Martin finishes his part. Tests are also postponed due to the same reason.\r\n\r\n@PeterDSteinberg (Hi I'm Amy:)))) Matt told me you are working on the webapp side of our project. So I guess it might be helpful to take a glance at this PR. This is how I implement the idea. Ultimately we want users to be able to input adjustment and targets from webapp. Please let me know if you have any suggestions to make the connection to the front end easier.\r\n\r\nFinally, I ran a few experiments and here are the results. \r\n\r\nBaseline:\r\n<img width=\"844\" alt=\"baseline\" src=\"https://cloud.githubusercontent.com/assets/10549597/10180979/a5884a36-66e0-11e5-9aa9-2ad48f8e43e4.png\">\r\n\r\n**All experiments are starting from 2016.**\r\nIncrease growth by 1%:\r\n<img width=\"842\" alt=\"0 01\" src=\"https://cloud.githubusercontent.com/assets/10549597/10180986/afac1bd2-66e0-11e5-9519-15473c94a833.png\">\r\n\r\nDecrease growth by 1%:\r\n<img width=\"842\" alt=\"-0 01\" src=\"https://cloud.githubusercontent.com/assets/10549597/10180990/b8b26cea-66e0-11e5-8ab0-3fc0357dd392.png\">\r\n\r\nWhat if the economic growth is 4%?\r\n<img width=\"843\" alt=\"0 04\" src=\"https://cloud.githubusercontent.com/assets/10549597/10181007/c8c20456-66e0-11e5-8f5a-d606fe84d603.png\">\r\n\r\nHow about 6%? (I was very entertained by this idea, just as the proposal of building a wall. But then, suddenly realized this actually brought our projection way closer to CBO's baseline...........)\r\n<img width=\"843\" alt=\"0 06\" src=\"https://cloud.githubusercontent.com/assets/10549597/10181026/0fe134ce-66e1-11e5-83fb-aa2fa24f2a52.png\">\r\n\r\nWelcome comments/suggestions from everyone!"},"comment":{"url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/issues/comments/146283814","html_url":"https://github.com/OpenSourcePolicyCenter/Tax-Calculator/pull/368#issuecomment-146283814","issue_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/issues/368","id":146283814,"user":{"login":"MattHJensen","id":8301092,"avatar_url":"https://avatars.githubusercontent.com/u/8301092?v=3","gravatar_id":"","url":"https://api.github.com/users/MattHJensen","html_url":"https://github.com/MattHJensen","followers_url":"https://api.github.com/users/MattHJensen/followers","following_url":"https://api.github.com/users/MattHJensen/following{/other_user}","gists_url":"https://api.github.com/users/MattHJensen/gists{/gist_id}","starred_url":"https://api.github.com/users/MattHJensen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MattHJensen/subscriptions","organizations_url":"https://api.github.com/users/MattHJensen/orgs","repos_url":"https://api.github.com/users/MattHJensen/repos","events_url":"https://api.github.com/users/MattHJensen/events{/privacy}","received_events_url":"https://api.github.com/users/MattHJensen/received_events","type":"User","site_admin":false},"created_at":"2015-10-07T18:20:31Z","updated_at":"2015-10-07T18:20:31Z","body":"@PeterDSteinberg could you take a look at this PR to see if there is anything besides #371-related issues that you think will need to be taken care of for it to play nicely with the webapp? In particular I am concerned about the fact that we are calling `factor_adjustment()` and `factor_target()` during increment year. My understanding is that our parallelization strategy has us incrementing years *before* we get any user input from TaxBrain, but we need to get params for factor_adjustment() and factor_target() from the user. \r\n\r\nI think with some algebra this could be implemented in such a way that `factor_adustment()` and `factor_target()` are called *after* increment year, rather then during, but @PeterDSteinberg, it would be nice to have your verification that this reworking is necessary. "}}