how to predict with only one shock?

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.

how to predict with only one shock?

Postby fuyangzhao » Fri Apr 01, 2016 10:50 am

Now I know that adding
Code: Select all
smoother
in
Code: Select all
 estimation
can give us the smoothed predictions of endogenous variables and shocks. However, I only want to turn on one shock and shut down the others to see how this shock can explain the variance. Is that feasible?
fuyangzhao
 
Posts: 48
Joined: Thu Dec 10, 2015 1:20 pm

Re: how to predict with only one shock?

Postby jpfeifer » Fri Apr 01, 2016 3:22 pm

It seems you are looking for the
Code: Select all
shock_decomposition

command.
------------
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: how to predict with only one shock?

Postby fuyangzhao » Sat Apr 02, 2016 2:45 am

jpfeifer wrote:It seems you are looking for the
Code: Select all
shock_decomposition

command.

Sorry that I didn't precisely convey my question. I mean how to draw the following graph
aaa.jpg.pdf
(232.03 KiB) Downloaded 88 times
? Specifically, how are the red and green lines drawn?
fuyangzhao
 
Posts: 48
Joined: Thu Dec 10, 2015 1:20 pm

Re: how to predict with only one shock?

Postby jpfeifer » Sat Apr 02, 2016 7:25 am

Run
Code: Select all
shock_decomposition

and read out the respective contribution of particular shock in
Code: Select all
oo_.shock_decomposition
and plot it along with the variable itself. Dynare does not do this automatically.
------------
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: how to predict with only one shock?

Postby fuyangzhao » Sat Apr 02, 2016 3:00 pm

jpfeifer wrote:Run
Code: Select all
shock_decomposition

and read out the respective contribution of particular shock in
Code: Select all
oo_.shock_decomposition
and plot it along with the variable itself. Dynare does not do this automatically.

Many thanks, Prof!

I got a three dimensional array, in which the 1st dim is endogeneous variable, the 2nd dim is shocks, and the 3rd is time. However, I cannot understand inside order of the 1st dim and the 2nd dim.

I wrote
Code: Select all
shock_decomposition LogL, Ql, I, B, C, Y, N;

But the length of the 1st dimension is 35 instead of 7 (there are 35 endo vars in my model). Is the order of endo vars inside the 1st dim is what I declared? The length of the 2nd dimension is 10, but there are only 8 shocks in my model (if one is the prediction with all shocks, what is the rest?).

Sorry for all the bother...and thanks again!
fuyangzhao
 
Posts: 48
Joined: Thu Dec 10, 2015 1:20 pm

Re: how to predict with only one shock?

Postby jpfeifer » Sat Apr 02, 2016 3:23 pm

From the function header:

% function z = shock_decomposition(M_,oo_,options_,varlist)
% Computes shocks contribution to a simulated trajectory. The field set is
% oo_.shock_decomposition. It is a n_var by nshock+2 by nperiods array. The
% first nshock columns store the respective shock contributions, column n+1
% stores the role of the initial conditions, while column n+2 stores the
% value of the smoothed variables. Both the variables and shocks are stored
% in the order of declaration, i.e. M_.endo_names and M_.exo_names, respectively.
------------
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: how to predict with only one shock?

Postby fuyangzhao » Tue Apr 05, 2016 1:54 am

jpfeifer wrote:From the function header:

% function z = shock_decomposition(M_,oo_,options_,varlist)
% Computes shocks contribution to a simulated trajectory. The field set is
% oo_.shock_decomposition. It is a n_var by nshock+2 by nperiods array. The
% first nshock columns store the respective shock contributions, column n+1
% stores the role of the initial conditions, while column n+2 stores the
% value of the smoothed variables. Both the variables and shocks are stored
% in the order of declaration, i.e. M_.endo_names and M_.exo_names, respectively.


thank you Prof.jpfeifer
fuyangzhao
 
Posts: 48
Joined: Thu Dec 10, 2015 1:20 pm


Return to Dynare help

Who is online

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