fix bug when there are constraints both on ramsey policy instrument and on

other variables
time-shift
Michel Juillard 2017-10-08 12:39:54 +02:00
parent 211a07c739
commit b1fc34ef99
1 changed files with 8 additions and 4 deletions

View File

@ -52,6 +52,10 @@ end
etags = M.equations_tags;
for i=1:size(etags,1)
if strcmp(etags{i,2},'mcp')
eq_nbr = etags{i,1};
if ramsey_policy
eq_nbr = eq_nbr + M.ramsey_eq_nbr;
end
str = etags{i,3};
kop = strfind(etags{i,3},'<');
if ~isempty(kop)
@ -61,8 +65,8 @@ for i=1:size(etags,1)
'not recognized'],etags{i,3},strtrim(str(1:kop-1))))
end
ub(k) = str2num(str(kop+1:end));
eq_index(etags{i,1}) = k;
eq_index(k) = etags{i,1};
eq_index(eq_nbr) = k;
eq_index(k) = eq_nbr;
else
kop = strfind(etags{i,3},'>');
if ~isempty(kop)
@ -72,8 +76,8 @@ for i=1:size(etags,1)
'not recognized'],etags{i,3},strtrim(str(1:kop-1))))
end
lb(k) = str2num(str(kop+1:end));
eq_index(etags{i,1}) = k;
eq_index(k) = etags{i,1};
eq_index(eq_nbr) = k;
eq_index(k) = eq_nbr;
else
error(sprintf(['Complementarity condition %s can''t be ' ...
'parsed'],etags{i,3}))