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

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

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