Merge pull request #557 from rattoma/master

Fixes to mode_compute=5. (1) force univariate steps at every iteration: ...
time-shift
Sébastien Villemot 2013-12-09 05:29:47 -08:00
commit 07bea735de
2 changed files with 3 additions and 2 deletions

View File

@ -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);

View File

@ -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)));