The Box-Jenkins Practical

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

The Box-Jenkins approach in Eviews

The file ARIMA.wf1 contains quarterly data observations for the consumer price index (cpi) and gross
domestic product (gdp) of the UK economy. We shall try to identify the underlying ARMA model for
the gdp variable.

Step 1: As a first step we need to calculate the ACF and PACF of the raw data. To do this we need to
double-click on the gdp variable to open the variable in a new Eviews window. We can then calculate
the ACF and PACF and view their respective graphs by clicking on View/Correlogram in the window
that contains the gdp variable. This will give us Figure 13.3.

Figure 13.3: ACF and PACF of gdp

Date: 04/04/22 Time: 12:06


Sample: 1980Q3 1998Q2
Included observations: 72

Autocorrelation Partial Correlation AC   PAC  Q-Stat  Prob

      . |*******       . |******* 1 0.958 0.958 68.932 0.000


      . |*******       .*| . | 2 0.913 -0.067 132.39 0.000
      . |******|       . | . | 3 0.865 -0.050 190.23 0.000
      . |******|       . | . | 4 0.817 -0.030 242.57 0.000
      . |******|       . | . | 5 0.770 -0.013 289.73 0.000
      . |***** |       . | . | 6 0.723 -0.032 331.88 0.000
      . |***** |       . | . | 7 0.675 -0.024 369.26 0.000
      . |***** |       . | . | 8 0.629 -0.022 402.15 0.000
      . |**** |       . | . | 9 0.582 -0.030 430.77 0.000
      . |**** |       . | . | 10 0.534 -0.035 455.31 0.000
      . |**** |       . | . | 11 0.490 0.009 476.31 0.000
      . |*** |       . | . | 12 0.446 -0.033 494.00 0.000
      . |*** |       . | . | 13 0.403 -0.017 508.69 0.000
      . |*** |       . | . | 14 0.362 -0.016 520.72 0.000
      . |** |       . | . | 15 0.321 -0.023 530.34 0.000
      . |** |       . | . | 16 0.280 -0.033 537.81 0.000
      . |** |       . | . | 17 0.242 -0.005 543.46 0.000
      . |*. |       . | . | 18 0.206 0.007 547.65 0.000
      . |*. |       . | . | 19 0.174 0.010 550.70 0.000
      . |*. |       . | . | 20 0.146 0.008 552.88 0.000
      . |*. |       . | . | 21 0.118 -0.020 554.34 0.000
      . |*. |       . | . | 22 0.092 -0.016 555.24 0.000
      . | . |       . | . | 23 0.068 0.005 555.74 0.000
      . | . |       . | . | 24 0.046 -0.005 555.98 0.000
      . | . |       . | . | 25 0.026 -0.008 556.05 0.000
      . | . |       . | . | 26 0.006 -0.021 556.06 0.000
      . | . |       . | . | 27 -0.014 -0.032 556.08 0.000
      . | . |       . | . | 28 -0.033 -0.005 556.22 0.000
      . | . |       . | . | 29 -0.050 -0.000 556.53 0.000
      .*| . |       . | . | 30 -0.068 -0.028 557.11 0.000
      .*| . |       . | . | 31 -0.084 -0.011 558.02 0.000
      .*| . |       . | . | 32 -0.101 -0.037 559.38 0.000
From Figure 13.3 we can see that the ACF does not die down at all for all lags (see also the plot of
gdp to notice that it is clearly trended) which suggest that the series is integrated and we need to
proceed with taking logarithms and first difference of the series.

Step 2: We take logs and then first differences of the gdp series by typing the following commands
into the Eviews command line:

genr lgdp = log(gdp)

genr dlgdp = lgdp – lgdp(-1)

and then double-click on the newly created dlgdp (log-differenced series) and click again on
View/Correlogram to obtain the correlogram of the dlgdp series.

Figure 13.4: ACF and PACF of the dlgdp series


Date: 03/31/22 Time: 19:09
Sample: 1980Q3 1998Q2
Included observations: 71

Autocorrelation Partial Correlation AC PAC Q-Stat Prob

1 0.420 0.420 13.080 0.000


2 0.177 0.001 15.436 0.000
3 0.283 0.252 21.520 0.000
4 0.286 0.103 27.840 0.000
5 0.201 0.046 31.023 0.000
6 0.216 0.095 34.740 0.000
7 0.039 -0.192 34.866 0.000
8 -0.089 -0.147 35.512 0.000
9 -0.050 -0.073 35.718 0.000
10 0.006 0.015 35.721 0.000

Step 3: From step 2 above we obtain the ACF and PACF of the dlgdp series, provided in Figure 13.4.
From this correlogram we can see that there are 2 to 3 spikes on the ACF, and then all are zero
quickly. This suggests that we might have up to MA(3) and AR(1) specifications. So, the possible
models are the ARIMA(1,0,3), ARIMA(1,0,2) or ARIMA(1,0,1) models.

Step 4: We then estimate the three possible models. The command for estimating the ARMA(1,0,3)
model is:

ls dlgdp c ar(1) ma(1) ma(2) ma(3)

similarly, for ARMA(1,2) it is:

ls dlgdp c ar(1) ma(1) ma(2)

and for ARIMA(1,1,1) it is:

ls dlgdp c ar(1) ma(1)

The results are presented in Tables 13.2, 13.3 and 13.4, respectively.

Dependent Variable: DLGDP


Method: ARMA Generalized Least Squares (BFGS)
Date: 04/04/22 Time: 12:25
Sample: 1980Q4 1998Q2
Included observations: 71
Convergence achieved after 11 iterations
Coefficient covariance computed using outer product of gradients
d.f. adjustment for standard errors & covariance

Variable Coefficient Std. Error t-Statistic Prob.  

C 0.005310 0.002298 2.310893 0.0240


AR(1) 0.846702 0.116516 7.266864 0.0000
MA(1) -0.490388 0.157481 -3.113943 0.0027
MA(2) -0.241465 0.137944 -1.750461 0.0847
MA(3) 0.276509 0.126841 2.179978 0.0328

R-squared 0.268580    Mean dependent var 0.006085


Adjusted R-squared 0.224251    S.D. dependent var 0.006622
S.E. of regression 0.005832    Akaike info criterion -7.372437
Sum squared resid 0.002245    Schwarz criterion -7.213094
Log likelihood 266.7215    Hannan-Quinn criter. -7.309071
F-statistic 6.058848    Durbin-Watson stat 1.887434
Prob(F-statistic) 0.000325

Inverted AR Roots       .85


Inverted MA Roots  .55+.37i      .55-.37i        -.62

3 levels of significance – 1%; 5% and 10%

1% is strong level of significance, (0.01)***

5% , 0.05**

10% or 0.10 (weaker level)*


Table 13.3:

Dependent Variable: DLGDP


Method: ARMA Generalized Least Squares (BFGS)
Date: 04/04/22 Time: 12:28
Sample: 1980Q4 1998Q2
Included observations: 71
Convergence achieved after 13 iterations
Coefficient covariance computed using outer product of gradients
d.f. adjustment for standard errors & covariance

Variable Coefficient Std. Error t-Statistic Prob.  

C 0.005607 0.001894 2.960037 0.0042


AR(1) 0.849254 0.174789 4.858750 0.0000
MA(1) -0.358629 0.225877 -1.587715 0.1171
MA(2) -0.215635 0.170936 -1.261492 0.2115

R-squared 0.231853    Mean dependent var 0.006085


Adjusted R-squared 0.197458    S.D. dependent var 0.006622
S.E. of regression 0.005932    Akaike info criterion -7.356882
Sum squared resid 0.002358    Schwarz criterion -7.229407
Log likelihood 265.1693    Hannan-Quinn criter. -7.306189
F-statistic 6.740965    Durbin-Watson stat 2.072672
Prob(F-statistic) 0.000483

Inverted AR Roots       .85


Inverted MA Roots       .68          -.32

Table 13.4:

Dependent Variable: DLGDP


Method: ARMA Generalized Least Squares (BFGS)
Date: 04/04/22 Time: 12:29
Sample: 1980Q4 1998Q2
Included observations: 71
Convergence achieved after 16 iterations
Coefficient covariance computed using outer product of gradients
d.f. adjustment for standard errors & covariance

Variable Coefficient Std. Error t-Statistic Prob.  

C 0.005507 0.001951 2.822170 0.0062


AR(1) 0.825214 0.121831 6.773447 0.0000
MA(1) -0.494988 0.190185 -2.602674 0.0113

R-squared 0.208126    Mean dependent var 0.006085


Adjusted R-squared 0.184835    S.D. dependent var 0.006622
S.E. of regression 0.005979    Akaike info criterion -7.354643
Sum squared resid 0.002431    Schwarz criterion -7.259037
Log likelihood 264.0898    Hannan-Quinn criter. -7.316623
F-statistic 8.936104    Durbin-Watson stat 1.847828
Prob(F-statistic) 0.000358

Inverted AR Roots       .83


Inverted MA Roots       .49

Step 5: Finally, the diagnostics of the three alternative models need to be checked, to see which
model is the most appropriate. Summarized results of all three specifications are provided in Table
13.5, from which we see that in terms of the significance of estimated coefficients, the model that is
most appropriate is probably ARIMA(1,0,3). ARIMA(1,0,2) has two insignificant terms (the
coefficients of MA(1) and MA(2), but when we include MA(3), both are significant, the MA(3) term is
highly significant and the MA(2) term is significant at the 90% level. In terms of AIC and SBC , the
results are contradictory. AIC suggest model 1 whilst SBC suggest model 3. The adj-R 2 is higher for
model 3, followed by model 1. Remembering that we need a parsimonious model, there might be a
problem of overfitting here. For this we also check the Q-statistics of the correlograms of the
residuals for lags 8, 16 and 24. We see that only the ARIMA(1,0,3) model has insignificant lags for all
three cases, while the other two models have significant (for 90%) lags for the eighth and the 16 th
lag, suggesting that the residuals are serially correlated. So again, here the ARMA(1,0,3) model
seems to be the most appropriate. So evidence here suggests that the ARIMA(1,0,3) model is
probably the most appropriate one. We will therefore proceed with forecasting using this model.

Degrees of freedom = n - k

72 – 4 72 – 3 72 - 2

Table 13.5 Summary results of alternative ARIMA(p,d,q) models


ARIMA(1,0,3) ARIMA(1,0,2) ARIMA(1,0,1)
Degrees of freedom 68 69 70
SSR 0.002245 0.002358 0.002431
Φ(t-statistic in parentheses) 0.85(7.266)*** 0.84 (4.85)*** 0.82 (6.77)***
Θ1 (t-statistic in parentheses) -0.49(-3.11)*** -0.35 -1.58) -0.49 (-2.60)**
Θ2 (t-statistic in parentheses) -0.24(-1.75)* -0.21 (-1.26)
Θ3 (t-statistic in parentheses) 0.27 (2.18)**
AIC/SBC -7.372437-7.213094 -7.356882/-7.229407 --7.354643/-7.259037
Adj R2 0.22 0.23 0.18
Ljung-Box statistics Q(8) = 5.1359 (0.274) Q(8) = 7.3640 (0.195) Q(8) = 10.389 (0.109)
For residuals (sig levels Q(16) =12.791 0.384) Q(16) =16.895 (0.204) Q(16) =23.835 (0.048)
In parentheses) Q(24) =19.196 (0.509) Q(24) = 22.630 (0.364) Q(24) =31.220 (0.092)

Date: 04/04/22 Time: 12:54


