- First of all, do not loop over
stoch_simul
andresol
. You only need the latter. In particular, you are not supposed to loop over Dynare syntax, only over the calls to Matlab functions. - You need to condition on the error code returned by
resol
, i.e. the content ofinfo
. It will tell you if the BK conditions are satisfied or not. You can see all cases inprint_info.m
:
case 3
error(['Blanchard Kahn conditions are not satisfied: no stable' ...
' equilibrium'])
case 4
error(['Blanchard Kahn conditions are not satisfied:' ...
' indeterminacy'])
case 5
error(['Blanchard Kahn conditions are not satisfied:' ...
' indeterminacy due to rank failure'])
The problem you experience is that you are trying to read out a decision rule coefficient, but the model does not have a solution. So the decision rule you are trying to access does not exist.
For a code mapping the determinacy region, see