An Application of Time Series ARIMA Forecasting Model for Predicting the Ringgit Malaysia-Dollar Exchange Rate

Time series Auto regression Integrated Moving Average (ARIMA) model, that denoted as ARIMA (p, d, q), is basically from Auto regression Moving Average (ARMA) with differencing process. The main object to do ARIMA process is to predict the future performance of certain data, by doing the differencing towards the obvious or current data. The prediction is calculated to have the better data for the next time series. In order to have a good and perfect data, transform the nonstationary data to stationary one. It is possible to have more than one time differencing process to create the best ARIMA model. This writing is to show one of the applications of time series ARIMA through the exchange rate of ringgit Malaysia to dollar. The previous data that was taken from the secondary data is from January 2015 to December 2017 with the data provided weekly, which is the data was collected on every Friday. So the number of data or observations for three years is 161. Hence, we can do the prediction based on the data. Keyword: ARIMA Exchange Rate Ringgit Malaysia Journal of Data Analysis Vol.1, No.1, Month 2018, p. 42-48 43


Introduction
In the current global financial crisis, foreign exchange rates and foreign assets are the main indicators of international financial markets.The continuous depreciation of the US dollar over the past several years has attracted a lot of discussions and literature in developing predictive models.
Currency exchange rates are monitored by the investors to obtain the benefits and risk attached in international business environment.For the investors in Malaysia, it is important to know the value of Malaysian currencies in relation with the different of foreign currencies that will help them in analyzing the investment priced in those foreign currencies.For example, this forecasting can help the Malaysian investors in minimizing the risks and maximizing the returns.The forecasting is also affected by some factors such as economic and political factors that involves uncertainty and nonlinearity.
Exchange rate has several behavior [1].(i) Exchange rates are extremely volatile, with deviation of about 3 percent per month for the US dollar-Japanese yen and US dollar-Deutschmark rates; (ii) changes in exchange rates are very persistent, and the exchange rate closely approximates a random walk; (iii) there is correlation of almost unity between real and nominal exchange rates on high frequency data; and (iv) the variability of real exchange rates increases dramatically when a country moves from fixed to floating exchange rates.
It is not easy to generate the quality of predictions.However, various model forecasting can be developed for that purpose.Some examples of such models are a unit model and a series of time models.To build an economic model, some of the factors that are believed to significantly affect and influence the movement of certain currency needs to be collected and after that, the model that links to these factors to the exchange rates can be developed.One of the time-series models is Autoregressive Integrated Moving Average (ARIMA) that are uses its own past values as a descriptive variable.

Stationary of Mean and Variance
Stationary of variance involving the transformation of the data.To get stationary of variances, the value of lambda must approach to 1.If the value from the process transformation:-Table 1 The formula to transform data.

Value lambda
Formula to transform -2 Do the process differencing to know the stationary of means.If the p-value we get less than 0.05, it shown the data is stationary.

Creating the model
The data of total exchange rate for RM Malaysia is from January 2015 until December 2017, involved ARIMA model.ARIMA model is a model that consist a combination of autoregressive (AR) and moving average (MA) model.The autoregressive (AR) is similar to a linear regression model.It is an autoregressive model that assumes the current time series values depend on the past values from the same series.AR general formula as below [2]: ∅  = seasional AR component coefficients with order p Or it also can be written as:- ∅() = operator autoregressive B is lag operator [3].
The moving average (MA) model specifies that the output variable depends linearly on the current and various past values of a stochastic term.MA general formula as below:-[4] =seasional MA component coefficients with order q Result in graph ACF in moving average process (MA) same as PACF in autoregressive process (AR) meanwhile result for ACF in autoregressive process (AR) same as PACF in moving average process (MA).
If the series is partly autoregressive and partly moving average, the general model is [5]   = with   ∶ AR component coefficients with order p ∅ p ∶ seasonal AR component coefficients with order p θ q ∶ MA component coefficients with order q ∅ Q ∶ seasonal MA component coefficients with order q d ∶ non seasonal differencing order D ∶ seasonal differencing order B ∶ non seasonal backward operators B s ∶ easonal backward operators Y t ∶ time series u t ∶ white noise residual

Model accurate
To choose the best model among all model, value AIC, MAPE and MSE needed.The Akaike information criterion (AIC) is an estimator of the relative quality of statistical models for a given set of data.Given a collection of models for the data, AIC estimates the quality of each model, relative to each of the other models.Thus, AIC provides a means for model selection.The mean absolute percentage error (MAPE), also known as mean absolute percentage deviation (MAPD), is a measure of prediction accuracy of a forecasting method in statistics.The mean squared error (MSE) or mean squared deviation (MSD) of an estimator (of a procedure for estimating an unobserved quantity) measures the average of the squares of the errors or deviations.
The formula to calculate MAPE:- The smallest value of AIC,MAPE and MSE, the model much better to choose as the best model.

Research Method
Data used for this observation is total exchange rate RM Malaysia from 2015 to 2017.Variable that used for this observation is the total exchange rate RM (  ).
To forecast the exchange rate in 2018, it can be determined by using process of ARIMA.The general of integrated autoregressive moving average (ARIMA) model introduction by Box Jenkins included of three dimensions, which are p, d and q. (P) means autoregressive parameter, (d) differencing and (q) moving average parameter.This notation can be summarized as ARIMA (p,d,q).Process ARIMA that not included moving average can be explained as ARI(p,d) and ARIMA that not use autoregressive(AR) can be explained as IMA (d,q).ARIMA model which a nonstationary process can be occur in many ways.One of that is this process could be non-constant mean , constant variance  2 or both mean and variance.
Analysis using ARIMA Box Jenkins starts with creating one series of plot period and plot ACF graph to find out whether the data stationary in mean or variance.If the data does not stationary towards mean, then do the differencing.Otherwise, if the data is not stationary towards variance, then do transformation Box-Cox.Repeat the process until the data stationer.
After getting the stationary data, the next step is to forecast the data of ARIMA based on the ACF and PACF graph.Then, test the parameters of model, as well as test residual assumption which is white noise residual with Ljung-Box test and test normal distributed residual assumption with Kolmogorov Smirnov test.Figure 1 show the descriptive of total of exchange rate for 1USD dollar to Ringgit Malaysia(RM) from year 2015 until 2017.We predict the rate once a week to see the difference of level of change of the rate.We can see from the figure that data for exchange rate for 1USD dollar to RM is very good because mostly the rate only slightly difference between them in three years.
For all those data from year 2015 until 2017, the mean for this exchange rate is 4.117 and the median 4.186.The smallest value for these three years is 3.515, which is in 2 January 2015 and the largest value is in 30 December 2016 which is 4.4845.
b. ARIMA Model Analysis Figure 2 Non-stationary ACF and PACF graphs of total exchange rate.
The main requirement for ARIMA analysis is to have a stationary data.The first step is identifying the stationary data towards variance and mean.The data is a non-stationary data in both variance and mean.It can be seen when plotting an ACF graph, it dying down slowly as shown in Figure 2. To overcome the non-stationary towards mean, differencing process was applied to the data of total exchange rate in RM Malaysia.From the Figure 3, the result shows that the data is stationary after differencing process.The graphs show MA(1) and the model is ARIMA(0,1,6).We also can predict the value of exchange rate in the future for the investor to know when they can buy or sell the currency.We predict for 4 week and the result as Table 3 above.Based on Table 3, the price of exchange rate mostly at range RM4 for 1 US Dollar.So it can be shown that the predicted price for exchange rate is nearly same as the previous rate.Furthermore, we need to take a look at the Mean Absolute Percentage Error (MAPE) to test the forecast error.The value of MAPE for model 6 is 0.9588556.

Conclusion
To conclude from this observation, ARIMA is the best model to predict the exchange rate and this predicting process is one of the examples of application of ARIMA that we can use for goods.For example, people who love to sell and buy currency can predict the right time for them to sell or buy the currency to get the highest income.In this case, R Studio application was used to get the model that we assume is the best.Suggestion to get the best model is by finding another method that may be used to get the smallest predicted residual.Hence, getting the smallest predicted residual will result to have the best ARIMA forecasting model for predicting the ringgit Malaysia-dollar exchange rate.

Figure 1
Figure 1 Line graph for data of exchange rate for 1USD dollar to RM.

Figure 3
Figure 3 Stationary ACF and PACF graphs of total exchange rate.

Table 2 ,
To get the best model which is ARIMA (0,1,6), we need to compare the value of AIC.The smallest value of AIC, the best model can we get.Based on Table2, it show that model6 is the best model because the value of AIC is the smallest compared to the others which is at -435.83.Based on the data that has been stationer, it shown sin graph.The identification for ARIMA model can be done by plotting ACF and PACF.So the ARIMA(0,1,6) model is as below;