-
-
Notifications
You must be signed in to change notification settings - Fork 199
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
[WIP] Consistent t-indexing for time varying parameters #1027
Closed
Conversation
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
Some of the failing tests were due to problems resolved by #1029 I'll do a pass through the remaining test failures trying to fix anything which I think isn't due to the changing newborn handling. |
This PR got messy. I'm going to start again with a clean cut off master |
Nevermind I've found where some code that might be responsible for the failing tests is. Related to #981 |
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR works towards addressing #1022, and along with with #326.
The main change to the core logic is that when a model with time-varying parameters of length T is given to
solve_one_cycle
, the solutions in the cycle are solved backwards and given inputs drawn from the following state, which is (t+1).For truly cyclic models, T solutions are created. The T'th solution (which is solved first) draws is parameters from the 0th period.
For "lifecycle" models, where the "cycle" represents a series of steps executed only once, (T - 1) solutions are created. The Tth solution (which is solved first), which corresponds to the _pen_ultimate period, draws parameters from the last period (whose terminal solution is computed elsewhere).
Further changes to the library entailed by this change include:
get_shocks()
. Because this newborn code created an extradraw()
for every agent, changing the distribution's random seed accordingly, changing this will change all numerical values from simulations. So this will require a thorough code review. I request that from @mnwhiteWhat I should not be getting, which I hope to correct for through further work on this PR, are changes to the solution objects.
Some open questions on my end are:
If at all possible, here is what I'm hoping NOT to do in this PR:
While there are models that may require changes along these lines, I'm not sure any of the existing models do. I would recommend not trying to support a feature that does not have a model and test using it in the library.