Merge branch 'occbin_shock' into 'master'

occbin: fix bug if there is only a surprise shock in the first period

See merge request Dynare/dynare!1995
evaluate-with-growth-neutrality-correction
Sébastien Villemot 2022-01-14 17:32:44 +00:00
commit bab2b983c8
1 changed files with 1 additions and 1 deletions

View File

@ -56,7 +56,7 @@ if isfield(M_,'surprise_shocks') && ~isempty(M_.surprise_shocks)
ivar = M_.surprise_shocks(ii).exo_id;
temp(M_.surprise_shocks(ii).periods,ivar) = M_.surprise_shocks(ii).value;
end
shock_index=~all(temp==0);
shock_index=~all(temp==0,1);
options_.occbin.simul.SHOCKS=temp(:,shock_index);
options_.occbin.simul.exo_pos=find(shock_index);
end