Skip to content
Snippets Groups Projects
Commit 6f8000f0 authored by Johannes Pfeifer's avatar Johannes Pfeifer
Browse files

Condition test whether varobs was defined on existence of field

parent 988e79b5
Branches
Tags
1 merge request!1030Condition test whether varobs was defined on existence of field
......@@ -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