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

Change disp() to errors in var_sample_moments.m

Otherwise, the data moments that are required for estimating DSGE-VARs are set to an empty matrix instead of aborting. This will then lead to a cryptic crash in initial_estimation_checks.m due to matrix dimensions not agreeing.
parent b3bcf37c
Branches
Tags
No related merge requests found
......@@ -78,7 +78,7 @@ XtX = [];
data = read_variables(datafile,varobs,[],xls_sheet,xls_range);
if qlag > FirstObservation
disp('VarSampleMoments :: not enough data to initialize! Try to increase FirstObservation.')
error('VarSampleMoments :: not enough data to initialize! Try to increase FirstObservation.')
return
end
......@@ -93,7 +93,7 @@ elseif var_trend_order == 1;% Constant and linear trend case.
X = ones(NumberOfObservations,NumberOfVariables*qlag+2);
indx = NumberOfVariables*qlag+1:NumberOfVariables*qlag+2;
else
disp('var_sample_moments :: trend must be equal to -1,0 or 1!')
error('var_sample_moments :: trend must be equal to -1,0 or 1!')
return
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment