Return paths for all the endogenous variables if fourth argument is empty.

time-shift
Stéphane Adjemian (Charybdis) 2020-04-08 17:59:23 +02:00
parent c284d9ec96
commit f8bb514632
Signed by: stepan
GPG Key ID: 295C1FE89E17EB3C
1 changed files with 9 additions and 1 deletions

View File

@ -19,7 +19,7 @@ function [deviations, baseline, irfs] = backward_model_irf(initialcondition, inn
% argument.
% - If second argument is not empty, periods must not be greater than innovationbaseline.nobs.
% Copyright (C) 2017-2018 Dynare Team
% Copyright (C) 2017-2020 Dynare Team
%
% This file is part of Dynare.
%
@ -97,6 +97,14 @@ else
end
end
% Check fourth argument. If empty return the paths for all the endogenous variables.
if isempty(listofvariables)
listofvariables = M_.endo_names;
end
if ~iscell(listofvariables)
error('Fourth input argument has to be a cell of row char arrays or an empty object.')
end
% Set default initial conditions for the innovations.
for i=1:M_.exo_nbr
if ~ismember(M_.exo_names{i}, initialcondition.name)