Allow initialization with histval block.

[skip ci]
time-shift
Stéphane Adjemia (Scylla) 2019-02-11 16:56:27 +01:00
parent 1f7d3beddc
commit e9688560f6
Signed by untrusted user who does not match committer: stepan
GPG Key ID: A6D44CB9C64CE77B
1 changed files with 9 additions and 0 deletions

View File

@ -58,6 +58,15 @@ else
transform = varargin{2};
end
% If first argument is empty, try to set the initial condition with histval.
if isempty(initialcondition)
try
initialcondition = dseries(M_.endo_histval', 1, cellstr(M_.endo_names), cellstr(M_.endo_names_tex));
catch
error('Use histval block to set the initial condition.')
end
end
% Check third argument.
if ~iscell(listofshocks)
error('Third input argument has to be a cell of string or dseries objects!')