Commit d8cf192c authored by ratto's avatar ratto
Browse files

Try/catch to avoid crashes linked to errors in diffuselikelihood that are not trapped by cost_flag

git-svn-id: https://www.dynare.org/svn/dynare/trunk@2964 ac1d8469-bf42-47a9-8791-bf33cf982152
parent df921ce8
......@@ -85,7 +85,11 @@ for plt = 1:nbplt,
for i=1:length(z)
xx(kk) = z(i);
if isempty(strmatch('dsge_prior_weight',M_.param_names))
[fval,cost_flag] = DsgeLikelihood(xx,gend,data,data_index,number_of_observations,no_more_missing_observations);
try
[fval,cost_flag] = DsgeLikelihood(xx,gend,data,data_index,number_of_observations,no_more_missing_observations);
catch
cost_flag = 0;
end
if cost_flag
y(i,1) = fval;
else
......
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