56
CHAPTER 6. VAR AND ERROR CORRECTION MODELS
248
another model that excludes this deterministic variable.
As a nal example, consider an experiment where we wish to examine
the impact of using dierent numbers of error correction variables on the
forecast accuracy of the EC model. Shoesmith (1995) suggests that one
should employ the number of error correction variables associated with the
Johansen likelihood ratio statistics, but he provides only limited evidence
regarding this contention.
The experiment uses time-series on national monthly employment from
12 manufacturingindustries coveringthe period1947,1to 1996,12. Forecasts
are carried out over the period from 1970,1 to 1995,12 using the number
of error correction terms suggested by the Johansen likelihood ratio trace
statistics, as well as models based on +/-1 and +/-2 error correction terms
relative to the value suggested by the trace statistic.
We then compare the relative forecast accuracy of these models by exam-
ining the ratio of the MAPE forecast error from the models with +/-1 and
+/-2 terms to the errors from the model based on r relationships suggested
by the trace statistic.
Here is the program code:
% ----- Example 6.13 comparison of forecast accuracy as a function of
%
the # of co-integrating vectors used
load level.mat;
% 20 industries national employment
y = level(:,1:12);
% use only 12 industries
[nobs neqs] = size(y);
dates = cal(1947,1,12);
begf = ical(1970,1,dates); % beginning forecast date
endf = ical(1995,12,dates); % ending forecast date
nfor = 12;
% forecast horizon
nlag = 10; cnt = 1;
% nlag based on lrratio() results
for i=begf:endf;
jres = johansen(y,0,nlag); trstat = jres.lr1; tsignf = jres.cvt;
r = 0;
for j=1:neqs; % find r indicated by trace statistic
if trstat(j,1) > tsignf(j,2), r = j; end;
end;
% set up r-1,r-2 and r+1,r+2 forecasts in addition to forecasts based on r
if (r >= 3 & r <=10)
frm2 = ecmf(y,nlag,nfor,i,r-2); frm1 = ecmf(y,nlag,nfor,i,r-1);
fr
= ecmf(y,nlag,nfor,i,r);
frp1 = ecmf(y,nlag,nfor,i,r+1);
frp2 = ecmf(y,nlag,nfor,i,r+2); act = y(i:i+nfor-1,1:12);
% compute forecast MAPE
err(cnt).rm2 = abs((act-frm2)./act); err(cnt).rm1 = abs((act-frm1)./act);
err(cnt).r
= abs((act-fr)./act);
err(cnt).rp1 = abs((act-frp1)./act);
err(cnt).rp2 = abs((act-frp2)./act); cnt = cnt+1;
else
fprintf(1,'time %d had %d co-integrating relations \n',i,r);