seeds & random number streams

59 views
Skip to first unread message

Sebastian Weber

unread,
May 7, 2014, 10:22:59 AM5/7/14
to stan-...@googlegroups.com
Hi!
 
Just a quick question concerning seeds (the manual was not too precise on that): In case I want to start multiple chains in parallel for my stan model, then I would do this:
 
./model init=0 seed=1234 id=1
./model init=0 seed=1234 id=2
 
Now all chains would start from the very same initial value *and* seed. However, does Stan use the id in order to make the random number generator streams independent? This is what I assumed all the time, but I was looking for a statement like this in the manual and could not find it.
 
Many thanks for clarification!
 
Best,
Sebastian

Michael Betancourt

unread,
May 7, 2014, 10:42:01 AM5/7/14
to stan-...@googlegroups.com
Yes, the seed gets advanced by the chain id so those two chains would
indeed produce independent chains.

--
You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sebastian Weber

unread,
May 7, 2014, 10:53:49 AM5/7/14
to stan-...@googlegroups.com
 
What does that mean? Is the "true" seed something like seed + id. I mean how does stan create independent random number streams from a seed and an id? I know how this work for L'ecuyer (or however it is spelled), but what is the stan way to do that?
 
This could be a bit more explicit in the manual (or I overlooked), but from quick going trough it, I only found that the id is a magic process id.

Michael Betancourt

unread,
May 7, 2014, 11:01:03 AM5/7/14
to stan-...@googlegroups.com
Stan uses a L’ecuyer RNG and strides the chain RNGs using the a multiple of the chain ID.

Bob Carpenter

unread,
May 7, 2014, 12:14:13 PM5/7/14
to stan-...@googlegroups.com
From the manual:



On May 7, 2014, at 4:53 PM, Sebastian Weber <sdw....@gmail.com> wrote:

>
> What does that mean? Is the "true" seed something like seed + id. I mean how does stan create independent random number streams from a seed and an id? I know how this work for L'ecuyer (or however it is spelled), but what is the stan way to do that?


>
> This could be a bit more explicit in the manual (or I overlooked), but from quick going trough it, I only found that the id is a magic process id.

Will do:

https://github.com/stan-dev/stan/issues/567#issuecomment-42447688

'id' is rather hard to search for and we need to make the doc more
explicit.

- Bob

Reply all
Reply to author
Forward
0 new messages