Parallel MCMC (Multiple chains): Correct random number generator?

I would like to run one MCMC simulation (chain) on each worker. First, I create a random stream of numbers on each worker:
parpool
spmd
s = RandStream.create(mrg32k3a,NumStreams,numlabs,StreamIndices,labindex);
RandStream.setGlobalStream(s);
end
Then, I perform the simulations (I suppose the two tasks could be combined):
spmd
chain = MCMC_Simulation(input); %%%this function uses rand() and randn(); it is the DRAM algorithm
end
Am I correctly using RandStream to ensure statistically independent random numbers across workers? If I "restart" my simulations in a new Matlab session and need random numbers that are independent across the sessions and all other workers, how do I ensure this independence? Do I need to know ahead of time if I will restart?

Answers (0)

Categories

Asked:

on 16 Jun 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!