Page 1 of 1

how to predict with only one shock?

PostPosted: Fri Apr 01, 2016 10:50 am
by fuyangzhao
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?

Re: how to predict with only one shock?

PostPosted: Fri Apr 01, 2016 3:22 pm
by jpfeifer
It seems you are looking for the
Code: Select all
shock_decomposition

command.

Re: how to predict with only one shock?

PostPosted: Sat Apr 02, 2016 2:45 am
by fuyangzhao
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?

Re: how to predict with only one shock?

PostPosted: Sat Apr 02, 2016 7:25 am
by jpfeifer
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.

Re: how to predict with only one shock?

PostPosted: Sat Apr 02, 2016 3:00 pm
by fuyangzhao
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!

Re: how to predict with only one shock?

PostPosted: Sat Apr 02, 2016 3:23 pm
by jpfeifer
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.

Re: how to predict with only one shock?

PostPosted: Tue Apr 05, 2016 1:54 am
by fuyangzhao
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