Commit d9fb19e4 authored by Johannes Pfeifer's avatar Johannes Pfeifer
Browse files

Make error message if mode violated prior more explicit

parent 29ff6685
......@@ -927,9 +927,12 @@ if (any(bayestopt_.pshape >0 ) && options_.mh_replic) || ...
bayestopt_.lb = bounds(:,1);
bayestopt_.ub = bounds(:,2);
if any(xparam1 < bounds(:,1)) || any(xparam1 > bounds(:,2))
find(xparam1 < bounds(:,1))
find(xparam1 > bounds(:,2))
error('Mode values are outside prior bounds. Reduce prior_trunc.')
outside_bound_vars=bayestopt_.name([find(xparam1 < bounds(:,1)); find(xparam1 > bounds(:,2))],:);
disp_string=[outside_bound_vars{1,:}];
for ii=2:size(outside_bound_vars,1)
disp_string=[disp_string,', ',outside_bound_vars{ii,:}];
end
error(['Mode value(s) of ', disp_string ,' are outside parameter bounds. Potentially, you should set prior_trunc=0.'])
end
% runs MCMC
if options_.mh_replic
......
Supports Markdown
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