Skip to content
Snippets Groups Projects
Commit 7877f195 authored by Johannes Pfeifer's avatar Johannes Pfeifer Committed by Sébastien Villemot
Browse files

Fix bug in DSGE-VAR. Initialization sample must be strictly larger than lag order

Also provides a more informative error message
parent 4560a1b7
Branches
Tags
No related merge requests found
......@@ -77,8 +77,10 @@ XtX = [];
data = read_variables(datafile,varobs,[],xls_sheet,xls_range);
if qlag > FirstObservation
disp('VarSampleMoments :: not enough data to initialize! Try to increase FirstObservation.')
if qlag >= FirstObservation
fprintf('\nVarSampleMoments: The first used observation is %d, but there are %d lags.\n',FirstObservation,qlag)
fprintf('VarSampleMoments: Try to increase first_obs. Given the lags, it must be at least first_obs=%d.\n',qlag+1)
error('VarSampleMoments :: not enough data to initialize!')
return
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment