Random seed

22 views
Skip to first unread message

Thomas Wiecki

unread,
Jun 10, 2010, 6:30:55 PM6/10/10
to py...@googlegroups.com
I am running multiple chains of my model in parallel by using
multiprocessing.pool(). However, I think that the seeds get
initialised to the same values in each process as the traces are
_very_ similar (all starting values are the same). Is this correct? If
yes, how can I set the initial seed pymc uses. If not, what else could
be the problem here?

Chris Fonnesbeck

unread,
Jun 10, 2010, 6:44:46 PM6/10/10
to PyMC
Hi Thomas,

At present, the way to supply a random number seed is via the rseed
for each Stochastic in your model:

x = Normal('x', mu=mu, tau=tau, rseed=342354321)

Alternately, you could supply different initial values yourself, via
the value argument.

cf

On Jun 10, 5:30 pm, Thomas Wiecki <thomas.wie...@googlemail.com>
wrote:

Thomas Wiecki

unread,
Jun 10, 2010, 7:10:24 PM6/10/10
to py...@googlegroups.com
Hi Chris,

thanks for your help. Unfortunately, setting rseed fot the stochastics
did not change the first value being drawn. This is rather curios to
me. Any ideas?

-Thomas

> --
> You received this message because you are subscribed to the Google Groups "PyMC" group.
> To post to this group, send email to py...@googlegroups.com.
> To unsubscribe from this group, send email to pymc+uns...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pymc?hl=en.
>
>

Thomas Wiecki

unread,
Jun 10, 2010, 7:23:15 PM6/10/10
to py...@googlegroups.com
OK, rseed did not change anything. But numpy.random.seed(rnd) did the trick.

Thanks!

-Thomas

Reply all
Reply to author
Forward
0 new messages