diff --git a/matlab/EvalWelfare.m b/matlab/EvalWelfare.m index fabb40d9a47fbcbc5514d317c19014294af99713..d0a4e72f26e8a689b449ff5ec909d4e3098a3aaa 100644 --- a/matlab/EvalWelfare.m +++ b/matlab/EvalWelfare.m @@ -101,4 +101,5 @@ if pltOpt box on xlabel('Welfare') ylabel('Posterior density') -end \ No newline at end of file +end +options_.order = 1; \ No newline at end of file diff --git a/matlab/metropolis.m b/matlab/metropolis.m index 9280822ffc61d17d1122f3fe58c4ca1d61a5e807..11eb229f2b87d0f3e211667ee6c6d0598127cdb7 100644 --- a/matlab/metropolis.m +++ b/matlab/metropolis.m @@ -118,9 +118,16 @@ function metropolis(xparam1,vv,gend,data,rawdata,mh_bounds) if nblck>1 files = eval(['dir(''' fname_ '_mh*_blck*.mat'');']); bfiles = eval(['dir(''' fname_ '_mh0_blck*.mat'');']); + lfile = length(files)/length(bfiles)-1; else files = eval(['dir(''' fname_ '_mh*.mat'');']); bfiles = 1; + ifiles = eval(['dir(''' fname_ '_MhInitialization.mat'');']); + if isempty(ifiles) + lfile = length(files)-1; + else + lfile = length(files)-2; + end end if ~length(files) error('MH: FAILURE :: there is no MH file to load here!') @@ -133,7 +140,7 @@ function metropolis(xparam1,vv,gend,data,rawdata,mh_bounds) nblck = past_number_of_blocks; options_.mh_nblck = nblck; end - lfile = length(files)/nblck-1; + %lfile = length(files)/nblck-1; if nblck == 1 instr = [fname_ '_mh' int2str(lfile)]; eval(['load ' instr]);