realtime_shock_decomposition.m: gracefully exit if nobs-option is not set

pac-components
Johannes Pfeifer 2021-12-03 09:19:59 +01:00
parent 8b3fc97631
commit 7bc15927a9
1 changed files with 4 additions and 1 deletions

View File

@ -101,7 +101,10 @@ end
% save_realtime=0;
save_realtime = options_.shock_decomp.save_realtime;
% array of time points in the range options_.presample+1:options_.nobs
if isnan(options_.nobs)
error('realtime_shock_decomposition: the nobs-option must be set.')
end
zreal = zeros(endo_nbr+length(M_.epilogue_names)*with_epilogue,nshocks+2,options_.nobs+forecast_);
zcond = zeros(endo_nbr+length(M_.epilogue_names)*with_epilogue,nshocks+2,options_.nobs);