Anticipated vs unanticipated shocks

Hi all,

I have a question about this linked code by Prof Pfeifer. In this example, we have one anticipated news shock and one unanticipated shock. If we were to specify two shocks where both were unanticipated (with still 8 periods in between), would this code be adapted as follows? (Q1)

z=rhoz*z(-1)+eps_z_surprise + eps_z_news;

I guess my question is: is (-8) in line 89 (in the original code) specifying the anticipated nature of the shocks? (Q2)

Relatedly, the following part of the code specifies the timing between the shocks, and it doesn’t inform us anything about anticipation bit. Is that right? (Q3)

shock_matrix(1,strmatch(‘eps_z_news’,M_.exo_names,‘exact’)) = 1;
shock_matrix(1+8,strmatch(‘eps_z_surprise’,M_.exo_names,‘exact’)) = -1;

I hope my question(s) were clear. I just have not worked with anticipated shocks before, so I am trying to understand the notation and which part of the code brings us the anticipated bit (so I can change it).

Thank you so much for your guidance in advance,
Ezgi

  1. To have an anticipated shock, you need to lag the shock. In the original code
    z=rhoz*z(-1)+eps_z_surprise + eps_z_news(-8);
    Here, eps_z_news(-8) indicates that the eps_z_news that became part of the information set at time t only affects z with a lag of 8 periods, i.e. is anticipated for 8 periods. If there were a second anticipated shock, simply have it lagged as well.
  2. The shock_matrix specifies which shock (the columns) realizes at which point in time (periods are along the rows). It has nothing to do per se with anticipation.
1 Like

Exactly. Both of my shocks are unanticipated, so I guess that means I’ll remove the (-8) only and the rest is fine. Many thanks, Johannes!

Wish you happy holidays!
Ezgi