posterior_sampler_initialization.m: provide missing function input

Fixes #1622
time-shift
Johannes Pfeifer 2019-07-31 15:26:33 +02:00 committed by Stéphane Adjemian (Charybdis)
parent da0ad67367
commit d4ed77c67e
1 changed files with 11 additions and 6 deletions

View File

@ -366,8 +366,8 @@ elseif options_.mh_recover
FirstLine = ones(NumberOfBlocks,1);
LastFileFullIndicator=1;
end
if ~isequal(options_.posterior_sampler_options.posterior_sampling_method,'slice'),
[d,bayestopt_]=set_proposal_density_to_previous_value(record,options_,bayestopt_);
if ~isequal(options_.posterior_sampler_options.posterior_sampling_method,'slice')
[d,bayestopt_]=set_proposal_density_to_previous_value(record,options_,bayestopt_,d);
end
%% Now find out what exactly needs to be redone
% 1. Check if really something needs to be done
@ -464,9 +464,14 @@ if isfield(record,'ProposalCovariance') && isfield(record,'ProposalCovariance')
d=record.ProposalCovariance;
bayestopt_.jscale=record.ProposalScaleVec;
else
if options_.mode_compute~=0
fprintf('Estimation::mcmc: No stored previous proposal density found, continuing with the one implied by mode_compute\n.');
elseif ~isempty(options_.mode_file)
fprintf('Estimation::mcmc: No stored previous proposal density found, continuing with the one implied by the mode_file\n.');
if ~isequal(options_.posterior_sampler_options.posterior_sampling_method,'slice')
% pass through input d unaltered
if options_.mode_compute~=0
fprintf('Estimation::mcmc: No stored previous proposal density found, continuing with the one implied by mode_compute\n.');
elseif ~isempty(options_.mode_file)
fprintf('Estimation::mcmc: No stored previous proposal density found, continuing with the one implied by the mode_file\n.');
else
error('Estimation::mcmc: No stored previous proposal density found, no mode-finding conducted, and no mode-file provided. I don''t know how to continue')
end
end
end