Impulse response figures not show up

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Impulse response figures not show up

Postby maxzhao » Thu Oct 17, 2013 3:50 pm

Hi,

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.
maxzhao
 
Posts: 17
Joined: Sun Sep 29, 2013 10:52 pm

Re: Impulse response figures not show up

Postby maxzhao » Fri Oct 18, 2013 2:06 am

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?
maxzhao
 
Posts: 17
Joined: Sun Sep 29, 2013 10:52 pm

Re: Impulse response figures not show up

Postby jpfeifer » Fri Oct 18, 2013 8:40 am

They are intermediate results used in computations about which you should not bother. If the IRFs do not show, try using pruning.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Impulse response figures not show up

Postby maxzhao » Fri Oct 18, 2013 3:56 pm

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
maxzhao
 
Posts: 17
Joined: Sun Sep 29, 2013 10:52 pm

Re: Impulse response figures not show up

Postby jpfeifer » Fri Oct 18, 2013 8:45 pm

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 http://www.dynare.org/DynareWiki/AuxiliaryVariables
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Impulse response figures not show up

Postby maxzhao » Sun Oct 20, 2013 2:39 am

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?
maxzhao
 
Posts: 17
Joined: Sun Sep 29, 2013 10:52 pm

Re: Impulse response figures not show up

Postby jpfeifer » Sun Oct 20, 2013 4:37 pm

Could you provide me with the mod-file and tell me where the issue is?
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Impulse response figures not show up

Postby maxzhao » Mon Oct 21, 2013 2:24 pm

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?
maxzhao
 
Posts: 17
Joined: Sun Sep 29, 2013 10:52 pm

Re: Impulse response figures not show up

Postby jpfeifer » Tue Oct 22, 2013 9:08 am

Yes. See e.g. Appendix B.4 to Born/Pfeifer (2013) http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2302490 for a detailed explanation why.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Impulse response figures not show up

Postby maxzhao » Tue Oct 22, 2013 4:04 pm

Hi jpfeifer, your online appendix is much complicated. Could you give me a rought idea why 3rd order needed?
maxzhao
 
Posts: 17
Joined: Sun Sep 29, 2013 10:52 pm

Re: Impulse response figures not show up

Postby jpfeifer » Tue Oct 22, 2013 5:11 pm

I meant B5. As it says
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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Impulse response figures not show up

Postby maxzhao » Tue Oct 22, 2013 6:38 pm

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?
maxzhao
 
Posts: 17
Joined: Sun Sep 29, 2013 10:52 pm

Re: Impulse response figures not show up

Postby maxzhao » Tue Oct 22, 2013 9:05 pm

(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.5*Delta2 + A*(tempLState-SS_S) + B*tempExo + 0.5*C*tempLStateLState + 0.5*D*tempExoExo + E*tempLStateExo;
end
maxzhao
 
Posts: 17
Joined: Sun Sep 29, 2013 10:52 pm

Re: Impulse response figures not show up

Postby jpfeifer » Sat Oct 26, 2013 9:02 am

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
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Impulse response figures not show up

Postby farukakbal » Thu Dec 08, 2016 9:29 pm

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?
Best
Attachments
gali_nonlinear_volatility_third_order.mod
Gali(2008) - Nonlinear Model with Volatility Shock
(8.62 KiB) Downloaded 87 times
farukakbal
 
Posts: 8
Joined: Sun Dec 04, 2016 5:25 pm

Next

Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 5 guests