Skip to content
Snippets Groups Projects
Commit f77b101d authored by MichelJuillard's avatar MichelJuillard
Browse files

fixing bugs in random generator handling code

parent 378413ed
No related branches found
No related tags found
No related merge requests found
...@@ -135,7 +135,8 @@ jloop=0; ...@@ -135,7 +135,8 @@ jloop=0;
JSUM = 0; JSUM = 0;
for b = fblck:nblck, for b = fblck:nblck,
jloop=jloop+1; jloop=jloop+1;
set_dynare_seed(options_.DynareRandomStreams.seed+b); set_dynare_random_generator_state(record.Seeds(b).Unifor, ...
record.Seeds(b).Normal);
if (options_.load_mh_file~=0) && (fline(b)>1) && OpenOldFile(b) if (options_.load_mh_file~=0) && (fline(b)>1) && OpenOldFile(b)
load(['./' MhDirectoryName '/' ModelName '_mh' int2str(NewFile(b)) ... load(['./' MhDirectoryName '/' ModelName '_mh' int2str(NewFile(b)) ...
'_blck' int2str(b) '.mat']) '_blck' int2str(b) '.mat'])
......
...@@ -46,7 +46,7 @@ function [state_u,state_n] = get_dynare_random_generator_state(state_u,state_n) ...@@ -46,7 +46,7 @@ function [state_u,state_n] = get_dynare_random_generator_state(state_u,state_n)
'don''t understand the origin of the problem, ' ... 'don''t understand the origin of the problem, ' ...
'please, contact Dynare''s development team.']) 'please, contact Dynare''s development team.'])
end end
s_new = RandStream(s.type,'State',state_u); s.State = state_u;
if matlab_ver_less_than('7.12') if matlab_ver_less_than('7.12')
RandStream.setDefaultStream(s); RandStream.setDefaultStream(s);
else else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment