pooled_ols: fix dates

time-shift
Houtan Bastani 2019-01-14 15:22:02 +01:00
parent efe0a15e0e
commit 72081e640e
No known key found for this signature in database
GPG Key ID: 000094FB955BE169
1 changed files with 8 additions and 2 deletions

View File

@ -66,7 +66,6 @@ else
assert(islogical(overlapping_dates) && length(overlapping_dates) == 1, 'The fourth argument must be a bool');
end
%% Get Equation(s)
[ast, jsonmodel] = get_ast_jsonmodel(eqtags);
neqs = length(jsonmodel);
@ -88,10 +87,17 @@ end
[Y, ~, X] = common_parsing(ds, ast, jsonmodel, overlapping_dates);
clear ast jsonmodel;
nobs = Y{1}.nobs;
fp = Y{1}.firstobservedperiod;
for i = 2:length(Y)
if Y{i}.firstobservedperiod < fp
fp = Y{i}.firstobservedperiod;
end
nobs = nobs + Y{i}.nobs;
end
[Y, X] = put_in_sur_form(Y, X);
%% Save
oo_.(save_structure_name).sample_range = X.firstdate:X.firstdate+nobs;
oo_.(save_structure_name).sample_range = fp:fp+nobs;
%oo_.(save_structure_name).residnames = residnames;
oo_.(save_structure_name).Y = Y.data;
oo_.(save_structure_name).X = X.data;