Commit cef13ffd authored by Johannes Pfeifer 's avatar Johannes Pfeifer

Make load_mh_file honor use_mh_covariance option

parent 78a4bca3
......@@ -490,7 +490,8 @@ elseif options_.mh_recover
end
function [d,bayestopt_]=set_proposal_density_to_previous_value(record,options_,bayestopt_,d)
if isfield(record,'ProposalCovariance') && isfield(record,'ProposalCovariance')
if ~options_.use_mh_covariance_matrix
if isfield(record,'ProposalCovariance') && isfield(record,'ProposalScaleVec')
if isfield(record,'MCMC_sampler')
if ~strcmp(record.MCMC_sampler,options_.posterior_sampler_options.posterior_sampling_method)
error(fprintf('Estimation::mcmc: The posterior_sampling_method differs from the one of the original chain. Please reset it to %s',record.MCMC_sampler))
......@@ -499,7 +500,7 @@ if isfield(record,'ProposalCovariance') && isfield(record,'ProposalCovariance')
fprintf('Estimation::mcmc: Recovering the previous proposal density.\n')
d=record.ProposalCovariance;
bayestopt_.jscale=record.ProposalScaleVec;
else
else
if ~isequal(options_.posterior_sampler_options.posterior_sampling_method,'slice')
% pass through input d unaltered
if options_.mode_compute~=0
......@@ -510,4 +511,8 @@ 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
else
% pass through input d unaltered
fprintf('Estimation::mcmc: use_mh_covariance_matrix specified, continuing with proposal density implied by the previous MCMC run.\n.');
end
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment