Add warning for variance decomposition at order=2

At order=2, the variance decomposition is still based on order=1. This
commit introduces a warning. See issue #278
(https://github.com/DynareTeam/dynare/issues/278). This information that
the variance decomposition is only triggered at periods=0 has been added
to the manual.
time-shift
Johannes Pfeifer 2013-03-17 23:36:43 +01:00
parent a090a7c35e
commit 98ec0095df
4 changed files with 16 additions and 4 deletions

View File

@ -3161,7 +3161,7 @@ period(s). The periods must be strictly positive. Conditional variances are give
decomposition provides the decomposition of the effects of shocks upon
impact. The results are stored in
@code{oo_.conditional_variance_decomposition}
(@pxref{oo_.conditional_variance_decomposition}).
(@pxref{oo_.conditional_variance_decomposition}). The variance decomposition is only conducted, if theoretical moments are requested, i.e. using the @code{periods=0}-option. Currently, variance decompositions are only implemented for @code{order=1}. In case of @code{order=2}, Dynare will thus not display the variance decomposition based on a second order approximation, but on a first order approximation.
@item pruning
Discard higher order terms when iteratively computing simulations of
@ -4230,7 +4230,7 @@ period 1, the conditional variance decomposition provides the
decomposition of the effects of shocks upon impact. The results are
stored in
@code{oo_.PosteriorTheoreticalMoments.dsge.ConditionalVarianceDecomposition},
but currently there is not output. Note that this option requires the
but currently there is no output. Note that this option requires the
option @code{moments_varendo} to be specified.
@item filtered_vars

View File

@ -61,7 +61,11 @@ if ~options_.noprint %options_.nomoments == 0
dyntable(title,headers,labels,z,lh,11,4);
if M_.exo_nbr > 1 && size(stationary_vars, 1) > 0
disp(' ')
title='VARIANCE DECOMPOSITION (in percent)';
if options_.order == 2
title='VARIANCE DECOMPOSITION (in percent), based on first order approximation';
else
title='VARIANCE DECOMPOSITION (in percent)';
end
if options_.hp_filter
title = [title ' (HP filter, lambda = ' ...
num2str(options_.hp_filter) ')'];

View File

@ -49,8 +49,13 @@ StateSpaceModel.order_var = dr.order_var;
conditional_decomposition_array = conditional_variance_decomposition(StateSpaceModel,Steps,SubsetOfVariables );
if options_.noprint == 0
disp(' ')
if options_.order == 2
disp(' ')
disp('CONDITIONAL VARIANCE DECOMPOSITION (in percent), based on first order approximation')
else
disp(' ')
disp('CONDITIONAL VARIANCE DECOMPOSITION (in percent)')
end
end
vardec_i = zeros(length(SubsetOfVariables),exo_nbr);

View File

@ -142,6 +142,9 @@ if options_.nomoments == 0
elseif options_.periods == 0
% There is no code for theoretical moments at 3rd order
if options_.order <= 2
if options_.order == 2
warning('You have requested a second order approximation, but variance decompositions currently only allow for first order. Displaying decompositions at order=1 instead.')
end
disp_th_moments(oo_.dr,var_list);
end
else