 # Mixing anticipated and no anticipated shocks

I have a question, I would like to make a simulation where for 8 consecutive periods a shock is not anticipated, but after 8 periods, the shock must become anticipated, and assume an already anticipated value, from there up to 40 periods.

I understand, that in this post they explain something similar,

If this post is correct, or similar to what I want to do, then should I enter 8 consecutive shocks this way?

//initialize IRF generation

initial_condition_states = repmat(oo_.dr.ys,1,M_.maximum_lag);

shock_matrix = zeros(options_.irf,M_.exo_nbr); %create shock matrix with number of time periods in columns

// set shocks for anticipated shocks

shock_matrix(1,strmatch(‘ERR_P_S’,M_.exo_names,‘exact’)) = -.05;
shock_matrix(2,strmatch(‘ERR_P_S’,M_.exo_names,‘exact’)) = -.05; shock_matrix(3,strmatch(‘ERR_P_S’,M_.exo_names,‘exact’)) = -.05;
shock_matrix(4,strmatch(‘ERR_P_S’,M_.exo_names,‘exact’)) = -.05;
shock_matrix(5,strmatch(‘ERR_P_S’,M_.exo_names,‘exact’)) = -.05;
shock_matrix(6,strmatch(‘ERR_P_S’,M_.exo_names,‘exact’)) = -.05;
shock_matrix(7,strmatch(‘ERR_P_S’,M_.exo_names,‘exact’)) = -.05;
shock_matrix(8,strmatch(‘ERR_P_S’,M_.exo_names,‘exact’)) = -.05;

y2 = simult_(M_,options_,initial_condition_states,oo_.dr,shock_matrix,1);
y_IRF = y2(:,M_.maximum_lag+1:end)-repmat(oo_.dr.ys,1,options_.irf); %deviation from steady state

After that, how do I introduce or indicate that the shock from there on should be anticipated?

From what I can see, the specification for the surprise shock is OK. If the anticipated shock is permanent, then you can simply introduce a new surprise shock process which has a unit root AR-coefficient. That way, the shock will happen as a surprise but will be known to be permanent.