diff --git a/matlab/dynare_estimation_init.m b/matlab/dynare_estimation_init.m index 2be5b45fde2a30c0077efb15abc1ac5d1c5effc7..f17b9937f79d8e64bee718139a055ea1c2de0414 100644 --- a/matlab/dynare_estimation_init.m +++ b/matlab/dynare_estimation_init.m @@ -688,3 +688,12 @@ if options_.occbin.smoother.status && options_.occbin.smoother.inversion_filter options_.smoothed_state_uncertainty=false; end end + +if options_.occbin.smoother.status || options_.occbin.likelihood.status + if isfield(M_,'surprise_shocks') && ~isempty(M_.surprise_shocks) + fprintf('dynare_estimation_init: OccBin smoother/filter: previous shocks(surprise) block detected. Deleting its content.\n') + options_.occbin.simul.SHOCKS=zeros(1,M_.exo_nbr); + options_.occbin.simul.exo_pos=1:M_.exo_nbr; + M_.surprise_shocks=[]; + end +end \ No newline at end of file