-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Add random seed to wealth dynamics lecture #50
Comments
@Harveyt47 I think what is happening here is that RandomState is setting a deterministic sequence of values. So |
That's what I thought but when I run the first cell it always returns 0.471... Is that consistent with what your saying @mmcky. I would have expected it to change. |
Also using this type of method has issues with jitted classes and functions. I'm not sure jit can interpret the I've noticed that in the draw function in the qe library we can not set a seed for it. |
when you rerun the first cell you're just reseting the sequence again right? |
I see. Thanks @mmcky |
@Harveyt47 , I recommend you create a little test notebook where you try to understand random seeds and how they interact with numba and prange. You might need to do some background reading in the numba docs. Once you have the main ideas worked out, it would be great if you could share it with us. We might even end up writing a short lecture on this topic, because not many people understand it, including me :-) |
Hi @jstac that sounds like a great idea. I'll get on it |
@Harveyt47, would you mind to let us know the status of this? |
Hi @jstac from the research I did the main problem is setting a seed across all the threads. For example in the case of the gini coefficient curve the household wealth distribution comes from the function |
For example, we want the figure showing Gini coefficient vs mu_r in
weath_dynamics.rst
to be unchanging.This is quite subtle due to use of Numba and parallelization (which tends to cause problems with seeds). I'm not sure it can be done but it needs to be investigated and a rewrite of the code might be required.
The text was updated successfully, but these errors were encountered: