Fix selected_variables_only option with classical forecasts
dyn_forecast requires that the smoother has been run on all endogenous variables, leading to crashes. Now, if this option is encountered with classical forecasts, it is overridden. Also documents this in the manual.time-shift
parent
45ef721d03
commit
68b27252d7
|
@ -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}
|
||||
|
|
|
@ -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)';
|
||||
|
|
Loading…
Reference in New Issue