Impulse response figures not show up


I have a simple NK model: sticky wage and price, only labor in production, and standard utility function. The only one unusual feature is that the volatility of TFP shock is time varying. I solve the model use second order approximation. I have a problem that the figure for impulse response not coming up even I specify stoch_simul(order=2,irf=40).

I think the problem may be related with the time varying volatility, because when I use only constant volatiliy, there is no problem, but I am not sure how this is related. Please help me explain. Thanks.

Anyone knows what the variables oo_.dr.gx, oo_.dr.Gy, and oo_.dr.fuu are? I checked dynare mannul, no explaination for those variables. Is this related with the above problems?

They are intermediate results used in computations about which you should not bother. If the IRFs do not show, try using pruning.

Thanks for the clearification. Two more questions:

  1. Why there are less state variables displayed in the window than in oo_.dr.npred.
  2. What’s the real variables that correspond to those AUX_ENDO_LAG or AUX_ENDO_LEAD variables
  1. Which window? If you are referring to IRFs: Dynare omitts any variable from IRFs that does not move in response to a shock. For example, TFP won’t move for a preference shock and will not be displayed.
  2. See

Thanks, jpfeifer.

I went through the link you provided for question2. Its clear that Aux var for endogenous with lag >= 2, I can find the index of the original endogenous variable in M_.aux_vars(i).orig_index . But how about Aux var for endogenous with lead >= 2? The M_.aux_vars(i).orig_index is empty!! Where can I find the the index of the original endogenous variable?

Could you provide me with the mod-file and tell me where the issue is?

Thanks, jpfeifer. The problem solved I guess. One more question, when I have time-varying volatility for TFP, I need to solve the model using third order approximation, right?

Yes. See e.g. Appendix B.4 to Born/Pfeifer (2013) for a detailed explanation why.

Hi jpfeifer, your online appendix is much complicated. Could you give me a rought idea why 3rd order needed?

I meant B5. As it says

[quote]As is well known, a first-order approximation exhibits certainty equivalence. …] For a second-order approximation, it is well known from Schmitt-Grohé and Uribe (2004) for the homoscedastic case that uncertainty only enters the policy function through a constant term …]. Only in the third-order approximation do the volatility shocks enter the policy function
separately from the level shocks in a non-constant form. [/quote]

Thanks jpfeifer,
(i)if I have time-varying volatility, but the volatility itself is not a stochastich process, it is determined by some predetermined variable in the model. Do I still need 3rd order approximation?
(ii) In case I need to do 3rd order approximation, dynare don’t have impulse response output, right? Do I have to simulate the impulse response function with my own matlab code?

(iii) when I trying to do the simulation using my own matlab code, all variables go to infinite and explode, the results is NaN for all the elements after certain periods. Do you know why this happened?

This is the main part of the code for 2nd order approximation:
[T,dim] = size(a);
All_Var = zeros(73,T);

Exo_Var = [a,z,u,conf,ddl];

for i = 2:T
tempLState = All_Var(25:57,i-1);
tempExo = Exo_Var(i,:)’;
tempLStateLState = kron(tempLState-SS_S,tempLState-SS_S);
tempExoExo = kron(tempExo,tempExo);
tempLStateExo = kron(tempLState-SS_S,tempExo);
All_Var(:,i) = SS_All + 0.5Delta2 + A(tempLState-SS_S) + BtempExo + 0.5CtempLStateLState + 0.5DtempExoExo + EtempLStateExo;

i) Without knowing the model, this is impossible to tell. But you should be able to see this in the IRFs.
ii) Dynare has GIRFs at order=3. But you will need really a lot of replication (replic) and must use pruning, which is only available in the unstable version.
iii) Seems the pruning is missing

Dear Pfefier,
I am trying to obtain IRF responses for volatility shock under 3rd order approximation with standard Gali-NK Model. I have used your approach at “Risk Matters” yet i have observed random jumps in the IRF of volatility shock. I used pruning as you suggested.
Here is my ,mod file. Can you help me on the issue?
gali_nonlinear_volatility_third_order.mod (8.62 KB)

See point ii) above. Unless you use IRFs at the stochastic steady state, you need really many repetititions.