Matlab implementation of the consider_all_endogenous_and_auxiliary option

trust-region-mex
Johannes Pfeifer 2021-07-22 12:22:53 +02:00
parent a04c348d73
commit 3fb41e075f
4 changed files with 19 additions and 5 deletions

View File

@ -4956,7 +4956,8 @@ block decomposition of the model (see :opt:`block`).
computed on the variables listed after the ``estimation``
command. Alternatively, one can choose to compute these quantities
on all endogenous or on all observed variables (see
``consider_all_endogenous`` and ``consider_only_observed`` options
``consider_all_endogenous``, ``consider_all_endogenous_and_auxiliary``,
and ``consider_only_observed`` options
below). If no variable is listed after the estimation command,
then Dynare will interactively ask which variable set to use.
@ -6756,6 +6757,14 @@ block decomposition of the model (see :opt:`block`).
endogenous variables. This is equivalent to manually listing
all the endogenous variables after the ``estimation`` command.
.. option:: consider_all_endogenous_and_auxiliary
Compute the posterior moments, smoothed variables, k-step ahead
filtered variables and forecasts (when requested) on all the
endogenous variables and the auxiliary variables introduced by the
preprocessor. This option is useful when e.g. running ``smoother2histval``
on the results of the Kalman smoother.
.. option:: consider_only_observed
Compute the posterior moments, smoothed variables, k-step ahead

View File

@ -59,10 +59,12 @@ if options_.dsge_var && options_.bayesian_irf
end
if ~isempty(varlist) && ~isempty(options_.endo_vars_for_moment_computations_in_estimation)
error('You cannot use the consider_all_endogenous or consider_all_observed options when listing variables after the estimation command')
error('You cannot use the consider_all_endogenous, consider_all_endogenous_and_auxiliary or consider_all_observed options when listing variables after the estimation command')
elseif isempty(varlist) && ~isempty(options_.endo_vars_for_moment_computations_in_estimation)
if strcmp(options_.endo_vars_for_moment_computations_in_estimation,'all_endogenous_variables')
varlist = M_.endo_names(1:M_.orig_endo_nbr);
elseif strcmp(options_.endo_vars_for_moment_computations_in_estimation,'all_endogenous_and_auxiliary_variables')
varlist = M_.endo_names;
elseif strcmp(options_.endo_vars_for_moment_computations_in_estimation,'only_observed_variables')
varlist = options_.varobs;
else
@ -119,6 +121,7 @@ elseif isempty(varlist) && isempty(options_.endo_vars_for_moment_computations_in
disp(' [1] Consider all the endogenous variables.')
disp(' [2] Consider all the observed endogenous variables.')
disp(' [3] Stop Dynare and change the mod file.')
disp(' [4] Consider all the endogenous and auxiliary variables.')
skipline()
choice = input('options [default is 1] = ');
if isempty(choice)
@ -130,9 +133,11 @@ elseif isempty(varlist) && isempty(options_.endo_vars_for_moment_computations_in
varlist = options_.varobs;
elseif choice==3
varlist = cell(0);
elseif choice==4
varlist = M_.endo_names;
else
skipline()
disp('YOU HAVE TO ANSWER 1, 2 or 3!')
disp('YOU HAVE TO ANSWER 1, 2, 3 or 4!')
skipline()
end
end

@ -1 +1 @@
Subproject commit e1f7d8c73556398a774ab55c8dc578c79ebb6c3b
Subproject commit 5da01faa743f8ca27055bc8389c54ec4ba9f5c41

View File

@ -82,6 +82,6 @@ varobs gp_obs gy_obs;
options_.solve_tolf = 1e-12;
estimation(order=1,datafile=fsdat_simul,mh_replic=1500,mh_nblocks=1,mh_jscale=0.8,smoother,consider_all_endogenous);
estimation(order=1,datafile=fsdat_simul,mh_replic=1500,mh_nblocks=1,mh_jscale=0.8,smoother,consider_all_endogenous_and_auxiliary);
smoother2histval(period = 5, outfile = 'fs2000_histval.mat');