Sample: 1980Q3 1998Q2
Included observations: 71
Q-statistic probabilities adjusted for 4 ARMA terms
Autocorrelation Partial Correlation AC   PAC  Q-Stat  Prob

      . | . |       . | . | 1 0.008 0.008 0.0042


      . | . |       . | . | 2 -0.044 -0.044 0.1507
      .*| . |       .*| . | 3 -0.124 -0.124 1.3256
      . | . |       . | . | 4 0.068 0.069 1.6882
      . | . |       . | . | 5 -0.026 -0.038 1.7401 0.187
      . |*. |       . |*. | 6 0.171 0.167 4.0841 0.130
      . | . |       . | . | 7 -0.057 -0.051 4.3508 0.226
      .*| . |       .*| . | 8 -0.098 -0.096 5.1359 0.274
      . | . |       . | . | 9 -0.040 0.002 5.2712 0.384
      . | . |       . | . | 10 0.073 0.029 5.7205 0.455
      . | . |       .*| . | 11 -0.064 -0.074 6.0780 0.531
      .*| . |       .*| . | 12 -0.172 -0.200 8.6733 0.371
      .*| . |       .*| . | 13 -0.116 -0.102 9.8689 0.361
      . |*. |       . |*. | 14 0.091 0.095 10.621 0.388
      . | . |       . | . | 15 0.059 0.025 10.944 0.448
      .*| . |       .*| . | 16 -0.140 -0.193 12.791 0.384
      .*| . |       .*| . | 17 -0.143 -0.121 14.744 0.324
      . | . |       . |*. | 18 0.028 0.098 14.821 0.390
      . | . |       . | . | 19 0.020 0.005 14.863 0.461
      . |*. |       . | . | 20 0.131 0.035 16.594 0.412
      . | . |       .*| . | 21 -0.061 -0.122 16.977 0.456
      .*| . |       .*| . | 22 -0.143 -0.083 19.144 0.383
      . | . |       . | . | 23 -0.018 0.064 19.179 0.445
      . | . |       .*| . | 24 0.012 -0.149 19.196 0.509
      . |*. |       . | . | 25 0.124 0.040 20.939 0.463
      . | . |       . | . | 26 0.015 0.026 20.966 0.523
      .*| . |       . | . | 27 -0.091 -0.059 21.945 0.524
      . | . |       . | . | 28 0.033 0.047 22.073 0.575
      . | . |       .*| . | 29 -0.008 -0.166 22.081 0.631
      .*| . |       .*| . | 30 -0.100 -0.136 23.350 0.613
      . | . |       . | . | 31 -0.054 -0.006 23.723 0.646
      . | . |       . | . | 32 0.031 -0.006 23.852 0.689

Date: 04/04/22 Time: 12:56


Sample: 1980Q3 1998Q2
Included observations: 71
Q-statistic probabilities adjusted for 3 ARMA terms
Autocorrelation Partial Correlation AC   PAC  Q-Stat  Prob

      .*| . |       .*| . | 1 -0.085 -0.085 0.5336


      .*| . |       .*| . | 2 -0.122 -0.130 1.6451
      . |*. |       . |*. | 3 0.097 0.076 2.3650
      . |*. |       . |*. | 4 0.107 0.110 3.2484 0.071
      . | . |       . | . | 5 -0.012 0.029 3.2604 0.196
      . |*. |       . |*. | 6 0.176 0.203 5.7346 0.125
      . | . |       . | . | 7 -0.044 -0.028 5.8948 0.207
      .*| . |       .*| . | 8 -0.134 -0.121 7.3640 0.195
      . | . |       .*| . | 9 -0.024 -0.103 7.4107 0.285
      . |*. |       . | . | 10 0.085 0.004 8.0223 0.331
      . | . |       . | . | 11 -0.047 -0.026 8.2106 0.413
      .*| . |       .*| . | 12 -0.177 -0.177 10.959 0.279
      .*| . |       .*| . | 13 -0.126 -0.163 12.371 0.261
      . |*. |       . | . | 14 0.087 0.066 13.067 0.289
      . | . |       . |*. | 15 0.051 0.108 13.311 0.347
      .*| . |       .*| . | 16 -0.195 -0.149 16.895 0.204
      .*| . |       .*| . | 17 -0.128 -0.151 18.460 0.187
      . | . |       . | . | 18 0.028 0.018 18.535 0.236
      . | . |       . | . | 19 -0.042 -0.004 18.710 0.284
      . |*. |       . |*. | 20 0.105 0.086 19.830 0.283
      .*| . |       .*| . | 21 -0.069 -0.121 20.324 0.315
      .*| . |       .*| . | 22 -0.145 -0.077 22.551 0.258
      . | . |       . | . | 23 0.010 0.040 22.562 0.311
      . | . |       .*| . | 24 -0.025 -0.170 22.630 0.364
      . |*. |       . | . | 25 0.098 0.023 23.717 0.362
      . | . |       . | . | 26 -0.019 -0.021 23.760 0.417
      .*| . |       .*| . | 27 -0.146 -0.072 26.261 0.340
      . | . |       . | . | 28 0.063 0.042 26.744 0.369
      . | . |       .*| . | 29 0.029 -0.144 26.844 0.418
      .*| . |       .*| . | 30 -0.121 -0.158 28.694 0.376
      . | . |       . | . | 31 -0.012 -0.029 28.712 0.427
      . | . |       . | . | 32 0.067 0.034 29.314 0.449

