Skip to content
Snippets Groups Projects
Commit 560771be authored by Marco Ratto's avatar Marco Ratto
Browse files

Trap the case when second output of objective function is empty.

parent 285e40eb
Branches
Tags
No related merge requests found
......@@ -133,7 +133,7 @@ while i<n
end
f1(:,i)=fx;
if outer_product_gradient,
if any(isnan(ffx))
if any(isnan(ffx)) || isempty(ffx),
ff1=ones(size(ff0)).*fx/length(ff0);
else
ff1=ffx;
......@@ -143,7 +143,7 @@ while i<n
[fx, ffx]=feval(func,xh1,DynareDataset,DynareOptions,Model,EstimatedParameters,BayesInfo,DynareResults);
f_1(:,i)=fx;
if outer_product_gradient,
if any(isnan(ffx))
if any(isnan(ffx)) || isempty(ffx),
ff_1=ones(size(ff0)).*fx/length(ff0);
else
ff_1=ffx;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment