Commit e45bf380 authored by michel's avatar michel
Browse files

4.1: modified csminwel.m to make sure to choose always the lowest point, even...

4.1: modified csminwel.m to make sure to choose always the lowest point, even if it was reached before the last traversing

git-svn-id: https://www.dynare.org/svn/dynare/trunk@2582 ac1d8469-bf42-47a9-8791-bf33cf982152
parent eb2544b2
......@@ -217,10 +217,10 @@ while ~done
f2=f;f3=f;f1=f;retcode2=retcode1;retcode3=retcode1;
end
%how to pick gh and xh
if f3 < f - crit & badg3==0
if f3 < f - crit & badg3==0 & f3 < f2 & f3 < f1
ih=3;
fh=f3;xh=x3;gh=g3;badgh=badg3;retcodeh=retcode3;
elseif f2 < f - crit & badg2==0
elseif f2 < f - crit & badg2==0 & f2 < f1
ih=2;
fh=f2;xh=x2;gh=g2;badgh=badg2;retcodeh=retcode2;
elseif f1 < f - crit & badg1==0
......
Supports Markdown
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