Bug fixes (related to the loading of the mcmc files) + Cosmetic changes.
parent
c6ca0c593c
commit
832f8ee82f
|
@ -22,16 +22,18 @@ if nargout>1
|
||||||
description = '';
|
description = '';
|
||||||
end
|
end
|
||||||
|
|
||||||
%% Get informations about mcmc files.
|
MetropolisFolder = CheckPath('metropolis',M_.dname);
|
||||||
|
|
||||||
|
% Get informations about mcmc files.
|
||||||
if ~exist([ M_.dname '/metropolis'],'dir')
|
if ~exist([ M_.dname '/metropolis'],'dir')
|
||||||
disp('check_posterior_analysis_data:: Can''t find any mcmc file!')
|
disp('check_posterior_analysis_data:: Can''t find any mcmc file!')
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
mhname = get_name_of_the_last_mh_file(M_);
|
mhname = get_name_of_the_last_mh_file(M_);
|
||||||
mhdate = get_date_of_a_file(mhname);
|
mhdate = get_date_of_a_file([MetropolisFolder filesep mhname]);
|
||||||
|
|
||||||
%% Get informations about _posterior_draws files.
|
% Get informations about _posterior_draws files.
|
||||||
drawsinfo = dir([ M_.dname '/metropolis/' M_.fname '_posterior_draws*.mat']);
|
drawsinfo = dir([ MetropolisFolder filesep M_.fname '_posterior_draws*.mat']);
|
||||||
if isempty(drawsinfo)
|
if isempty(drawsinfo)
|
||||||
info = 1; % select_posterior_draws has to be called first.
|
info = 1; % select_posterior_draws has to be called first.
|
||||||
if nargout>1
|
if nargout>1
|
||||||
|
@ -40,8 +42,7 @@ if isempty(drawsinfo)
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
number_of_last_posterior_draws_file = length(drawsinfo);
|
number_of_last_posterior_draws_file = length(drawsinfo);
|
||||||
pddate = get_date_of_a_file([ M_.dname '/metropolis/' M_.fname '_posterior_draws'...
|
pddate = get_date_of_a_file([ MetropolisFolder filesep M_.fname '_posterior_draws' int2str(number_of_last_posterior_draws_file) '.mat']);
|
||||||
int2str(number_of_last_posterior_draws_file) '.mat']);
|
|
||||||
if pddate<mhdate
|
if pddate<mhdate
|
||||||
info = 2; % _posterior_draws files have to be updated.
|
info = 2; % _posterior_draws files have to be updated.
|
||||||
if nargout>1
|
if nargout>1
|
||||||
|
@ -56,7 +57,7 @@ else
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
%% Get informations about posterior data files.
|
% Get informations about posterior data files.
|
||||||
switch type
|
switch type
|
||||||
case 'variance'
|
case 'variance'
|
||||||
generic_post_data_file_name = 'Posterior2ndOrderMoments';
|
generic_post_data_file_name = 'Posterior2ndOrderMoments';
|
||||||
|
@ -69,7 +70,7 @@ switch type
|
||||||
otherwise
|
otherwise
|
||||||
disp('This feature is not yest implemented!')
|
disp('This feature is not yest implemented!')
|
||||||
end
|
end
|
||||||
pdfinfo = dir([ M_.dname '/metropolis/' M_.fname '_' generic_post_data_file_name '*']);
|
pdfinfo = dir([ MetropolisFolder filesep M_.fname '_' generic_post_data_file_name '*']);
|
||||||
if isempty(pdfinfo)
|
if isempty(pdfinfo)
|
||||||
info = 4; % posterior draws have to be processed.
|
info = 4; % posterior draws have to be processed.
|
||||||
if nargout>1
|
if nargout>1
|
||||||
|
@ -79,8 +80,7 @@ if isempty(pdfinfo)
|
||||||
else
|
else
|
||||||
number_of_the_last_post_data_file = length(pdfinfo);
|
number_of_the_last_post_data_file = length(pdfinfo);
|
||||||
name_of_the_last_post_data_file = ...
|
name_of_the_last_post_data_file = ...
|
||||||
[ pwd filesep M_.dname ...
|
[ pwd filesep MetropolisFolder filesep ...
|
||||||
filesep 'metropolis' filesep ...
|
|
||||||
M_.fname '_' ...
|
M_.fname '_' ...
|
||||||
generic_post_data_file_name ...
|
generic_post_data_file_name ...
|
||||||
int2str(number_of_the_last_post_data_file) ...
|
int2str(number_of_the_last_post_data_file) ...
|
||||||
|
@ -95,6 +95,6 @@ else
|
||||||
info = 6; % Ok (nothing to do ;-)
|
info = 6; % Ok (nothing to do ;-)
|
||||||
if nargout>1
|
if nargout>1
|
||||||
description = 'There is nothing to do';
|
description = 'There is nothing to do';
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -33,7 +33,7 @@ info = 1;
|
||||||
|
|
||||||
MetropolisFolder = CheckPath('metropolis',M_.dname);
|
MetropolisFolder = CheckPath('metropolis',M_.dname);
|
||||||
ModelName = M_.fname;
|
ModelName = M_.fname;
|
||||||
BaseName = [MetropolisFolder, ModelName];
|
BaseName = [MetropolisFolder filesep ModelName];
|
||||||
|
|
||||||
load_last_mh_history_file(MetropolisFolder, ModelName);
|
load_last_mh_history_file(MetropolisFolder, ModelName);
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ predicted_mhname = [ BaseName '_mh' int2str(mh_number) '_blck' int2str(bk_number
|
||||||
|
|
||||||
all_mh_files = dir([BaseName '_mh*_blck*' ]);
|
all_mh_files = dir([BaseName '_mh*_blck*' ]);
|
||||||
[junk,idx] = sort([all_mh_files.datenum]);
|
[junk,idx] = sort([all_mh_files.datenum]);
|
||||||
mhnamme = all_mh_files(idx(end)).name;
|
mhname = all_mh_files(idx(end)).name;
|
||||||
|
|
||||||
if ~strcmpi(mhname,predicted_mhname)
|
if ~strcmpi(mhname,predicted_mhname)
|
||||||
info = 0;
|
info = 0;
|
||||||
|
|
Loading…
Reference in New Issue