From d4ed77c67eedca75f6d79ec974f94f1bb348e9ef Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer <jpfeifer@gmx.de> Date: Wed, 31 Jul 2019 15:26:33 +0200 Subject: [PATCH] posterior_sampler_initialization.m: provide missing function input Fixes #1622 --- matlab/posterior_sampler_initialization.m | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/matlab/posterior_sampler_initialization.m b/matlab/posterior_sampler_initialization.m index d870d737dd..364bf2b20c 100644 --- a/matlab/posterior_sampler_initialization.m +++ b/matlab/posterior_sampler_initialization.m @@ -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 -- GitLab