Date: 04/04/22 Time: 12:56


Sample: 1980Q3 1998Q2
Included observations: 71
Q-statistic probabilities adjusted for 2 ARMA terms

Autocorrelation Partial Correlation AC   PAC  Q-Stat  Prob


      . | . |       . | . | 1 0.027 0.027 0.0539
      **| . |       **| . | 2 -0.254 -0.255 4.8856
      . | . |       . | . | 3 0.038 0.058 4.9976 0.025
      . |*. |       . | . | 4 0.099 0.033 5.7541 0.056
      . | . |       . | . | 5 0.032 0.054 5.8364 0.120
      . |*. |       . |*. | 6 0.167 0.209 8.0500 0.090
      . | . |       . | . | 7 -0.043 -0.049 8.2009 0.146
      .*| . |       .*| . | 8 -0.163 -0.085 10.389 0.109
      . | . |       .*| . | 9 -0.023 -0.068 10.432 0.165
      . |*. |       . | . | 10 0.123 0.039 11.710 0.165
      . | . |       . | . | 11 -0.035 -0.059 11.819 0.224
      **| . |       .*| . | 12 -0.218 -0.204 15.999 0.100
      .*| . |       .*| . | 13 -0.135 -0.140 17.628 0.091
      . |*. |       . |*. | 14 0.134 0.096 19.260 0.082
      . |*. |       . | . | 15 0.086 0.066 19.938 0.097
      .*| . |       .*| . | 16 -0.203 -0.177 23.835 0.048
      .*| . |       .*| . | 17 -0.156 -0.109 26.183 0.036
      . | . |       . | . | 18 0.012 0.008 26.196 0.051
      . | . |       . | . | 19 0.020 0.009 26.236 0.070
      . |*. |       . | . | 20 0.120 0.071 27.704 0.067
      .*| . |       .*| . | 21 -0.069 -0.142 28.200 0.080
      .*| . |       . | . | 22 -0.167 -0.028 31.161 0.053
      . | . |       . | . | 23 -0.017 0.008 31.193 0.071
      . | . |       .*| . | 24 0.016 -0.164 31.220 0.092
      . |*. |       . | . | 25 0.120 0.050 32.843 0.084
      . | . |       . | . | 26 -0.020 -0.048 32.888 0.106
      .*| . |       . | . | 27 -0.147 -0.028 35.449 0.080
      . | . |       . | . | 28 0.061 0.049 35.904 0.093
      . | . |       .*| . | 29 0.036 -0.175 36.060 0.114
      .*| . |       .*| . | 30 -0.120 -0.136 37.889 0.101
      . | . |       . | . | 31 -0.017 -0.007 37.924 0.124
      . | . |       . | . | 32 0.048 -0.004 38.234 0.144

Final step – Forecasting, the last step is now to forecast. You can do so on the output of the chosen model. You
will need to first expand the sample range through double clicking on range then expand the sample with a year.
You can choose the option to forecast and remember to specify the period, in this case the period is from
1998Q3 to 1999Q2.

The forecasted values lie within two standard deviations as illustrated above.

You can also combine the forecasted period and the actual period as illustrated below:
Choose the forecasted variable and the actual variable and graph them together.

You might also like