Skip to content
Snippets Groups Projects
Commit e403466d authored by Houtan Bastani's avatar Houtan Bastani
Browse files

Merge pull request #1030 from JohannesPfeifer/varobs_check

Condition test whether varobs was defined on existence of field
parents 988e79b5 6f8000f0
Branches
Tags
No related merge requests found
......@@ -69,14 +69,14 @@ if options_.dsge_var && options_.presample~=0
error('DSGE-VAR does not support the presample option.')
end
% Set the number of observed variables.
options_.number_of_observed_variables = length(options_.varobs);
% Test if observed variables are declared.
if ~options_.number_of_observed_variables
error('VAROBS is missing!')
if ~isfield(options_,'varobs')
error('VAROBS statement is missing!')
end
% Set the number of observed variables.
options_.number_of_observed_variables = length(options_.varobs);
% Check that each declared observed variable is also an endogenous variable.
for i = 1:options_.number_of_observed_variables
id = strmatch(options_.varobs{i}, M_.endo_names, 'exact');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment