Random number generator

已查看 10 次
跳至第一个未读帖子

Mahdi Ben Jelloul

未读,
2021年8月31日 05:06:432021/8/31
收件人 liam2-users
Dear liam2 users,

I need to be enlightened about the random number generator behaviour.

In my simulation I do have a global parameter that triggers csv files writing.
To mimic "if", I use while in the following way: 

globals:
  - SAVE_SOME_FILES: True

...

trigger: SAVE_SOME_FILES
while trigger:
  - save_my_files()
  - trigger: False 
   
 
In the rest of the code I do some random draws using various distributions, align etc.
To ensure reproducibility, I set a random seed in the main console file. 
But the results differ when the program is run with SAVE_SOME_FILES set to true or false.

Is that the way it should be ?
What are the operations affecting the random number generator ?

Thank you !

Mahdi Ben Jelloul

Gaëtan de Menten

未读,
2021年9月16日 05:14:182021/9/16
收件人 liam2...@googlegroups.com

Hi Mahdi,

 

Except from the seed command, only functions which generate/uses random numbers affects subsequent random numbers “draws”, so my guess is that you have something using random numbers in your save_my_file() function or any code called from there.

 

Hope it helps,

Gaëtan

--
You received this message because you are subscribed to the Google Groups "liam2-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liam2-users...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/liam2-users/CA%2BAkwScyni5WNf_uF8%3Dp98O%3DNZ8PcsawZH%3DjDXbqEsnTyjcLHQ%40mail.gmail.com.



Disclaimer: This e-mail may contain confidential information which is intended only for the use of the recipient(s) named above.
If you have received this communication in error, please notify the sender immediately and delete this e-mail from your system.
Please note that e-mail messages cannot be considered as official information from the Federal Planning Bureau.

Mahdi Ben Jelloul

未读,
2021年9月16日 10:49:402021/9/16
收件人 liam2-users
回复全部
回复作者
转发
0 个新帖子