diff --git a/doc/dynare.texi b/doc/dynare.texi index 25d8e5c3fe00c58bcd887bddff59725ca868da95..fb49e72b7afc9197444de150fc0564da04039cf2 100644 --- a/doc/dynare.texi +++ b/doc/dynare.texi @@ -5467,6 +5467,15 @@ calibrated model. @end table +@vindex oo_.shock_decomposition +The results are stored in the field @code{oo_.shock_decomposition}, which is a three +dimensional array. The first dimension contains the endogenous variables for +which the shock decomposition has been requested. The second dimension stores +in the first @code{M_.exo_nbr} columns the contribution of the respective shocks. +Column @code{M_.exo_nbr+1} stores the contribution of the initial conditions, +while column @code{M_.exo_nbr+2} stores the smoothed value of the respective +endogenous variable. The third dimension stores the time periods. + @end deffn diff --git a/matlab/gmhmaxlik.m b/matlab/gmhmaxlik.m index d59333d4bb585811696796ff1c0a5ea0bd889c04..b5789d230b844674846e7cf78d3479a73ff98f3e 100644 --- a/matlab/gmhmaxlik.m +++ b/matlab/gmhmaxlik.m @@ -122,7 +122,7 @@ while j<=MaxNumberOfTuningSimulations end% ... otherwise I don't move. prtfrc = j/MaxNumberOfTuningSimulations; if mod(j, 10)==0 - dyn_waitbar(prtfrc,hh,sprintf('Acceptance ratios: %f [%f]',isux/j,jsux/jj)); + dyn_waitbar(prtfrc,hh,sprintf('Acceptance ratio [during last 500]: %f [%f]',isux/j,jsux/jj)); end if j/500 == round(j/500) test1 = jsux/jj; @@ -215,7 +215,7 @@ if strcmpi(info,'LastCall') end% ... otherwise I don't move. prtfrc = j/MaxNumberOfTuningSimulations; if mod(j, 10)==0 - dyn_waitbar(prtfrc,hh,sprintf('Acceptance rates: %f [%f]',isux/j,jsux/jj)); + dyn_waitbar(prtfrc,hh,sprintf('Acceptance ratio [during last 1000]: %f [%f]',isux/j,jsux/jj)); end if j/1000 == round(j/1000) test1 = jsux/jj; diff --git a/matlab/shock_decomposition.m b/matlab/shock_decomposition.m index 34a3b4acf06d7b3847f3dab0772ed03020879cca..bdfed236e41ab4035f85f0c6402816aa8e547c38 100644 --- a/matlab/shock_decomposition.m +++ b/matlab/shock_decomposition.m @@ -1,6 +1,10 @@ function oo_ = shock_decomposition(M_,oo_,options_,varlist) % function z = shock_decomposition(M_,oo_,options_,varlist) -% Computes shocks contribution to a simulated trajectory +% 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. % % INPUTS % M_: [structure] Definition of the model @@ -72,10 +76,11 @@ A = dr.ghx; B = dr.ghu; % initialization +gend = eval(['size(oo.SmoothedShocks.' M_.exo_names(1,:),',1)']); +epsilon=NaN(nshocks,gend); for i=1:nshocks epsilon(i,:) = eval(['oo.SmoothedShocks.' M_.exo_names(i,:)]); end -gend = size(epsilon,2); z = zeros(endo_nbr,nshocks+2,gend); for i=1:endo_nbr