diff --git a/doc/dynare.texi b/doc/dynare.texi index b2ab3e7c4..691580797 100644 --- a/doc/dynare.texi +++ b/doc/dynare.texi @@ -5184,8 +5184,9 @@ any value of @math{\bar a} of @math{a} is a deterministic steady state for pro Note that the nonstationary variables in the model must be integrated processes (their first difference or k-difference must be stationary). @item selected_variables_only +@anchor{selected_variables_only} Only run the smoother on the variables listed just after the -@code{estimation} command. Default: run the smoother on all the +@code{estimation} command. This options is incompatible with requesting classical frequentist forecasts and will be overridden in this case. Default: run the smoother on all the declared endogenous variables. @item cova_compute = @var{INTEGER} diff --git a/matlab/dynare_estimation_init.m b/matlab/dynare_estimation_init.m index 99534d9f9..7c297dc0e 100644 --- a/matlab/dynare_estimation_init.m +++ b/matlab/dynare_estimation_init.m @@ -384,9 +384,15 @@ oo_.dr.restrict_columns = [ic; length(k2)+(1:nspred-npred)']; k3 = []; k3p = []; if options_.selected_variables_only - for i=1:size(var_list_,1) - k3 = [k3; strmatch(var_list_(i,:),M_.endo_names(dr.order_var,:), 'exact')]; - k3p = [k3; strmatch(var_list_(i,:),M_.endo_names, 'exact')]; + if options_.forecast > 0 && options_.mh_replic == 0 && ~options_.load_mh_file + fprintf('\nEstimation: The selected_variables_only option is incompatible with classical forecasts. It will be ignored.\n') + k3 = (1:M_.endo_nbr)'; + k3p = (1:M_.endo_nbr)'; + else + for i=1:size(var_list_,1) + k3 = [k3; strmatch(var_list_(i,:),M_.endo_names(dr.order_var,:), 'exact')]; + k3p = [k3; strmatch(var_list_(i,:),M_.endo_names, 'exact')]; + end end else k3 = (1:M_.endo_nbr)';