Analysis was performed in SAS (SAS 9.2 for Windows; SAS Institute Inc., Cary, NC), all pictures were also drawn with this statistical software.
2.3 Overview of ARIMA model
In this section, we briefly explain the basic concept about ARIMA model since the methodology of ARIMA estimation and model selection is a classical topic covered in most textbooks on time series analysis. I will give a practical meaning in this context to the model.
In ARIMA model, lags of the differenced series appearing in the forecasting equation are called "auto-regressive" terms, lags of the forecast errors are called "moving average" terms, and a time series which needs to be differenced to be made stationary is said to be an "integrated" version of a stationary series. A nonseasonal ARIMA model is classified as an ARIMA (p,d,q) model, where p is the number of autoregressive terms, d is the number of nonseasonal differences, and q is the number of lagged forecast errors in the prediction equation. As a fact, ARIMA model can be decomposed in two parts. First is the Integrated (I) component (d), which stands for the amount of differencing to be performed on the series to make it stationary. The other component of an ARIMA consists of an ARMA model for the series rendered stationary through differentiation. The ARMA component is further decomposed into AR and MA components. The autoregressive (AR) component captures the correlation between the current value of the time series and some of its past values. For example, AR(2) means that the current observation is correlated with its immediate past value at time t-2. The Moving Average (MA) component represents the duration of the influence of a random (unexplained) shock. For example, MA(3) means that a shock on the value of the series at time t is correlated with the shock at t-3. The Autocorrelation Function (ACF) and Partial Autocorrelation Function (PCF) are used to estimate the values of p and q. When the performance of ACF and PACF are tails off as as exponential decay or damped sine wave and cuts off after lag p then the autocorrelation coefficient may be p. Besides this, when the performance of ACF and PACF are cutoff after lag q and trails off as exponential decay or damped sine wave, then the moving average parameter may be q, what’ more, when the performance of ACF and PACF are trails off after lag (q-p) and tails off after lag (p-q), then the autocorrelation and moving average parameters are p and q respectively.
In order to identify a perfect ARIMA model for a particular time series data, Box and Jenkins proposed a methodology that consists of four phases viz. i) Model identification; ii) Estimation of model parameters; iii) Diagnostic checking for the identified model appropriateness for modeling and iv) Application of the model (i.e. forecasting). That the procedure we have adopted.
PART3 Building ARIMA Model
3.1 Identification
From a purely econometric point of view, the exchange rate displayed in Figure 1, presents some characteristics of a (non stationary) drifted random walk. Further, results of the autocorrelation check for white noise represented in table 1 show non-stationary process, Chi-Square test p value for lag 6, 12, 18 and 24 all less than 0.0001, that is, refuse the null hypothesis that the time series is random walk (or white noise).
Figure 1 Exchange rate, HKD to CHY, 250 weeks from November 2006 to October 2011
Table 1 autocorrelation check for white noise for original data
Furthermore, the sample Autocorrelation Function (ACF) and the sample Partial Autocorrelation Function (PACF), as well as Inverse Autocorrelation Function (IACF) which are representative of the correlation structure across periods of the time series displayed in Figure 2 again show some characteristics of a non-stationary process. That is, the sample ACF of exchange rate decays very slowly, while the corresponding PACF shows only one very significant contribution at the first one lag, also the IACF shows only one very significant contribution at the first one lag.
Figure 2 sample Autocorrelation Function (right top); sample Partial Autocorrelation Function (left bottom), Inverse Autocorrelation Function (right bottom) for original exchange rate data
We also test stationary use Augmented Dickey-Fuller Unit Root Tests, results were displayed in table 2. As for the test of one lag of single mean, the p value is 0.1744, larger than the significant level 0.05; Ljung-Box statistic p value for the test of one lag of trend is also larger than 0.05(p value is 0.744), we can accept the null hypothesis that a unit root is exist. Then make conclusion that the time series is non-stationary process.
Table 2 Augmented Dickey-Fuller Unit Root Tests for original exchange rate data
Then we try first difference transformation to be performed on the series in order to corporate the linear trend then make it stationary. The autocorrelation check for white noise results for data after first difference listed in table 3. We can accept null hypothesis that the time series is random walk since the Chi-Square test p value for lag 6, 12, 18 and 24 all less than 0.0001. That means, it is meaningful for us to study this time series after first difference.
Table 3 autocorrelation check for white noise for exchange rate after first difference
At the same time, We can get the conclusion that the time series is stationary according the results of Augmented Dickey-Fuller Unit Root Tests (Table 4). Either for the test of one lag of single mean or for the test of one lag of trend, p value is 0.0001 (p value <0 .05), we can refuse the null hypothesis that a unit root is exist, that is to say, the time series is stationary process after first difference. According to Figure 3 feature a decaying pattern with reasonable cut-off points, the ACF cuts off after the first lag, while the PACF cuts off after only one significant contribution. Conjointly, Above results suggest an ARIMA (1,1,1) structure.
Table 4 Augmented Dickey-Fuller Unit Root Tests for data after first difference
Figure 3 sample Autocorrelation Function (right top); sample Partial Autocorrelation Function (left bottom), Inverse Autocorrelation Function (right bottom) for exchange rate data after first difference
3.2 Estimation and Diagnostic Checking
Above results implies the following evolution equation to fit this time series:
It can also be written as following equation:
Where Yt represents the exchange rate (in HKD per CHY), B is the backshift operator, and at is random noise. We estimated this model using the ARIMA procedure in SAS through a maximum likelihood procedure assuming that no data are missing. In order to select the most appropriate model, we try moving average parameter from 0 to 3, while autoregressive parameter also from 0 to 3, and select the best one based on Bayesian information criterion (BIC). Table 5 reported the BIC results, as we can see, when moving average parameter and autoregressive parameter both are one ,then the BIC is the smallest (BIC=-13.0202). Moreover, the low (AIC) (-2545.34) and Schwarz criterion (SBC) (-2534.79 ) indicates a good fit for the model.
Table 5 BIC criterion for different model
ARIMA(1,1,1) model parameter estimation and corresponding t-test results can be found in Table 6. Both AR and MA coefficient are significantly different from 0 with values 0.80648 (p<0.0001) and 0.94247 (p<0.0001) respectively. The constant of the model also significantly different from 0 with value -0.0008155(p=0.0057) with significant level 0.05. The numbers in parentheses are the t-test p-values.
Table 6 maximum likelihood estimation of parameters
In order to test the null hypothesis that the residuals can fit a random walk process. The Ljung-Box statistic of the model with degree of freedom 4,10,16,22 were calculated (Table 7), The Ljung-Box statistic of the model is not significantly different from 0 with a value of 11.05 for 4 degrees of freedom and an associated p-value of 0.026, with a value of 20.74 for 10 degrees of freedom and an associated p-value of 0.023, thus reject the null hypothesis of no remaining significant autocorrelation in the residuals of the model. This indicates that the model seems not so adequately capture all the correlation information in the time series.
Table 7 Autocorrelation Check of Residuals
ACF, IACF, PACF and White noise Prob are shown in Figure 4. The ACF, PACF and IACF are cut off before the first lag, suggest that there is tiny correlation relationship exists in residuals with lag from 1 to 24.
Figure 4 Residual Correlation Diagnostics for exchange rate after first order difference
Normality test of residuals was conducted with the UNIVARIATE procedure of SAS, The Kolmogorov-Smirno Statistic for normality with a value of 0.12677 and an associated p-value less than 0.001, as a consequence, we should refuse the null hypothesis that the residuals are normally distributed. This conclusion also can be confirmed by Figure 5(histogram and Quantile-Qualtile plot).
Figure 5 Residual Normality Diagnostics for exchange rate after one order difference
Finally, This model enables us to write the following evolution equation for the exchange rate of Hong Kong dollar to Chinese Yuan.
The equation can also be written as:
where represents the value estimated by the model for Yt. This equation establishes the evolution of the HKD per CHY exchange rate as a weighted sum of its past two values plus two random shocks.
3.3 Forecasting
After above training session, ARIMA modeling has been performed for forecasting weekly average exchange rates. The performances of the ARIMA model has been evaluated on three performance measures: MAE, MRE and MSE with corresponding function as follows:
The low MAE (0.004623), MRE (0.00565) and MSE (0.00267) indicate a accurate forecasting function of the ARIMA time series model. Specificity,Table 8 shows the real weekly exchange rate, the predict exchange rate, the corresponding 95% confidence intervals for predict exchange rate, and absolute percentage error for the 10 weekly test data (from 251th week to 260th week). The absolute percentage error be calculated as the absolute value of predict exchange rate minus real exchange rate except the real exchange rate. For example, in the 252th week, the real exchange rate is 0.8197, while predict exchange rate is 0.8181, absolute percentage error=|0.8182-0.8197|/0.8197=0.18%. Result can also be represented in Figure 6.
Table 8 Forecasted and actual value of weekly average exchange rates for testing data
Figure 6 predict and actual exchange rate picture, the red dot stands for predict exchange rate, star stands for the actual exchange rate, while two green line represent the 95% confidence interval of the predicted exchange rate.
PART4 Conclusion
A forecasting model for weekly average exchange rates, namely ARIMA has been developed using ARIMA procedure SAS software with freely financial data download from website. We have identified an appropriate ARIMA model for HKD to CHY exchange rate time series data using Box and Jenkins methodology. Specificity,In order to make this time series stationary, we choose the first difference method, then suitable ARIMA model was identified by us by observing ACF,PACF and IACF pictures; Moreover, model parameters were estimated by maximum likelihood; Further, diagnostic checking for the identified model appropriateness for modeling with Ljung-Box method, we also test the normality of residuals, although the residuals can’t be perfectly fit a normal distribution, the ARIMA is appreciate for forecasting with high accuracy. This can be confirmed that the values of MAE, MRE and MSE performance criteria are small. In conclusion, it is obvious that our ARIMA time series model shows high predict ability in forecasting exchange rate of HKD to CHY.