Skip to content
Snippets Groups Projects
Commit 3e00a99c authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Merge pull request #634 from JohannesPfeifer/bvar

Filter out stale or inconsistent number of observations in bvar
parents 8b90ca5d 2a791e51
No related branches found
No related tags found
No related merge requests found
...@@ -65,6 +65,11 @@ global options_ ...@@ -65,6 +65,11 @@ global options_
dataset = read_variables(options_.datafile, options_.varobs, [], options_.xls_sheet, options_.xls_range); dataset = read_variables(options_.datafile, options_.varobs, [], options_.xls_sheet, options_.xls_range);
options_ = set_default_option(options_, 'nobs', size(dataset,1)-options_.first_obs+1); options_ = set_default_option(options_, 'nobs', size(dataset,1)-options_.first_obs+1);
if (options_.first_obs+options_.nobs-1)> size(dataset,1)
fprintf('Incorrect or missing specification of the number of observations. nobs can be at most %4u\n',size(dataset,1)-options_.first_obs+1);
error('Inconsistent number of observations.')
end
% Parameters for prior % Parameters for prior
if options_.first_obs + options_.presample <= nlags if options_.first_obs + options_.presample <= nlags
error('first_obs+presample should be > nlags (for initializing the VAR)') error('first_obs+presample should be > nlags (for initializing the VAR)')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment