Merge pull request #557 from rattoma/master
Fixes to mode_compute=5. (1) force univariate steps at every iteration: ...time-shift
commit
07bea735de
|
@ -101,6 +101,7 @@ while i<n
|
||||||
h1(i)=2.1*h1(i);
|
h1(i)=2.1*h1(i);
|
||||||
end
|
end
|
||||||
h1(i) = min(h1(i),0.5*hmax(i));
|
h1(i) = min(h1(i),0.5*hmax(i));
|
||||||
|
h1(i) = max(h1(i),1.e-10);
|
||||||
xh1(i)=x(i)+h1(i);
|
xh1(i)=x(i)+h1(i);
|
||||||
try
|
try
|
||||||
[fx, ffx]=feval(func,xh1,DynareDataset,DynareOptions,Model,EstimatedParameters,BayesInfo,DynareResults);
|
[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;
|
fval=fval1;
|
||||||
x0=x01;
|
x0=x01;
|
||||||
end
|
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
|
if length(find(ig))<nx
|
||||||
ggx=ggx*0;
|
ggx=ggx*0;
|
||||||
ggx(find(ig))=gg(find(ig));
|
ggx(find(ig))=gg(find(ig));
|
||||||
|
@ -139,7 +139,7 @@ while norm(gg)>gtol && check==0 && jit<nit
|
||||||
nig=[nig ig];
|
nig=[nig ig];
|
||||||
disp('Sequence of univariate steps!!')
|
disp('Sequence of univariate steps!!')
|
||||||
fval=fvala;
|
fval=fvala;
|
||||||
end
|
% end
|
||||||
if (fval0(icount)-fval)<ftol && flagit==0
|
if (fval0(icount)-fval)<ftol && flagit==0
|
||||||
disp('Try diagonal Hessian')
|
disp('Try diagonal Hessian')
|
||||||
ihh=diag(1./(diag(hhg)));
|
ihh=diag(1./(diag(hhg)));
|
||||||
|
|
Loading…
Reference in New Issue