diff --git a/doc/dynare.texi b/doc/dynare.texi index f47cd38eb2d6ec312df5aa7e8f5510cd86514d42..db4fe6ee119bd68fc48271d728625f52172553e6 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 3f421a8ee2d0f8bccf0df4924065ed3f0d982eb9..7a55782f600da309c2c79091443bb1293d8d6295 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 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 ~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 +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 1d503de7c6dd29d4b3084bd41ce9f0b30cf5bea2..11800bcb9c2fe0d31f98666acf256fe6b56ae818 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 max(max(abs(temp1.x2-temp2.x2)))>1e-10 - error('Draws of affected chain''s affected files are not the same') +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') + 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 3f7b920ec3346ba2720578d81928047b56b868b4..ac01b4bb2b09220af6e8b2175d08f709a656423a 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 max(max(abs(temp1.x2-temp2.x2)))>1e-10 - error('Draws of affected chain''s affected files are not the same') +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') + 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 36667faf90af4946c912daff6d7e8f82efba7ba3..4d3d9ee7334a65757f472622cc0d09091be424dc 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 max(max(abs(temp1.x2-temp2.x2)))>1e-10 - error('Draws of affected chain''s affected files are not the same') -end +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 +end \ No newline at end of file diff --git a/tests/estimation/fs2000.mod b/tests/estimation/fs2000.mod index a70b76463c68690fa97b6579116bb9a2a628b7e6..d9f62263c44012f2b656ba020d5542519c9fb64b 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;