ospc-org / ospc.org

Source code for PolicyBrain, ospc.org, and related assets.
MIT License
24 stars 32 forks source link

OG-USA: Add check box for open economy #481

Open jdebacker opened 7 years ago

jdebacker commented 7 years ago

We should add a check box/radio button to toggle between the closed economy version of OG-USA (the default) and the open economy version.

Shall we also let the user input the exogenous interest rate?

cc @rickecon @salimfurth

salimfurth commented 7 years ago

Sounds good. We might need to put limits on the world interest rate so that it solves.

jdebacker commented 7 years ago

@salimfurth Good point. We might do some testing to see this range. Does 1%-10% seem ok?

salimfurth commented 7 years ago

Yeah, that's plenty wide enough. I haven't stress-tested - I imagine some extreme values in that range will give negative G or other nonsense results even if they solve.

PeterDSteinberg commented 7 years ago

@jdebacker I'm a bit unclear on the econ terms used here - is open economy version currently part of the webapp-public (i.e. is webapp-public hardcoded to closed economy version now) or does open vs closed refer to the Partial Equilibrium vs Macro Elasticities choice? I don't have a clear picture of where the checkbox and exogenous interest rate UI inputs need to go.

jdebacker commented 7 years ago

@PeterDSteinberg let me see if I can clarify. OG-USA now (since PR #249), allows one to consider two versions of the overlapping generations model. One is where the economy is assumed to be "closed" - so that there is not trade or financial interactions with outside countries. And the other is where the economy is assumed to be "open", so goods or capital and flow into the U.S. economy we are modeling.

We want to make it an option for the user to switch between these on Tax Brain. Currently, one can do this in the source code by changing the keyword argument 'small_open':False that is passed to ogusa.execute.runner()

rickecon commented 7 years ago

@PeterDSteinberg . As @jdebacker mentioned in the previous comment, the small open economy option in OG-USA is a boolean ('small_open': True or 'small_open': False) that can be passed into the ogusa.scripts.execute.runner() function.

  1. When 'small_open': False, the closed economy version of the model runs, and no other options are required for running the model with regard to the close versus small open option.
  2. When 'small_open': True, the small open economy version of the model runs. We currently have a default world interest rate of 0.04 that is assumed when the small open economy option is selected. But we want the user to be able to input this assumption if they want. A user could input the world interest rate by supplying a value 'world_int_rate': 0.035 in the user_params dictionary in the run_ogusa_serial.py script. This dictionary would be passed to ogusa.scripts.execute.runner(). We would need to update the script runner() to acommodate my suggested 'world_int_rate' key, but we just have to pass that value to parameters.py and set ss_firm_r_annual in line 327 and ss_hh_r_annual in line 328 to either the default for world_int_rate or to its user-supplied value.

For PolicyBrain implementation of these options, we should:

  1. Include a checkbox labeled "Assume small open economy (closed economy if blank)". If the box is left blank, then 'small_open': False in the kwargs passed into OG-USA in the script that runs the model (e.g., run_ogusa_serial.py). The help box text for this check box should be: "If this box is left blank, the OG-USA model is assumed to be a closed economy. If the box is checked, the OG-USA model is assumed to be a small open economy with a fixed world interest rate. The user can either choose to supply a world interest rate below. Otherwise, the model will use the default world interest rate."
  2. If the box is checked, then 'small_open': False in the kwargs passed into OG-USA in the script that runs the model (e.g., run_ogusa_serial.py), and another field becomes available for the fixed world interest rate. If the user supplies no value for the world interest rate, the default (0.04 is used. If they supply a value (bounded between 0.02 and 0.06), then that value is passed to parameters.py as described in point (2) above. The help box text for the world interest rate field should be: "In the small open economy case, the user can either supply a world interest rate (between 0.02 and 0.06) or the default (0.04) can be used."
PeterDSteinberg commented 7 years ago

Hi @rickecon Those notes on open economy options are helpful. I have made some tentative local changes in OG-USA / webapp-public I need to try out further and will push something up tomorrow.

rickecon commented 7 years ago

Thanks @PeterDSteinberg . I will submit a PR on this that updates the code in execute.py to change the internal interest rates in parameters.py.

PeterDSteinberg commented 7 years ago

@rickecon @jdebacker See the OG-USA PR above (I think that makes the necessary changes in OG-USA), but I am still having trouble locally with this PolicyBrain builder PR.