Parallel MCMC (Multiple chains): Correct random number generator?
1 view (last 30 days)
Show older comments
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?
0 Comments
Answers (0)
See Also
Categories
Find more on Mathematics and Optimization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!