Unverified Commit 83afdf34 authored by Stéphane Adjemian's avatar Stéphane Adjemian Committed by GitHub
Browse files

Merge pull request #32 from abuesol08/x13forecast

Fixed problems in FORECAST output (option fvr)
parents b167268c 0572c72a
......@@ -65,10 +65,18 @@ if ~all(cellfun(@isempty, struct2cell(o.forecast)))
for i=1:length(savedoutput)
if exist(sprintf('%s.%s', basename, lower(savedoutput{i})))
tmp = importdata(sprintf('%s.%s', basename, lower(savedoutput{i})));
initdate = num2str(tmp.data(1,1)); % wrong in series
t = o.y.dates;
name = strsplit(tmp.textdata{1},'\t');
name = name(2:end);
data = tmp.data(:,2:end);
o.results.(savedoutput{i}) = dseries(data, lastobservedperiod(o.y)+1, name);
if isempty(data)
disp(['x13:forecast:: Problem reading ' sprintf('%s.%s', basename, lower(savedoutput{i})) '. Output formatting may be incorrect!']);
initdate = tmp.textdata{3,1};
o.results.(savedoutput{i}) = dseries(NaN(length(tmp.data),numel(name)), dates(t.freq,str2num(initdate(1:4)),str2num(initdate(5:end))),name);
else
o.results.(savedoutput{i}) = dseries(data, dates(t.freq,str2num(initdate(1:4)),str2num(initdate(5:end))),name);
end
end
end
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment