-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
set seed on distribution initialization, not draw. #691
Conversation
It looks like Windows handles maximum integer length differently from MacOS and Ubuntu. I suppose it's worth articulating what I'm trying to do in the failing code... HARK seems to be designed so that a model performs identically, though pseudorandomly, when ran twice. That's done through default random seeds. Before, the seeds were passed to the distribution code when the distribution was drawn from. One issue raised by this new design is whether and how to the seeds from a continuous distribution to the new distribution created by its discretization. In this code, it's drawing that seed pseudorandomly from the continuous distribution's generator. |
Debugging this is hard because I can't run the WIndow build natively. But I'm trying these fixes, in light of the fact that RandomState
See: numpy/numpy#4085 |
Add quick reset() method to set RandomState (to same value). |
When does a reset() method need to be called by the AgentType class? Currently, most distributions used in solution and simulation are constructed just before they are used, then discarded. I would like to eventually change that so that the distributions are provided when the model is initialized, but things don't work like that yet. |
Oh! That could definitely be the source of the performance slowdown.
reset() would be called during a Market's solve() loop, right before the
model is simulated again.
…On Fri, May 22, 2020 at 2:07 PM Sebastian Benthall ***@***.***> wrote:
When does a reset() method need to be called by the AgentType class?
Currently, most distributions used in solution and simulation are
constructed just before they are used, then discarded.
I would like to eventually change that so that the distributions are
provided when the model is initialized, but things don't work like that yet.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#691 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADKRAFIE3RD5RI4IQA5B4MTRS25M5ANCNFSM4NBAADAA>
.
|
|
Should we merge this? |
Ugh, we'll have to adjust the AggShock economy test targets, as this PR changes the random seed. The targets change because the tests don't actually solve the model, but instead quit after 3 passes; the idiosyncratic shocks thus matter. |
I thought I merged this. Pretty sure it's ready for merge after these checks run. |
fixes #619