Commit 131a68ea authored by Stéphane Adjemian's avatar Stéphane Adjemian

Provide more informations if expected shocks are declared after the terminal period.

parent 7d180e2f
...@@ -52,7 +52,16 @@ if options_.periods == 0 ...@@ -52,7 +52,16 @@ if options_.periods == 0
end end
if ~isempty(M_.det_shocks) && options_.periods<max([M_.det_shocks.periods]) if ~isempty(M_.det_shocks) && options_.periods<max([M_.det_shocks.periods])
error('PERFECT_FORESIGHT_SETUP: number of periods for the simulation is specified to be smaller than the period of the last shock') % Some expected shocks happen after the terminal period.
mess = sprintf('Problem with the declaration of the expected shocks:\n');
for i=1:length(M_.det_shocks)
if any(M_.det_shocks(i).periods>options_.periods);
mess = sprintf('%s\n At least one expected value for %s has been declared after the terminal period.', mess, deblank(M_.exo_names(M_.det_shocks(i).exo_id,:)));
error('PERFECT_FORESIGHT_SETUP: Please check the declaration of the shocks or increase the value of the periods option.')
end end
if ~options_.initval_file if ~options_.initval_file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment