diff --git a/matlab/partial_information/PI_gensys.m b/matlab/partial_information/PI_gensys.m index b1144cf0e..c392cc659 100644 --- a/matlab/partial_information/PI_gensys.m +++ b/matlab/partial_information/PI_gensys.m @@ -90,7 +90,7 @@ try end warning('on','MATLAB:singularMatrix'); warning('on','MATLAB:nearlySingularMatrix'); - if (isinf(UAVinv) || isnan(UAVinv)) + if (any(any(isinf(UAVinv))) || any(any(isnan(UAVinv)))) if(options_.useACES==1) disp('ERROR! saving PI_gensys_data_dump'); save PI_gensys_data_dump @@ -102,7 +102,9 @@ try end end catch - [errmsg, errcode]=lasterror; + lerror = lasterror; + errmsg = lerror.message; + disp(errmsg) warning(['error callig PI_gensys_singularC: ' errmsg ],'errcode'); error('errcode',['error callig PI_gensys_singularC: ' errmsg ]); end diff --git a/matlab/partial_information/dr1_PI.m b/matlab/partial_information/dr1_PI.m index afc9b0605..b90112dce 100644 --- a/matlab/partial_information/dr1_PI.m +++ b/matlab/partial_information/dr1_PI.m @@ -353,7 +353,7 @@ end % end if useAIM and... end % reuse some of the bypassed code and tests that may be needed - if eu ~=[1; 1] && options_.ACES_solver==0 + if (eu(1) ~= 1 || eu(2) ~= 1) && options_.ACES_solver==0 info(1) = abs(eu(1)+eu(2)); info(2) = 1.0e+8; % return @@ -448,9 +448,8 @@ end % end if useAIM and... disp('Problem with using Part Info ACES solver:'); error(lerror.message); else - disp('Problem with using Part Info solver - Using Dynare solver instead'); - disp (lerror.message); - options_.partial_information = 0; % and then try mjdgges instead + disp('Problem with using Part Info solver'); + error(lerror.message); end end