Commit 2815d5fb authored by Johannes Pfeifer's avatar Johannes Pfeifer
Browse files

Make error message for prior violation more explicit by adding second argument to info()

parent d3457ee4
......@@ -180,7 +180,7 @@ if ~isequal(DynareOptions.mode_compute,1) && any(xparam1<BayesInfo.lb)
k = find(xparam1<BayesInfo.lb);
fval = objective_function_penalty_base+sum((BayesInfo.lb(k)-xparam1(k)).^2);
exit_flag = 0;
info = 41;
info = [41 k'];
if analytic_derivation,
DLIK=ones(length(xparam1),1);
end
......@@ -192,7 +192,7 @@ if ~isequal(DynareOptions.mode_compute,1) && any(xparam1>BayesInfo.ub)
k = find(xparam1>BayesInfo.ub);
fval = objective_function_penalty_base+sum((xparam1(k)-BayesInfo.ub(k)).^2);
exit_flag = 0;
info = 42;
info = [42 k'];
if analytic_derivation,
DLIK=ones(length(xparam1),1);
end
......
......@@ -145,7 +145,7 @@ if (DynareOptions.mode_compute~=1) && any(xparam1<BayesInfo.lb)
k = find(xparam1(:) < BayesInfo.lb);
fval = objective_function_penalty_base+sum((BayesInfo.lb(k)-xparam1(k)).^2);
exit_flag = 0;
info = 41;
info = [41 k'];
return
end
......@@ -154,7 +154,7 @@ if (DynareOptions.mode_compute~=1) && any(xparam1>BayesInfo.ub)
k = find(xparam1(:)>BayesInfo.ub);
fval = objective_function_penalty_base+sum((xparam1(k)-BayesInfo.ub(k)).^2);
exit_flag = 0;
info = 42;
info = [42 k'];
return
end
......
......@@ -83,9 +83,19 @@ if ~noprint
case 30
error('Variance can''t be computed')
case 41
error('one (many) parameter(s) do(es) not satisfy the lower bound');
global bayestopt_;
disp_string=deblank(bayestopt_.name{info(2),1});
for ii=1:length(info)-2
disp_string=[disp_string,', ',deblank(bayestopt_.name{info(2+ii),:})];
end
error(['The following parameter(s) do(es) not satisfy the lower bound: ' disp_string]);
case 42
error('one (many) parameter(s) do(es) not satisfy the upper bound');
global bayestopt_;
disp_string=deblank(bayestopt_.name{info(2),1});
for ii=1:length(info)-2
disp_string=[disp_string,', ',deblank(bayestopt_.name{info(2+ii),:})];
end
error(['The following parameter(s) do(es) not satisfy the upper bound: ' disp_string]);
case 43
error('Covariance matrix of structural shocks is not positive definite')
case 44 %DsgeLikelihood_hh / dsge_likelihood
......
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