diff --git a/doc/dynare.texi b/doc/dynare.texi index f47cd38eb..db4fe6ee1 100644 --- a/doc/dynare.texi +++ b/doc/dynare.texi @@ -5304,7 +5304,9 @@ simulation that crashed prematurely, starting with the last available saved the proposal density from the previous run will automatically be loaded. In older versions, to assure a neat continuation of the chain with the same proposal density, you should provide the @code{mode_file} used in the previous -run or the same user-defined @code{mcmc_jumping_covariance} when using this option. +run or the same user-defined @code{mcmc_jumping_covariance} when using this option. Note that +under Octave, a neat continuation of the crashed chain with the respective last random number +generator state is currently not supported. @item mh_mode = @var{INTEGER} @dots{} @@ -5476,7 +5478,9 @@ the proposal density from the previous run will automatically be loaded. In olde to assure a neat continuation of the chain with the same proposal density, you should provide the @code{mode_file} used in the previous run or the same user-defined @code{mcmc_jumping_covariance} when using this option. -Shouldn't be used together with @code{mh_recover}. +Shouldn't be used together with @code{mh_recover}. Note that under Octave, a neat +continuation of the chain with the last random number +generator state of the already present draws is currently not supported. @item load_results_after_load_mh @anchor{load_results_after_load_mh} This option is available when loading a previous MCMC run without diff --git a/tests/estimation/MH_recover/fs2000_recover.mod b/tests/estimation/MH_recover/fs2000_recover.mod index 3f421a8ee..7a55782f6 100644 --- a/tests/estimation/MH_recover/fs2000_recover.mod +++ b/tests/estimation/MH_recover/fs2000_recover.mod @@ -26,10 +26,12 @@ if max(max(abs(temp1.x2-temp2.x2)))>1e-10 error('Draws of affected chain''s unaffected files are not the same') end -%check second, affected chain with affected file -temp1=load([M_.dname '_mh2_blck2.mat']); -temp2=load([M_.dname filesep 'metropolis' filesep M_.dname '_mh2_blck2.mat']); +if ~isoctave + %check second, affected chain with affected file + temp1=load([M_.dname '_mh2_blck2.mat']); + temp2=load([M_.dname filesep 'metropolis' filesep M_.dname '_mh2_blck2.mat']); -if max(max(abs(temp1.x2-temp2.x2)))>1e-10 - error('Draws of affected chain''s affected files are not the same') -end \ No newline at end of file + if max(max(abs(temp1.x2-temp2.x2)))>1e-10 + error('Draws of affected chain''s affected files are not the same') + end +end \ No newline at end of file diff --git a/tests/estimation/MH_recover/fs2000_recover_2.mod b/tests/estimation/MH_recover/fs2000_recover_2.mod index 1d503de7c..11800bcb9 100644 --- a/tests/estimation/MH_recover/fs2000_recover_2.mod +++ b/tests/estimation/MH_recover/fs2000_recover_2.mod @@ -32,18 +32,21 @@ if max(max(abs(temp1.x2-temp2.x2)))>1e-10 error('Draws of affected chain''s unaffected files are not the same') end -%check second, affected chain with affected file -temp1=load([M_.dname '_mh4_blck2.mat']); -temp2=load([M_.dname filesep 'metropolis' filesep M_.dname '_mh4_blck2.mat']); +if ~isoctave + %check second, affected chain with affected file + temp1=load([M_.dname '_mh4_blck2.mat']); + temp2=load([M_.dname filesep 'metropolis' filesep M_.dname '_mh4_blck2.mat']); -if max(max(abs(temp1.x2-temp2.x2)))>1e-10 - error('Draws of affected chain''s affected files are not the same') + if max(max(abs(temp1.x2-temp2.x2)))>1e-10 + error('Draws of affected chain''s affected files are not the same') + end + + %check second, affected chain with affected file + temp1=load([M_.dname '_mh5_blck2.mat']); + temp2=load([M_.dname filesep 'metropolis' filesep M_.dname '_mh5_blck2.mat']); + + if max(max(abs(temp1.x2-temp2.x2)))>1e-10 + error('Draws of affected chain''s affected files are not the same') + end end - -%check second, affected chain with affected file -temp1=load([M_.dname '_mh5_blck2.mat']); -temp2=load([M_.dname filesep 'metropolis' filesep M_.dname '_mh5_blck2.mat']); - -if max(max(abs(temp1.x2-temp2.x2)))>1e-10 - error('Draws of affected chain''s affected files are not the same') -end \ No newline at end of file + \ No newline at end of file diff --git a/tests/estimation/MH_recover/fs2000_recover_3.mod b/tests/estimation/MH_recover/fs2000_recover_3.mod index 3f7b920ec..ac01b4bb2 100644 --- a/tests/estimation/MH_recover/fs2000_recover_3.mod +++ b/tests/estimation/MH_recover/fs2000_recover_3.mod @@ -30,10 +30,12 @@ if max(max(abs(temp1.x2-temp2.x2)))>1e-10 error('Draws of affected chain''s unaffected files are not the same') end -%check second, affected chain with affected file -temp1=load([M_.dname '_mh4_blck2.mat']); -temp2=load([M_.dname filesep 'metropolis' filesep M_.dname '_mh4_blck2.mat']); +if ~isoctave + %check second, affected chain with affected file + temp1=load([M_.dname '_mh4_blck2.mat']); + temp2=load([M_.dname filesep 'metropolis' filesep M_.dname '_mh4_blck2.mat']); -if max(max(abs(temp1.x2-temp2.x2)))>1e-10 - error('Draws of affected chain''s affected files are not the same') + if max(max(abs(temp1.x2-temp2.x2)))>1e-10 + error('Draws of affected chain''s affected files are not the same') + end end \ No newline at end of file diff --git a/tests/estimation/MH_recover/fs2000_recover_tarb.mod b/tests/estimation/MH_recover/fs2000_recover_tarb.mod index 36667faf9..4d3d9ee73 100644 --- a/tests/estimation/MH_recover/fs2000_recover_tarb.mod +++ b/tests/estimation/MH_recover/fs2000_recover_tarb.mod @@ -26,10 +26,12 @@ if max(max(abs(temp1.x2-temp2.x2)))>1e-10 error('Draws of affected chain''s unaffected files are not the same') end -%check second, affected chain with affected file -temp1=load([M_.dname '_mh2_blck2.mat']); -temp2=load([M_.dname filesep 'metropolis' filesep M_.dname '_mh2_blck2.mat']); +if ~isoctave + %check second, affected chain with affected file + temp1=load([M_.dname '_mh2_blck2.mat']); + temp2=load([M_.dname filesep 'metropolis' filesep M_.dname '_mh2_blck2.mat']); -if max(max(abs(temp1.x2-temp2.x2)))>1e-10 - error('Draws of affected chain''s affected files are not the same') -end + if max(max(abs(temp1.x2-temp2.x2)))>1e-10 + error('Draws of affected chain''s affected files are not the same') + end +end \ No newline at end of file diff --git a/tests/estimation/fs2000.mod b/tests/estimation/fs2000.mod index a70b76463..d9f62263c 100644 --- a/tests/estimation/fs2000.mod +++ b/tests/estimation/fs2000.mod @@ -111,10 +111,12 @@ estimation(mode_compute=0,mode_file=fs2000_mode,order=1, datafile=fsdat_simul, n temp1=load([M_.dname '_mh1_blck1.mat']); temp2=load([M_.dname filesep 'metropolis' filesep M_.dname '_mh1_blck1.mat']); -if max(max(abs(temp1.x2-temp2.x2)))>1e-10 - error('Draws of unaffected chain are not the same') +if ~isoctave + if max(max(abs(temp1.x2-temp2.x2)))>1e-10 + error('Adding draws did not result in the same chain') + end end - + save('fs2000_result.mat','oo_') options_.load_results_after_load_mh=1; estimation(mode_compute=0,mode_file=fs2000_mode,order=1, datafile=fsdat_simul, nobs=192, loglinear, mh_replic=0, mh_nblocks=1, mh_jscale=10,load_mh_file,smoother) gy_obs gp_obs;