Impulse response graph about news shocks

Dear Jpfeifer,

I use dynare to solve my model with multiple news shocks. I define news shocks consisting of a 4 period component and 8 period component as Schmitt-Grohe and Uribe (2012) and your recent paper “Fiscal news and macroeconomic volatility” in JEDC. After Bayesian estimation, I compare the relative importance of unanticipated and news shocks. Everything goes well. However, I find the impulse response graphs for news shocks seems to be odd. Some endogenous variables do not respond at the beginning until several periods later, but some endogenous variables respond to news shock at the first period.Could you tell what’s wrong with it? How to solve the problem? Here attached the graph for a 8-period news shock, and the code and data file.

Thanks in advance.
data100.xls (39.5 KB)
code.mod (11 KB)
irf_ac8.pdf (18.5 KB)

It looks as if all variables in your pdf move on impact of the news shocks, but that the impact response is just small.

Dear Jpfeifer,

Thanks for your answer. Another question: My model is a standard DSGE model with price ridigity. The intermediate goods firm operates as the C-D function with labor as the only input, the final goods firm operates as the CES function. Since I introduce news shock, I find that the impulse response to the TFP news shock is odd. Given a news shock to TFP, hours of work decrease, but output increase. Labor is the only input, and news shock does not realized eventually. How to explain this impulse response? Does it mean that there must be something wrong with my model?


If your IRF violates the production technology, there must be a mistake.

1 Like

Dear Jpfeifer,

Thanks for your comments. I have double checked the model equations and code and find nothing wrong. Could you help me check whether the way I define news shocks in the code is correct?


Anyone can help?

Could provide a clean calibrated mod-file with only the TFP news and at least some variable names. I don’t even know where to look for the Cobb-Douglas function.

Moreover, if you have price rigidities, sometimes there are price dispersion or price adjustment costs that make net output fall today if firms react to news shocks. Could this mechanism be at play (I don’t know your model)

Dear Jpfeifer,

Thanks for your answer. The wholesale firm only operates according to a C-D function with only labor input and technology, thus shown in my code as : y_c = a_c + n_c after log-linearization. The retail firm operates according to a CES function. Could you explain the mechanism about news shock? I indeed have price rigidity in my model, but I don’t allow for price adjustment cost.

Thanks a lot!

When I plot to the IRFS of y_c, n_c, and a_c to epsa_c8, output exactly increases by as much as labor. Thus, everything is correct.

Dear Jpfeifer,

Thanks for your help. My model include the durable goods sector and non-durable goods sector. Both sectors shares the same production structure. y_c means the non-durable and y_d means the durable. However, the IFR generated by dynare shows that y_c increase but n_c decrease. And, the aggregate y increase while the aggregate labor n1 decrease. How did you plot the IRF? Here attached my IRF for all the variables. I know this may take you a bit more time, thanks a lot! This is my Ph.D thesis, I really hope I can get your answer.
irf.pdf (18.8 KB)

Sorry, but I still cannot see any contradiction. During the anticipation phase, i.e. the first four periods before the news shock realizes labor n_c and y_c perfectly comove as expected. This must be the case, because exogenous technology is still unaltered. When technology finally jumps up after 4 periods when the shock realizes, labor falls. But because technology increases by more than labor falls, output can still increase. Essentially, the wealth effect kicks in: the houshold consumes more of consumption and leisure.

Dear Jpfeifer,

Thanks for your quick answer. But in my last attached IRF, y_c and n_c do not co-move. They indeed move in opposite direction. The diagram is generated by dynare. I think this is the contradiction.

Besides, are news shocks defined in my code correct? My intention is to introduce both unanticipated shock and news shock in my model, and the news shocks do not realise eventually.

Thanks a lot.

Please have a look at my JEDC paper to see the difference between the anticipation phase and the realization. Your shock is 4 periods anticipated. During the first 4 periods y_d and n_c perfectly comove (they increase by a tiny bit). After 4 periods, the anticipated shock finally realizes and a_c (or how you call it) moves. At this point, there is no reason for positive comovement of y_c and n_c, because

And yes, your news shocks are correct. You can compare them to the RBC model with news shocks on my homepage.

Dear Jpfeifer,

Thanks for your explicit explanation. Since my way of defining news shock is correct, the IRF to a_c 4 and a_c8 in my code means that they are anticipated shocks and realise eventually, right? If my understanding is right, how can I plot the IRF of news shock which does not realise eventually?

Thanks a lot.

Yes. Your shocks are defined to realize 4 or 8 periods after their announcement.

There is an example mod-file for pure news shocks on my personal homepage.

Dear Jpfeifer,

Many thanks for your help. Your answer makes me know that it’s not my model’s problem, which I have worried about several days. As for the unanticipated shocks, the IRF should be the graph of IRF to a_c directly generated by dynare in my code, right?


Dear Jpfeifer,

Many thanks for your instant help. Since I am not good at Matlab programming, I am a bit confused about the code in the replication file from your homepage.

[code]/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 colums

// set shocks for pure news
shock_matrix(1,strmatch(‘eps_z_news’,M_.exo_names,‘exact’)) = 1; %set news shock to 1 (use any shock size you want)
shock_matrix(1+8,strmatch(‘eps_z_surprise’,M_.exo_names,‘exact’)) = -1; %8 periods later use counteracting shock of -1

y2 = simult_(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

// manually select variables for figure
plot(y_IRF(strmatch(‘y’,M_.endo_names,‘exact’),:)); % use strmatch to select values

// Automatically loop over variables for figure (may require different setting for subplots in larger models)
for ii=1:M_.orig_endo_nbr
if max(abs(y_IRF(ii,:)))>1e-12 %get rid of numerical inaccuracies
I think I need to modify some code to apply my model. How can I draw the IRF of the unrealized news shock to y,n,p_dc,c in my model? Besides, as your JEDC paper, I introduce both 4 period and 8 period news components, how can I set pure news? Moreover, I just generate Bayesian estimated IRF in my code, but it seems that your code file generates simulated IRF. Is it possible to generate Bayesian estimated IRF of unrealized shocks?

At the current stage, generating pure news shocks Bayesian IRFs in estimation is not easily possible. You need to rely on simulation. Regarding my code, I think it is well-documented and you need to put more effort into understanding it. If you have specific questions, I am happy to answer them.