22
Building a Seasonal ARIMA Model Firstly, download the excel file called " HK_exports & imports_monthly data " from the "Sample Data" of Econ3600 homepage. Second, open EVIEWS program in this way: click "File", "New", "Workfile" commands, then in the "Workfile Range", choose "Monthly" and type 1980.01 for the "Start observation" and 2000.07 for "End observation" in the dialogue box. Then, we will get a Workfile, and import data from the excel file to generate the following result: (remember "B9" for upper left data cell) Double click "export" to check the import data is consistent with Excel file, and choose "View", "Line" to get a general idea about the time series whether it is level stationary or no. Also, choose "View", "Correlogram" to identify tentative pattern and model components (i.e. ARIMA p, d, q) The resulting graphs are:

ARIMA Season

  • Upload
    apeteka

  • View
    56

  • Download
    0

Embed Size (px)

DESCRIPTION

Xử lý mùa vụ trong arima

Citation preview

Building a Seasonal ARIMA ModelFirstly, download the excel file called "HK_exports & imports_monthly data" from the "Sample Data" of Econ3600 homepage.Second, openEVIEWSprogram in this way: click "File", "New", "Workfile" commands, then in the "Workfile Range", choose "Monthly" and type1980.01for the "Start observation" and2000.07for "End observation" in the dialogue box.Then, we will get aWorkfile,and import data from the excel file to generate the following result:(remember "B9" for upper left data cell)

Double click "export" to check the import data is consistent with Excel file, and choose "View", "Line" to get a general idea about the time series whether it islevel stationary or no. Also, choose "View", "Correlogram" to identify tentative pattern and model components (i.e. ARIMA p, d, q) The resulting graphs are:

From the line graph, you can see that the time series is likely to have upward trend and seasonal cycles, which implies level non-stationary. Also, in the graph of correlogram, the ACFs is suffered from linear decline and there are significant seasonal spikes of PACFs at lags 1 and 13, that is a 12-period seasonality. Also, checking the first-difference of thelnexport,it shows as:

This graph shows that the firs-difference series has a problem of variance non-stationary. Therefore, the series needs to take the logarithm transformation to become variance stationary. In order to generate a logarithm transformation of the original series, i.e.,Log (export),simplyclick "GENR" and type "lnexport = Log(export)".The line graph of LNEXPORT and its correlogram are shown as follows:

Also, the time plot graph of the first-difference of "lnexport" is:

As shown above, the logarithm transformation still cannot solve the problem of variance non-stationary.And from the graph of correlogram of "lnexport", we still find a significant seasonal spike of PACF appears at period 13, it implies the series may be needed to take the 12-period seasonal difference to achieve the stationary.To examine whether the seasonal- difference can generate stationarity or not, click "GENR", type "d12lexport = lexport - lexport(-12)". Then, get a new created series--"d12lexport" in the "Workfile", and use it to plot a line graph to see whether it becomes stationary or not. The result is:

After taking 12-period seasonal-difference of "lnexport", the series "d12lexport" becomes stationary. It implies that the series of lnexport is anI(1)12.Now, the 12-period seasonal-difference oflnexportis"d12lexport",itseems free from variance non-stationary problem. Then we can further search the best ARIMA model.Restart from the previous identification procedures.From the ACFs and PACFs, we may first guess there are AR(1), AR(2) and AR(3) because there are three significant spikes at PACF(1), PACF(2) and PACF(3), and MA(1), MA(2) and MA(3) because there are couple significant spikes at ACF(1), ACF(2), and ACF(3), and after the four lags, the ACFs are slowly declined.So, we can try the "ARIMA(3, 1, 3)121, 1" and specify the ARIMA equation as:

Residual diagnostics:

As you can see that the 12th-order difference series has not achieved white noise because there are still has significant spikes for both ACFs and PACFs at lags 12 and 25, respectively. Then, by guessing to add AR(12) or MA(12) seems suitable. Which one is the best? It will need to compare their results of BIC, SEE and Adjusted R2.First, we try to add AR(12) to the previous regression equation, the result is:

Residual diagnostic:

This result is not improved than before in terms of BIC, SEE and Adjusted R2, also there is still a significant spike at lags 12thof ACFs and PACFs, which means the residual of this model has not achieve white noise. (You are supposed to have ability to check it yourself)Second, we can try another possibility whish is to add MA(12) to the previous specification, the result is:

Residual diagnostic:

This resultseemsbetter thanthe previous oneand the residuals also achieve white noise, however, the coefficients of MA(1) and MA(3) are not significant and the AR roots isalso1.00 which is not satisfied the invertibility condition. Therefore, we may try to drop the MA(1) and MA(3) in the model as follow:Residual diagnostic:

The Q-test of residuals seems no problem, however, the inverted root of AR not satisfied, therefore, other possible model should be tried in order to obtain the better result.Alternative, we can try to start from the first-difference of lnexport. The correlograms are

The ACF and PACF are significant at 12th lag, it indicates the 12-period seasonal effect appeared, therefore, in order to generate the stationary process, we may try to take the 12-period difference of the dlnexport to remove the 12-period seasonal effect. Click "GENR"andtype "d12dlexport =dlexport -dlexport(-12)".The correlograms of the d12dlexport are

Thus, there is one significant spike of ACFs and two significant spikes of PACFs, we may suspect the d12dlexport has AR(2) and MA(1), then we can try to estimate the ARIMA asResidual diagnostic:

From the Q-test, we still observe the significant of ACF and PACF at lag 12th. In order to remove the 12-period effect, we can try another ARIMA model as:

Since the t-statistics of AR(12) and MA(1) is insignificant, so they may be dropped and re-try another ARIMA model as:and the Q-test is

or we can tryand the Q-test isWe can summary the result for several trials and errors as in the following table:ARIMA modelBICAdjusted R2SEEInvertibilityQ-test(No significantACFs or PACFs)

(0,0,0)1,1,(2,1,3)12-2.3610.6810.0700OKX

(0,0,0)1,1,(3,1,3)12-2.4850.7230.0653OKX

(0,0,0)1,1,(3,1,3)12(1,0,1)12-2.6250.7760.0596XOK

(0,0,0)1,1,(3,1,3)12(1,0,1)12-2.4550.7300.0655OKX

(0,0,0)1,1,(3,1,0)12(0,0,1)12-2.6870.7650.0601XOK

(0,0,0)1,1,(2,0,0)12(0,0,1)12-2.5840.7350.0639OKX

(0,0,0)1,1,(1,1,3)12-2.3540.67160.0719OKX

(0,1,0) 0,1,(2,1,0)12(0,0,1)12-2.7100.5730.0600OK

(0,1,0)0,1,(2,1,1)12(0,0,1)12-2.6990.5690.0600

(0,1,0)1,1,(2,1,0)12(0,0,1)12-2.6820.5690.0603

Fromseveral trial models, the ARIMA(0,1,0)1,1,(2,1,0)12(0,0,1)12would be selected as the best one as itsatisfied the invertibility condition and Q-test and hasa relatively smaller BICand larger adjusted R2.The selected best modelcanbeexpressedas

The End