diff --git a/matlab/posterior_sampler_core.m b/matlab/posterior_sampler_core.m index c677e02cc..d88ae742a 100644 --- a/matlab/posterior_sampler_core.m +++ b/matlab/posterior_sampler_core.m @@ -126,9 +126,13 @@ for curr_block = fblck:nblck, % Matlab/Octave cluster). Therefore the trap. % % Set the random number generator type (the seed is useless but needed by the function) - set_dynare_seed(options_.DynareRandomStreams.algo, options_.DynareRandomStreams.seed); + if ~isoctave + set_dynare_seed(options_.DynareRandomStreams.algo, options_.DynareRandomStreams.seed); + else + set_dynare_seed(options_.DynareRandomStreams.seed+curr_block); + end % Set the state of the RNG - set_dynare_random_generator_state(record.InitialSeeds(curr_block).Unifor, record.InitialSeeds(curr_block).Normal); + set_dynare_random_generator_state(record.InitialSeeds(curr_block).Unifor, record.InitialSeeds(curr_block).Normal); catch % If the state set by master is incompatible with the slave, we only reseed set_dynare_seed(options_.DynareRandomStreams.seed+curr_block);