-
-
Notifications
You must be signed in to change notification settings - Fork 132
Time path varying parameters #433
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
Conversation
|
@hdoupe I'm having trouble getting tests to work out and it is related to me missing something about how the parameters class is working - maybe you can help. What I'm trying to do with this PR is to allow some parameters to be specified such that they vary over the time path. These parameters are: What I've done is to specify these parameters as single element lists in I can get the model to solve with this, but when I try to run some unit tests, I'm finding a couple issues that I'm unsure how to handle:
You can how the second issue is arising if you work from this branch and then run
I've been unable to trace why the Any help with issues (1) and (2) -- or other thoughts on how best to specify time-path-varying parameters, would be very much appreciated! |
|
I figured out the issue with the If I set this to: Then things work as expected when updating the |
|
Found a quick fix to (1) above by slicing the "old" arrays of the time path parameters if there is new T and S that sum to a number less than the default values. This is not ideal, but will be serviceable for now. |
|
Model with time path varying parameters can reproduce old results. Need to add a few new tests for cases where parameters vary over the time path. |
|
Hey Jason, I'm trying to get up to speed on the problems that you ran into in PR #433. I think I figured out what's going on with the validation_value = np.full(param_value.shape,
validation_value)However, if the min value points to another variable, then the lines 574-578 of if isinstance(validation_value, six.string_types):
validation_value = self.simple_eval(validation_value)
else:
validation_value = np.full(param_value.shape,
validation_value)I removed the if isinstance(validation_value, six.string_types):
validation_value = self.simple_eval(validation_value)
validation_value = np.full(param_value.shape, validation_value)I reverted from ogusa.parameters import Specifications
p = Specifications()
p.update_specifications({"retirement_age": [70] * p.retirement_age.shape[0]})
p = Specifications()
p.update_specifications({"retirement_age": [int(p.starting_age - 1)] * p.retirement_age.shape[0]})and got this output: Does this fix resolve the issue that you were having around the min/max validation for the retirement age variable? |
|
@hdoupe -- thanks for this. Works great and I'd have not seen this as the fix very easily. |
|
@rickecon This is passing all tests. Let me know if the PR looks good to you. |
This PR updates how several policy parameters and TFP are handled to allow them to vary over the time path.