Commit 07bea735 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Merge pull request #557 from rattoma/master

Fixes to mode_compute=5. (1) force univariate steps at every iteration: ...
parents 1b57cb4a e5854cb2
......@@ -101,6 +101,7 @@ while i<n
h1(i)=2.1*h1(i);
end
h1(i) = min(h1(i),0.5*hmax(i));
h1(i) = max(h1(i),1.e-10);
xh1(i)=x(i)+h1(i);
try
[fx, ffx]=feval(func,xh1,DynareDataset,DynareOptions,Model,EstimatedParameters,BayesInfo,DynareResults);
......
......@@ -122,7 +122,7 @@ while norm(gg)>gtol && check==0 && jit<nit
fval=fval1;
x0=x01;
end
if icount==1 || (icount>1 && (fval0(icount-1)-fval0(icount))>1) || ((fval0(icount)-fval)<1.e-2*(gg'*(H*gg))/2 && igibbs),
% if icount==1 || (icount>1 && (fval0(icount-1)-fval0(icount))>1) || ((fval0(icount)-fval)<1.e-2*(gg'*(H*gg))/2 && igibbs),
if length(find(ig))<nx
ggx=ggx*0;
ggx(find(ig))=gg(find(ig));
......@@ -139,7 +139,7 @@ while norm(gg)>gtol && check==0 && jit<nit
nig=[nig ig];
disp('Sequence of univariate steps!!')
fval=fvala;
end
% end
if (fval0(icount)-fval)<ftol && flagit==0
disp('Try diagonal Hessian')
ihh=diag(1./(diag(hhg)));
......
Markdown is supported
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